Handle event changes

This commit is contained in:
D. Berge
2025-08-07 20:18:18 +02:00
parent d5e77bc946
commit 5070be5ff3

View File

@@ -48,6 +48,15 @@ export default {
methods: { methods: {
handleEvents (context, {payload}) {
if (payload.pid != this.projectId) {
console.warn(`${this.projectId} ignoring notification for ${payload.pid}`);
return;
}
this.refreshEvents();
},
handleLines (context, {payload}) { handleLines (context, {payload}) {
if (payload.pid != this.projectId) { if (payload.pid != this.projectId) {
console.warn(`${this.projectId} ignoring notification for ${payload.pid}`); console.warn(`${this.projectId} ignoring notification for ${payload.pid}`);
@@ -79,6 +88,14 @@ export default {
registerNotificationHandlers () { registerNotificationHandlers () {
this.$store.dispatch('registerHandler', {
table: 'event',
handler: (context, message) => {
this.handleEvents(context, message);
}
});
["preplot_lines", "preplot_points"].forEach( table => { ["preplot_lines", "preplot_points"].forEach( table => {
this.$store.dispatch('registerHandler', { this.$store.dispatch('registerHandler', {
table, table,