Merge branch 'io' into merge-upstream
This commit is contained in:
commit
2f437e3924
11 changed files with 171 additions and 24 deletions
|
|
@ -13,7 +13,7 @@ export const hostname = address.hostname;
|
|||
export const url = address.origin;
|
||||
export const apiUrl = url + '/api';
|
||||
export const wsUrl = url.replace('http://', 'ws://').replace('https://', 'wss://') + '/streaming';
|
||||
export const lang = miLocalStorage.getItem('lang') ?? 'en-US';
|
||||
export const lang = miLocalStorage.getItem('lang') ?? 'ja-JP';
|
||||
export const langs = _LANGS_;
|
||||
const preParseLocale = miLocalStorage.getItem('locale');
|
||||
export let locale = preParseLocale ? JSON.parse(preParseLocale) : null;
|
||||
|
|
|
|||
|
|
@ -223,11 +223,11 @@ export const defaultStore = markRaw(new Storage('base', {
|
|||
},
|
||||
useBlurEffectForModal: {
|
||||
where: 'device',
|
||||
default: !/mobile|iphone|android/.test(navigator.userAgent.toLowerCase()), // 循環参照するのでdevice-kind.tsは参照できない
|
||||
default: false,
|
||||
},
|
||||
useBlurEffect: {
|
||||
where: 'device',
|
||||
default: !/mobile|iphone|android/.test(navigator.userAgent.toLowerCase()), // 循環参照するのでdevice-kind.tsは参照できない
|
||||
default: false,
|
||||
},
|
||||
showFixedPostForm: {
|
||||
where: 'device',
|
||||
|
|
|
|||
|
|
@ -24,12 +24,17 @@ import { defaultStore } from '@/store.js';
|
|||
const zIndex = os.claimZIndex('high');
|
||||
|
||||
let hasDisconnected = $ref(false);
|
||||
let timeoutId = $ref<number>();
|
||||
|
||||
function onDisconnected() {
|
||||
hasDisconnected = true;
|
||||
window.clearTimeout(timeoutId);
|
||||
timeoutId = window.setTimeout(() => {
|
||||
hasDisconnected = true;
|
||||
}, 1000 * 10);
|
||||
}
|
||||
|
||||
function resetDisconnected() {
|
||||
window.clearTimeout(timeoutId);
|
||||
hasDisconnected = false;
|
||||
}
|
||||
|
||||
|
|
@ -37,9 +42,12 @@ function reload() {
|
|||
location.reload();
|
||||
}
|
||||
|
||||
useStream().on('_connected_', resetDisconnected);
|
||||
useStream().on('_disconnected_', onDisconnected);
|
||||
|
||||
onUnmounted(() => {
|
||||
window.clearTimeout(timeoutId);
|
||||
useStream().off('_connected_', resetDisconnected);
|
||||
useStream().off('_disconnected_', onDisconnected);
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue