mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-24 00:39:32 +09:00
fix
This commit is contained in:
parent
b1d5a15188
commit
bd46c5329c
@ -454,6 +454,10 @@ export const defaultStore = markRaw(new Storage('base', {
|
|||||||
where: 'device',
|
where: 'device',
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
|
disableWebsocket: {
|
||||||
|
where: 'device',
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
|
||||||
sound_masterVolume: {
|
sound_masterVolume: {
|
||||||
where: 'device',
|
where: 'device',
|
||||||
@ -528,7 +532,6 @@ export class ColdDeviceStorage {
|
|||||||
lightTheme,
|
lightTheme,
|
||||||
darkTheme,
|
darkTheme,
|
||||||
syncDeviceDarkMode: true,
|
syncDeviceDarkMode: true,
|
||||||
disableWebsocket: false,
|
|
||||||
plugins: [] as Plugin[],
|
plugins: [] as Plugin[],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import { $i } from '@/account.js';
|
|||||||
import { wsOrigin } from '@/config.js';
|
import { wsOrigin } from '@/config.js';
|
||||||
import { StreamMock } from '@/scripts/stream-mock.js';
|
import { StreamMock } from '@/scripts/stream-mock.js';
|
||||||
import { isEmbedPage } from '@/scripts/embed-page.js';
|
import { isEmbedPage } from '@/scripts/embed-page.js';
|
||||||
import { ColdDeviceStorage } from '@/store.js';
|
import { defaultStore } from '@/store.js';
|
||||||
|
|
||||||
// heart beat interval in ms
|
// heart beat interval in ms
|
||||||
const HEART_BEAT_INTERVAL = 1000 * 60;
|
const HEART_BEAT_INTERVAL = 1000 * 60;
|
||||||
@ -21,7 +21,7 @@ let lastHeartbeatCall = 0;
|
|||||||
export function useStream(): Misskey.Stream {
|
export function useStream(): Misskey.Stream {
|
||||||
if (stream) return 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);
|
stream = markRaw(new StreamMock(wsOrigin, null) as unknown as Misskey.Stream);
|
||||||
return stream;
|
return stream;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user