Implement in-unison reload (#7196)

* Resolve #6804
Implement unison reload

* ✌️

* fix

* Update share.vue

fix

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
tamaina
2021-02-17 21:36:56 +09:00
committed by GitHub
parent 9bc0110b86
commit 126826eb5a
12 changed files with 89 additions and 12 deletions

View File

@@ -59,6 +59,7 @@ import { search } from '@/scripts/search';
import { isMobile } from '@/scripts/is-mobile';
import { getThemes } from '@/theme-store';
import { initializeSw } from '@/scripts/initialize-sw';
import { reloadChannel } from '@/scripts/unison-reload';
console.info(`Misskey v${version}`);
@@ -106,6 +107,9 @@ if (defaultStore.state.reportError && !_DEV_) {
// タッチデバイスでCSSの:hoverを機能させる
document.addEventListener('touchend', () => {}, { passive: true });
// 一斉リロード
reloadChannel.addEventListener('message', () => location.reload());
//#region SEE: https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
// TODO: いつの日にか消したい
const vh = window.innerHeight * 0.01;