toggle streaming

This commit is contained in:
Henry Jameson 2026-08-14 18:11:41 +03:00
commit 8c1d15aaae
2 changed files with 9 additions and 0 deletions

View file

@ -14,6 +14,7 @@ import { useMergedConfigStore } from 'src/stores/merged_config.js'
import { useOAuthStore } from 'src/stores/oauth.js' import { useOAuthStore } from 'src/stores/oauth.js'
import { useSyncConfigStore } from 'src/stores/sync_config.js' import { useSyncConfigStore } from 'src/stores/sync_config.js'
import { useUsersStore } from 'src/stores/users.js' import { useUsersStore } from 'src/stores/users.js'
import { useStreamingStore } from 'src/stores/streaming.js'
import { updateProfile } from 'src/api/user.js' import { updateProfile } from 'src/api/user.js'
import localeService from 'src/services/locale/locale.service.js' import localeService from 'src/services/locale/locale.service.js'
@ -70,6 +71,13 @@ const GeneralTab = {
updateFont(path, value) { updateFont(path, value) {
useLocalConfigStore().set({ path, value }) useLocalConfigStore().set({ path, value })
}, },
toggleStreaming(value) {
if (value) {
useStreamingStore().initSocket()
} else {
useStreamingStore().stopSocket()
}
},
}, },
} }

View file

@ -129,6 +129,7 @@
path="useStreamingApi" path="useStreamingApi"
:local="true" :local="true"
expert="1" expert="1"
@update:model-value="toggleStreaming"
> >
{{ $t('settings.useStreamingApi') }} {{ $t('settings.useStreamingApi') }}
</BooleanSetting> </BooleanSetting>