diff options
| author | Freya Murphy <freya@freyacat.org> | 2026-03-02 16:05:12 -0500 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2026-03-02 18:39:22 -0500 |
| commit | 24734d408700a72d45c3ff4a679606cab3ec544f (patch) | |
| tree | d0fee0bcf508f3c631f7c26724bb5cd94dfc88a0 /packages/frontend/src/accounts.ts | |
| parent | merge: Release/2025.4.5 (!1258) (diff) | |
| download | sharkey-stable.tar.gz sharkey-stable.tar.bz2 sharkey-stable.zip | |
split url into webUrl and localUrl (like mastodon)stable
Diffstat (limited to 'packages/frontend/src/accounts.ts')
| -rw-r--r-- | packages/frontend/src/accounts.ts | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/packages/frontend/src/accounts.ts b/packages/frontend/src/accounts.ts index 4ee951bbd7..9ce21b9543 100644 --- a/packages/frontend/src/accounts.ts +++ b/packages/frontend/src/accounts.ts @@ -5,7 +5,7 @@ import { defineAsyncComponent, ref } from 'vue'; import * as Misskey from 'misskey-js'; -import { apiUrl, host } from '@@/js/config.js'; +import { apiUrl, localHost } from '@@/js/config.js'; import type { MenuItem } from '@/types/menu.js'; import { showSuspendedDialog } from '@/utility/show-suspended-dialog.js'; import { i18n } from '@/i18n.js'; @@ -137,7 +137,7 @@ export function updateCurrentAccount(accountData: Misskey.entities.MeDetailed) { for (const [key, value] of Object.entries(accountData)) { $i[key] = value; } - store.set('accountInfos', { ...store.s.accountInfos, [host + '/' + $i.id]: $i }); + store.set('accountInfos', { ...store.s.accountInfos, [localHost + '/' + $i.id]: $i }); $i.token = token; miLocalStorage.setItem('account', JSON.stringify($i)); } @@ -148,7 +148,7 @@ export function updateCurrentAccountPartial(accountData: Partial<Misskey.entitie $i[key] = value; } - store.set('accountInfos', { ...store.s.accountInfos, [host + '/' + $i.id]: $i }); + store.set('accountInfos', { ...store.s.accountInfos, [localHost + '/' + $i.id]: $i }); miLocalStorage.setItem('account', JSON.stringify($i)); } @@ -157,7 +157,7 @@ export async function refreshCurrentAccount() { if (!$i) return; return fetchAccount($i.token, $i.id).then(updateCurrentAccount).catch(reason => { if (reason === isAccountDeleted) { - removeAccount(host, $i.id); + removeAccount(localHost, $i.id); if (Object.keys(store.s.accountTokens).length > 0) { login(Object.values(store.s.accountTokens)[0]); } else { @@ -186,7 +186,7 @@ export async function login(token: AccountWithToken['token'], redirect?: string) token, })); - await addAccount(host, me, token); + await addAccount(localHost, me, token); if (redirect) { // 他のタブは再読み込みするだけ @@ -272,7 +272,7 @@ export async function openAccountMenu(opts: { }); if (opts.includeCurrentAccount) { - menuItems.push(createItem(host, $i.id, $i.username, $i, $i.token)); + menuItems.push(createItem(localHost, $i.id, $i.username, $i, $i.token)); } menuItems.push(...accountItems); @@ -295,7 +295,7 @@ export async function openAccountMenu(opts: { action: () => { getAccountWithSignupDialog().then(res => { if (res != null) { - switchAccount(host, res.id); + switchAccount(localHost, res.id); } }); }, @@ -313,7 +313,7 @@ export async function openAccountMenu(opts: { }); } else { if (opts.includeCurrentAccount) { - menuItems.push(createItem(host, $i.id, $i.username, $i, $i.token)); + menuItems.push(createItem(localHost, $i.id, $i.username, $i, $i.token)); } menuItems.push(...accountItems); @@ -329,7 +329,7 @@ export function getAccountWithSigninDialog(): Promise<{ id: string, token: strin const { dispose } = popup(defineAsyncComponent(() => import('@/components/MkSigninDialog.vue')), {}, { done: async (res: Misskey.entities.SigninFlowResponse & { finished: true }) => { const user = await fetchAccount(res.i, res.id, true); - await addAccount(host, user, res.i); + await addAccount(localHost, user, res.i); resolve({ id: res.id, token: res.i }); }, cancelled: () => { @@ -348,7 +348,7 @@ export function getAccountWithSignupDialog(): Promise<{ id: string, token: strin done: async (res: Misskey.entities.SignupResponse) => { const user = JSON.parse(JSON.stringify(res)); delete user.token; - await addAccount(host, user, res.token); + await addAccount(localHost, user, res.token); resolve({ id: res.id, token: res.token }); }, cancelled: () => { |