Merge branch 'sw-notification-action' of https://github.com/tamaina/misskey into sw-notification-action

This commit is contained in:
tamaina
2021-02-24 18:40:26 +09:00
67 changed files with 1274 additions and 265 deletions

View File

@@ -192,8 +192,6 @@ export default (opts) => ({
this.items = this.items.slice(-opts.displayLimit);
this.more = true;
}
} else {
}
this.items.push(item);
// TODO

View File

@@ -1,10 +1,18 @@
// SafariがBroadcastChannel未実装なのでライブラリを使う
import { BroadcastChannel } from 'broadcast-channel';
export const reloadChannel = new BroadcastChannel<'reload'>('reload');
export const reloadChannel = new BroadcastChannel<boolean>('reload');
// BroadcastChannelを用いて、クライアントが一斉にreloadするようにします。
export function unisonReload() {
reloadChannel.postMessage('reload');
location.reload();
export function unisonReload(redirectToRoot: boolean = false) {
reloadChannel.postMessage(!!redirectToRoot);
reload();
}
export function reload(redirectToRoot: boolean = false) {
if (redirectToRoot) {
location.href = '/';
} else {
location.reload();
}
}