mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-17 02:49:01 +01:00
12 lines
380 B
TypeScript
12 lines
380 B
TypeScript
export const reloadChannel = new BroadcastChannel('reload'); // string | null
|
|
|
|
// BroadcastChannelを用いて、クライアントが一斉にreloadするようにします。
|
|
export function unisonReload(path?: string) {
|
|
if (path !== undefined) {
|
|
reloadChannel.postMessage(path);
|
|
location.href = path;
|
|
} else {
|
|
reloadChannel.postMessage(null);
|
|
location.reload();
|
|
}
|
|
}
|