fix
This commit is contained in:
parent
b1d5a15188
commit
bd46c5329c
|
@ -454,6 +454,10 @@ export const defaultStore = markRaw(new Storage('base', {
|
|||
where: 'device',
|
||||
default: true,
|
||||
},
|
||||
disableWebsocket: {
|
||||
where: 'device',
|
||||
default: false,
|
||||
},
|
||||
|
||||
sound_masterVolume: {
|
||||
where: 'device',
|
||||
|
@ -528,7 +532,6 @@ export class ColdDeviceStorage {
|
|||
lightTheme,
|
||||
darkTheme,
|
||||
syncDeviceDarkMode: true,
|
||||
disableWebsocket: false,
|
||||
plugins: [] as Plugin[],
|
||||
};
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import { $i } from '@/account.js';
|
|||
import { wsOrigin } from '@/config.js';
|
||||
import { StreamMock } from '@/scripts/stream-mock.js';
|
||||
import { isEmbedPage } from '@/scripts/embed-page.js';
|
||||
import { ColdDeviceStorage } from '@/store.js';
|
||||
import { defaultStore } from '@/store.js';
|
||||
|
||||
// heart beat interval in ms
|
||||
const HEART_BEAT_INTERVAL = 1000 * 60;
|
||||
|
@ -21,7 +21,7 @@ let lastHeartbeatCall = 0;
|
|||
export function useStream(): Misskey.Stream {
|
||||
if (stream) return stream;
|
||||
|
||||
if (isEmbedPage() || ColdDeviceStorage.get('disableWebsocket') === true) {
|
||||
if (isEmbedPage() || defaultStore.state.disableWebsocket === true) {
|
||||
stream = markRaw(new StreamMock(wsOrigin, null) as unknown as Misskey.Stream);
|
||||
return stream;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue