fix(frontend): dev buildでpreferencesのタブ同期が不必要に行われるのを修正
This commit is contained in:
parent
d06fadd095
commit
9529867630
|
@ -3,7 +3,6 @@
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { v4 as uuid } from 'uuid';
|
|
||||||
import type { PreferencesProfile, StorageProvider } from '@/preferences/manager.js';
|
import type { PreferencesProfile, StorageProvider } from '@/preferences/manager.js';
|
||||||
import { cloudBackup } from '@/preferences/utility.js';
|
import { cloudBackup } from '@/preferences/utility.js';
|
||||||
import { miLocalStorage } from '@/local-storage.js';
|
import { miLocalStorage } from '@/local-storage.js';
|
||||||
|
@ -11,8 +10,7 @@ import { isSameScope, PreferencesManager } from '@/preferences/manager.js';
|
||||||
import { store } from '@/store.js';
|
import { store } from '@/store.js';
|
||||||
import { $i } from '@/i.js';
|
import { $i } from '@/i.js';
|
||||||
import { misskeyApi } from '@/utility/misskey-api.js';
|
import { misskeyApi } from '@/utility/misskey-api.js';
|
||||||
|
import { TAB_ID } from '@/tab-id.js';
|
||||||
const TAB_ID = uuid();
|
|
||||||
|
|
||||||
function createPrefManager(storageProvider: StorageProvider) {
|
function createPrefManager(storageProvider: StorageProvider) {
|
||||||
let profile: PreferencesProfile;
|
let profile: PreferencesProfile;
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { v4 as uuid } from 'uuid';
|
||||||
|
|
||||||
|
// HMR有効時にバグか知らんけど複数回実行されるのでその対策
|
||||||
|
export const TAB_ID = window.sessionStorage.getItem('TAB_ID') ?? uuid();
|
||||||
|
window.sessionStorage.setItem('TAB_ID', TAB_ID);
|
||||||
|
console.log('TAB_ID', TAB_ID);
|
Loading…
Reference in New Issue