summaryrefslogtreecommitdiff
path: root/packages/frontend/src/accounts.ts
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2025-09-06 12:41:27 +0900
committersyuilo <4439005+syuilo@users.noreply.github.com>2025-09-06 12:41:27 +0900
commit5b994b3e03345c4d701e1d70eab6c30afe669d0e (patch)
tree00810487caeeec1d1421cb368a8e1e821b767779 /packages/frontend/src/accounts.ts
parentenhance(frontend): クリップ/リスト/アンテナ/ロール追加系メ... (diff)
downloadmisskey-5b994b3e03345c4d701e1d70eab6c30afe669d0e.tar.gz
misskey-5b994b3e03345c4d701e1d70eab6c30afe669d0e.tar.bz2
misskey-5b994b3e03345c4d701e1d70eab6c30afe669d0e.zip
fix(frontend): プロファイルを復元後アカウントの切り替えができない問題を修正
Fix #16508
Diffstat (limited to 'packages/frontend/src/accounts.ts')
-rw-r--r--packages/frontend/src/accounts.ts21
1 files changed, 19 insertions, 2 deletions
diff --git a/packages/frontend/src/accounts.ts b/packages/frontend/src/accounts.ts
index afa2ecb911..60f7cd0b4b 100644
--- a/packages/frontend/src/accounts.ts
+++ b/packages/frontend/src/accounts.ts
@@ -251,13 +251,30 @@ export async function openAccountMenu(opts: {
}
},
};
- } else {
+ } else { // プロファイルを復元した場合などはアカウントのトークンや詳細情報はstoreにキャッシュされていない
return {
type: 'button' as const,
text: username,
active: opts.active != null ? opts.active === id : false,
action: async () => {
- // TODO
+ const { dispose } = popup(defineAsyncComponent(() => import('@/components/MkSigninDialog.vue')), {
+ initialUsername: username,
+ }, {
+ done: async (res: Misskey.entities.SigninFlowResponse & { finished: true }) => {
+ store.set('accountTokens', { ...store.s.accountTokens, [host + '/' + res.id]: res.i });
+
+ if (callback) {
+ fetchAccount(res.i, id).then(account => {
+ callback(account);
+ });
+ } else {
+ switchAccount(host, id);
+ }
+ },
+ closed: () => {
+ dispose();
+ },
+ });
},
};
}