mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-04 02:36:32 +02:00
fix(eslint): add window prefix rules to frontend-embed & frontend-shared (#16531)
This commit is contained in:
@@ -7,18 +7,18 @@ import { onMounted, onUnmounted, ref } from 'vue';
|
||||
import type { Ref } from 'vue';
|
||||
|
||||
export function useDocumentVisibility(): Ref<DocumentVisibilityState> {
|
||||
const visibility = ref(document.visibilityState);
|
||||
const visibility = ref(window.document.visibilityState);
|
||||
|
||||
const onChange = (): void => {
|
||||
visibility.value = document.visibilityState;
|
||||
visibility.value = window.document.visibilityState;
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
document.addEventListener('visibilitychange', onChange);
|
||||
window.document.addEventListener('visibilitychange', onChange);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
document.removeEventListener('visibilitychange', onChange);
|
||||
window.document.removeEventListener('visibilitychange', onChange);
|
||||
});
|
||||
|
||||
return visibility;
|
||||
|
||||
Reference in New Issue
Block a user