refactor: webui config

This commit is contained in:
手瓜一十雪 committed 2024-05-20 16:56:34 +08:00
1 parent 7b09479cd2
commit 6980a9f3fc
3 files changed
+37 -22

No files matched your search

+8 -5
View File
@@ -35,10 +35,13 @@ setTimeout(() => {
}, 0);
class HTTPHeart{
class HTTPHeart {
intervalId: NodeJS.Timeout | null = null;
start(){
const { heartInterval, } = ob11Config;
start(NewHeartInterval: number | undefined = undefined) {
let { heartInterval } = ob11Config;
if (NewHeartInterval && !Number.isNaN(NewHeartInterval)) {
heartInterval = NewHeartInterval;
}
if (this.intervalId) {
clearInterval(this.intervalId);
}
@@ -48,8 +51,8 @@ class HTTPHeart{
}, heartInterval);
}
stop(){
if (this.intervalId){
stop() {
if (this.intervalId) {
clearInterval(this.intervalId);
}
}