1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-07-20 22:48:02 +00:00

Preserve state between tabs (cc #37) (fixes #56)

This commit is contained in:
2023-07-08 13:07:55 +02:00
parent 64fb9ed173
commit 5476df5fe9
12 changed files with 106 additions and 110 deletions

View File

@ -8,6 +8,7 @@
import { onDestroy } from 'svelte';
export let host;
export let visible = false;
const autoReloadIntervals = [ 1, 2, 5, 10, 30, 60 ];
let filter = 'global';
@ -31,6 +32,10 @@
}
async function refresh() {
if (!visible) {
return;
}
let _logs = [];
({ logs: _logs, total, error } = await host.getLogs(filter));
logs = [];
@ -64,6 +69,8 @@
setTimeout(() => copySucceeded = false, 1500);
}
$: visible && !logs && refresh();
onDestroy(() => {
if (interval) {
clearInterval(interval);