enhane: 完全ログアウト時にすべてのタブがウェルカムページへ移動するように (#7928)

* enhane: unison-reloadに指定したパスに移動できるように

* null

* null

* null

* add comments
This commit is contained in:
tamaina 2021-11-05 00:09:13 +09:00 committed by GitHub
parent 1c38c7010d
commit e2862ed097
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 7 deletions

View file

@ -61,7 +61,7 @@ export async function signout() {
document.cookie = `igi=; path=/`;
if (accounts.length > 0) login(accounts[0].token);
else unisonReload();
else unisonReload('/');
}
export async function getAccounts(): Promise<{ id: Account['id'], token: Account['token'] }[]> {
@ -122,7 +122,9 @@ export async function login(token: Account['token'], redirect?: string) {
await addAccount(me.id, token);
if (redirect) {
reloadChannel.postMessage('reload');
// 他のタブは再読み込みするだけ
reloadChannel.postMessage(null);
// このページはredirectで指定された先に移動
location.href = redirect;
return;
}