Fix #99410: SocketIO Reconnect Web Interface #104235
@ -1,13 +1,6 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { useNotifs } from '@/stores/notifications'
|
import { useNotifs } from '@/stores/notifications'
|
||||||
|
|
||||||
// Not sure if this is the best way to deal with those notifications. It feels a
|
|
||||||
// bit spaghetto to have one Pinia store influence another. Maybe move this to
|
|
||||||
// the app level once the Workers and Settings views are fleshed out. Maybe
|
|
||||||
// that'll cause the Notifications popover to be handled at the app-global
|
|
||||||
// level, instead of per view, creating a better place to put this logic.
|
|
||||||
const notifs = useNotifs();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Status of the SocketIO/Websocket connection to Flamenco Manager.
|
* Status of the SocketIO/Websocket connection to Flamenco Manager.
|
||||||
*/
|
*/
|
||||||
@ -30,7 +23,7 @@ export const useSocketStatus = defineStore('socket-status', {
|
|||||||
// Only patch the state if it actually will change.
|
// Only patch the state if it actually will change.
|
||||||
if (!this.isConnected)
|
if (!this.isConnected)
|
||||||
return;
|
return;
|
||||||
notifs.add(`Connection to Flamenco Manager lost`);
|
this._get_notifs().add(`Connection to Flamenco Manager lost`);
|
||||||
this.$patch({
|
this.$patch({
|
||||||
isConnected: false,
|
isConnected: false,
|
||||||
wasEverDisconnected: true,
|
wasEverDisconnected: true,
|
||||||
@ -46,11 +39,20 @@ export const useSocketStatus = defineStore('socket-status', {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (this.wasEverDisconnected)
|
if (this.wasEverDisconnected)
|
||||||
notifs.add("Connection to Flamenco Manager established");
|
this._get_notifs().add("Connection to Flamenco Manager established");
|
||||||
this.$patch({
|
this.$patch({
|
||||||
isConnected: true,
|
isConnected: true,
|
||||||
message: "",
|
message: "",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_get_notifs() {
|
||||||
|
// Not sure if this is the best way to deal with those notifications. It feels a
|
||||||
|
// bit spaghetto to have one Pinia store influence another. Maybe move this to
|
||||||
|
// the app level once the Workers and Settings views are fleshed out. Maybe
|
||||||
|
// that'll cause the Notifications popover to be handled at the app-global
|
||||||
|
// level, instead of per view, creating a better place to put this logic.
|
||||||
|
return useNotifs();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user