Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

### Client
- Fix: ログアウトした際に処理が終了しない問題を修正
- Fix: 複数アカウントでログインしている場合に、以前のバージョンから移行すると、アカウントの設定が正しく移行されない問題を修正

### Server
-
Expand Down
17 changes: 17 additions & 0 deletions packages/frontend/src/pref-migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
*/

import { v4 as uuid } from 'uuid';
import * as Misskey from 'misskey-js';
import type { DeckProfile } from '@/deck.js';
import { ColdDeviceStorage, store } from '@/store.js';
import { get as iget } from '@/utility/idb-proxy.js';
import { host } from '@@/js/config.js';
import { prefer } from '@/preferences.js';
import { misskeyApi } from '@/utility/misskey-api.js';
import { deckStore } from '@/ui/deck/deck-store.js';
Expand Down Expand Up @@ -51,6 +54,20 @@ export function migrateOldSettings() {
prefer.commit('deck.profiles', profiles);
});

iget('accounts').then(async (accountTokens: { id: string, token: string }[] | null) => {
if (accountTokens != null) {
store.set('accountTokens', accountTokens.reduce((acc, { id, token }) => {
acc[id] = token;
return acc;
}, {}));

const accounts = await misskeyApi('users/show', {
userIds: accountTokens.map(x => x.id),
});
prefer.commit('accounts', accounts.map(x => [host, x] as [string, Misskey.entities.User]));
}
});

prefer.commit('lightTheme', ColdDeviceStorage.get('lightTheme'));
prefer.commit('darkTheme', ColdDeviceStorage.get('darkTheme'));
prefer.commit('syncDeviceDarkMode', ColdDeviceStorage.get('syncDeviceDarkMode'));
Expand Down
Loading