You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

20 lines
432 B

<script lang="ts">
import { onMount } from "svelte";
import markStale from "../stores/markStale";
let lastFocus = Date.now();
function handleFocus() {
if ((Date.now() - lastFocus) > 60000) {
markStale("*");
lastFocus = Date.now();
}
}
onMount(() => {
window.addEventListener("focus", handleFocus);
return () => {
window.removeEventListener("focus", handleFocus);
}
})
</script>