diff --git a/src/components/settings_modal/tabs/general_tab.js b/src/components/settings_modal/tabs/general_tab.js index c090557cf..f875a9677 100644 --- a/src/components/settings_modal/tabs/general_tab.js +++ b/src/components/settings_modal/tabs/general_tab.js @@ -72,6 +72,9 @@ const GeneralTab = { useLocalConfigStore().set({ path, value }) }, toggleStreaming(value) { + // Streaming is not available for the unauthenticated + if (!useOAuthStore().token) return + if (value) { useStreamingStore().initSocket() } else { diff --git a/src/stores/streaming.js b/src/stores/streaming.js index aac1fa860..f891bc648 100644 --- a/src/stores/streaming.js +++ b/src/stores/streaming.js @@ -130,6 +130,9 @@ export const useStreamingStore = defineStore('streaming', { stopSocket() { this.socket.close() this.state = WSConnectionStatus.CLOSED + this.retrying = false + this.retryMultiplier = 1 + this.error = null }, getSubArgs(stream) { @@ -229,6 +232,8 @@ export const useStreamingStore = defineStore('streaming', { ) setTimeout(() => { + if (this.retrying) return // retry aborted (i.e. due to logout) + this.initSocket() }, retryTimeout(this.retryMultiplier))