Redirect to welcome page when sign out
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
// SafariがBroadcastChannel未実装なのでライブラリを使う
|
||||
import { BroadcastChannel } from 'broadcast-channel';
|
||||
|
||||
export const reloadChannel = new BroadcastChannel<'reload'>('reload');
|
||||
export const reloadChannel = new BroadcastChannel<string>('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('reload');
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user