diff options
| author | tamaina <tamaina@hotmail.co.jp> | 2021-11-05 00:09:13 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-05 00:09:13 +0900 |
| commit | e2862ed097a7de54a1a617f55dffee52a00010fc (patch) | |
| tree | eed0249ced2af7bf85688649d9f6a1a88b9be772 /src/client/scripts | |
| parent | refactor: Introduce list of MFM Functions (#7882) (diff) | |
| download | sharkey-e2862ed097a7de54a1a617f55dffee52a00010fc.tar.gz sharkey-e2862ed097a7de54a1a617f55dffee52a00010fc.tar.bz2 sharkey-e2862ed097a7de54a1a617f55dffee52a00010fc.zip | |
enhane: 完全ログアウト時にすべてのタブがウェルカムページへ移動するように (#7928)
* enhane: unison-reloadに指定したパスに移動できるように
* null
* null
* null
* add comments
Diffstat (limited to 'src/client/scripts')
| -rw-r--r-- | src/client/scripts/unison-reload.ts | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/client/scripts/unison-reload.ts b/src/client/scripts/unison-reload.ts index 92556aefaa..59af584c1b 100644 --- a/src/client/scripts/unison-reload.ts +++ b/src/client/scripts/unison-reload.ts @@ -1,10 +1,15 @@ // SafariがBroadcastChannel未実装なのでライブラリを使う import { BroadcastChannel } from 'broadcast-channel'; -export const reloadChannel = new BroadcastChannel<'reload'>('reload'); +export const reloadChannel = new BroadcastChannel<string | null>('reload'); // BroadcastChannelを用いて、クライアントが一斉にreloadするようにします。 -export function unisonReload() { - reloadChannel.postMessage('reload'); - location.reload(); +export function unisonReload(path?: string) { + if (path !== undefined) { + reloadChannel.postMessage(path); + location.href = path; + } else { + reloadChannel.postMessage(null); + location.reload(); + } } |