From 1c589252c9d64e902303c88c155a039317a0e9f8 Mon Sep 17 00:00:00 2001 From: tamaina Date: Fri, 29 Oct 2021 14:20:47 +0900 Subject: [PATCH] rename --- src/client/init.ts | 4 ++-- src/client/scripts/login-id.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/init.ts b/src/client/init.ts index 2f5d03ee32..654e176398 100644 --- a/src/client/init.ts +++ b/src/client/init.ts @@ -37,7 +37,7 @@ import { isMobile } from '@client/scripts/is-mobile'; import { initializeSw } from '@client/scripts/initialize-sw'; import { reloadChannel } from '@client/scripts/unison-reload'; import { reactionPicker } from '@client/scripts/reaction-picker'; -import { deleteLoginId } from '@client/scripts/login-id'; +import { getUrlWithoutLoginId } from '@client/scripts/login-id'; import { getAccountFromId } from '@client/scripts/get-account-from-id'; console.info(`Misskey v${version}`); @@ -123,7 +123,7 @@ const params = new URLSearchParams(location.search); const loginId = params.get('loginId'); if (loginId) { - const target = deleteLoginId(location.href); + const target = getUrlWithoutLoginId(location.href); if (!$i || $i.id !== loginId) { const account = await getAccountFromId(loginId); diff --git a/src/client/scripts/login-id.ts b/src/client/scripts/login-id.ts index 50e5229558..0f9c6be4a9 100644 --- a/src/client/scripts/login-id.ts +++ b/src/client/scripts/login-id.ts @@ -1,10 +1,10 @@ -export function appendLoginId(url: string, loginId: string) { +export function getUrlWithLoginId(url: string, loginId: string) { const u = new URL(url, origin); u.searchParams.append('loginId', loginId); return u.toString(); } -export function deleteLoginId(url: string) { +export function getUrlWithoutLoginId(url: string) { const u = new URL(url); u.searchParams.delete('loginId'); return u.toString();