This commit is contained in:
tamaina 2021-02-21 14:45:20 +09:00
parent 852e4db958
commit 4522c752ee
1 changed files with 2 additions and 2 deletions

View File

@ -4,12 +4,12 @@ import { BroadcastChannel } from 'broadcast-channel';
export const reloadChannel = new BroadcastChannel<boolean>('reload');
// BroadcastChannelを用いて、クライアントが一斉にreloadするようにします。
export function unisonReload(redirectToRoot?: boolean) {
export function unisonReload(redirectToRoot: boolean = false) {
reloadChannel.postMessage(!!redirectToRoot);
reload();
}
export function reload(redirectToRoot?: boolean) {
export function reload(redirectToRoot: boolean = false) {
if (redirectToRoot) {
location.href = '/';
} else {