1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-03 00:56:00 +02:00

refactor(frontend): アカウント情報はstore管理に

This commit is contained in:
syuilo
2025-04-16 09:25:13 +09:00
parent de19d9a4d4
commit 75267f87d5
5 changed files with 61 additions and 44 deletions

View File

@@ -157,7 +157,7 @@ async function init() {
const accounts = await getAccounts();
const accountIdsToFetch = accounts.map(a => a.user.id).filter(id => !users.value.has(id));
const accountIdsToFetch = accounts.map(a => a.id).filter(id => !users.value.has(id));
if (accountIdsToFetch.length > 0) {
const usersRes = await misskeyApi('users/show', {
@@ -169,7 +169,7 @@ async function init() {
users.value.set(user.id, {
...user,
token: accounts.find(a => a.user.id === user.id)!.token,
token: accounts.find(a => a.id === user.id)!.token,
});
}
}

View File

@@ -879,7 +879,7 @@ async function post(ev?: MouseEvent) {
if (postAccount.value) {
const storedAccounts = await getAccounts();
token = storedAccounts.find(x => x.user.id === postAccount.value?.id)?.token;
token = storedAccounts.find(x => x.id === postAccount.value?.id)?.token;
}
posting.value = true;