mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-07-16 05:13:36 +00:00
perf: frontend request cache, poll pause, and code-split shell (#1052)
Host/status caching, shell code-split, SSH pool waits, host-metrics concurrency, background-tab idle, per-host status subscriptions, homepage poll quieting, and virtualized host sidebar + file manager lists.
This commit is contained in:
@@ -14,6 +14,7 @@ import type {
|
||||
} from "@/types/homepage-types";
|
||||
import { GRID_SIZE } from "@/types/homepage-types";
|
||||
import { WidgetTitle } from "./WidgetTitle";
|
||||
import { runVisibleInterval } from "../use-visible-interval";
|
||||
|
||||
interface WttrCurrent {
|
||||
temp_C: string;
|
||||
@@ -77,10 +78,15 @@ function WeatherWidget({
|
||||
}
|
||||
};
|
||||
fetchWeather();
|
||||
const interval = setInterval(fetchWeather, 10 * 60 * 1000);
|
||||
const stop = runVisibleInterval(
|
||||
() => {
|
||||
void fetchWeather();
|
||||
},
|
||||
10 * 60 * 1000,
|
||||
);
|
||||
return () => {
|
||||
cancelled = true;
|
||||
clearInterval(interval);
|
||||
stop();
|
||||
};
|
||||
}, [location]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user