rename
This commit is contained in:
parent
7d75a5a0e0
commit
1c589252c9
|
@ -37,7 +37,7 @@ import { isMobile } from '@client/scripts/is-mobile';
|
||||||
import { initializeSw } from '@client/scripts/initialize-sw';
|
import { initializeSw } from '@client/scripts/initialize-sw';
|
||||||
import { reloadChannel } from '@client/scripts/unison-reload';
|
import { reloadChannel } from '@client/scripts/unison-reload';
|
||||||
import { reactionPicker } from '@client/scripts/reaction-picker';
|
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';
|
import { getAccountFromId } from '@client/scripts/get-account-from-id';
|
||||||
|
|
||||||
console.info(`Misskey v${version}`);
|
console.info(`Misskey v${version}`);
|
||||||
|
@ -123,7 +123,7 @@ const params = new URLSearchParams(location.search);
|
||||||
const loginId = params.get('loginId');
|
const loginId = params.get('loginId');
|
||||||
|
|
||||||
if (loginId) {
|
if (loginId) {
|
||||||
const target = deleteLoginId(location.href);
|
const target = getUrlWithoutLoginId(location.href);
|
||||||
|
|
||||||
if (!$i || $i.id !== loginId) {
|
if (!$i || $i.id !== loginId) {
|
||||||
const account = await getAccountFromId(loginId);
|
const account = await getAccountFromId(loginId);
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
export function appendLoginId(url: string, loginId: string) {
|
export function getUrlWithLoginId(url: string, loginId: string) {
|
||||||
const u = new URL(url, origin);
|
const u = new URL(url, origin);
|
||||||
u.searchParams.append('loginId', loginId);
|
u.searchParams.append('loginId', loginId);
|
||||||
return u.toString();
|
return u.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
export function deleteLoginId(url: string) {
|
export function getUrlWithoutLoginId(url: string) {
|
||||||
const u = new URL(url);
|
const u = new URL(url);
|
||||||
u.searchParams.delete('loginId');
|
u.searchParams.delete('loginId');
|
||||||
return u.toString();
|
return u.toString();
|
||||||
|
|
Loading…
Reference in New Issue