Skip to content

Commit

Permalink
fix: eew
Browse files Browse the repository at this point in the history
  • Loading branch information
yayacat committed Jan 29, 2025
1 parent 83aa1da commit 8f80733
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
10 changes: 5 additions & 5 deletions signature.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"timestamp": 1738121408904,
"version": "1.0.0",
"timestamp": 1738126807155,
"version": "1.0.1",
"fileHashes": {
"config.yml": "73a6eb7e322e82b108b1ca18ca159a430a36c219a501847ca6504f424c55baf7",
"index.js": "e9029368314c6feb199abbd4e443399e0093655ad42960e32949f3ddf74cb3d2",
"info.json": "ddbfb31f60ad086a3880162ab909f4d1ef1b2611789dc269cab33d1df1451065",
"info.json": "8496c5fc508ee41229d739c065818256476addbf160944333b23b25312d46e0e",
"resource/default.yml": "73a6eb7e322e82b108b1ca18ca159a430a36c219a501847ca6504f424c55baf7",
"web/audio/1.wav": "1f7fea8773b5a2dc85b858673eeeaed35b855928a3bb79c7ae07ea9364ce8569",
"web/audio/2.wav": "b462a693887188e64b961201468d49aee992193a0817dfccdbaa5212587c019d",
Expand Down Expand Up @@ -32,12 +32,12 @@
"web/css/toast.css": "f2555beb5e21ba66a99d6ce244c4c68df11fc3302ff139f88a21ad912e9bef92",
"web/index.html": "cd6a85399a6e838968314a1ebd13036e6222266400d7284fb90d065f6f639f16",
"web/js/box.js": "89c611e48c3417a503be6a482f4cf4e6d154fb8e5de7bf6a2565c955949bb740",
"web/js/eew.js": "ae02dccb03761922d05f08f4789152d393db92d7f43e055106b9e54033890501",
"web/js/eew.js": "cca0e6042a087311f24f70e2217037e3ed905a9006ebf33498f74e32e5b55730",
"web/js/index.js": "bd59fc99807f656a6aac6c1c438f77f2eb15b6444e0936104e2602e5a3f2a875",
"web/js/nav.js": "9f7c1e0226b8b6cffd3d46d791166651e8c2c1e7081a8c8cf4911cac54b6eb1e",
"web/resource/js/echarts.js": "4ff1bfa8176d508c2c654960111ae00044fe891358c0c7b692a92698357011b0",
"web/resource/region_v2.json": "1e6837a1d099e866a327c521ee539fa29b3e4454d4d3cfe2046a74b6baaa0652"
},
"signature": "uF9MwHfTnlNLcF4dyk7slDeV8FY6C/uggmyt1I8/XK5udJDlDvKOVc/vAgseiP1E5Rku3DRl1r/swURsfUX6SCyH49wd0/AznNryG9i9b5UNaY+VUOIzgUnn5OOtqX5IyHB3zw3z9iZhkWcqwPZnE2rbInGjulglWJpUPxRh+fDVvOuMwTW98+Rjn3k5hqnNi2EQE8/w/Lhgba004a9QvqCYyUDKzFpRj2nmwEX4UqGZ5DpCTtJaqcWgR2puULkCo2J2WQiTkx8tzPlwbmXbiW0gFHsie5un+rYfcX9Lqp80gwvjKZzI26KGno+WjnShcP5bjIHg3sL1EsuwvfwZ2Q==",
"signature": "jcX9KCROFJQrtq1mr6fiR8XwgCdv8foQKbALW9Nbw7EdaUxuUhTq7SPIBnPENf8A8Hi8Xc6sODm0IHutm28mObDyVRFYR9Pf0Y2403Zg0R490r3gqL5bDfwg4UGzLDwFbERYRbgfaXaYcnzhRwPB+K0IN0qm9SZzLj02xRh+BAI1eMJadvC87ynsdtFyhJDIdJbgDBm2fLto9DN2GwgP6ASdIwgEgHQgRfJKK0AcRZYKFAULcxs4s67jpbwWxUSNbpqlK7dBrxiXnyMcyzYj8ZfYiiE84caVy1QAjG6Ke6SEnHevxM/McEtZ64tfQQ2iGErdvEKIDUPj3pDWOpLT6g==",
"keyId": "official"
}
10 changes: 6 additions & 4 deletions web/js/eew.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ let area_alert_text = "";
ipcRenderer.on("play_mode", (event, ans) => {
if (ans == 0) {
play_mode_name = "HTTP";
if (play_mode_num == 2) eew_timer_fun();
if (play_mode_num == 2) eew_timer_fun(true);
} else if (ans == 1) {
play_mode_name = "websocket";
} else if (ans == 2) {
Expand Down Expand Up @@ -181,7 +181,9 @@ function eew_area_pga(lat, lon, depth, mag) {
return json;
}

function eew_timer_fun() {
function eew_timer_fun(stop = false) {
let time = 60_000;
if (stop) time = 0;
if (eew_timer) clearTimeout(eew_timer);
eew_timer = null;
eew_timer = setTimeout(() => {
Expand Down Expand Up @@ -209,7 +211,7 @@ function eew_timer_fun() {
eew_rts = 0;
eew_alert = 0;
area_alert_text = "";
}, 60_000);
}, time);
}

ipcRenderer.on("showEew", (event, ans) => {
Expand Down Expand Up @@ -370,7 +372,7 @@ ipcRenderer.on("showEew", (event, ans) => {
],
});

if (play_mode_num == 2) eew_timer_fun();
if (play_mode_num == 2) eew_timer_fun(true);
});

ipcRenderer.on("EewEnd", (event, ans) => {
Expand Down

0 comments on commit 8f80733

Please sign in to comment.