Skip to content

Commit

Permalink
fix: bug
Browse files Browse the repository at this point in the history
  • Loading branch information
whes1015 committed Sep 18, 2023
1 parent b7074c2 commit 99baf5a
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 80 deletions.
3 changes: 2 additions & 1 deletion src/core/index/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ let update = false;
let start = false;

const info_list = [];
const new_decay_formula = storage.getItem("new_decay_formula") ?? false;

let click_report_id = -1;

Expand Down Expand Up @@ -569,7 +570,7 @@ function eew_location_intensity(data, depth) {
const dist_surface = Math.sqrt(pow((data.lat - info.lat) * 111) + pow((data.lon - info.lon) * 101));
const dist = Math.sqrt(pow(dist_surface) + pow(data.depth));
let pga = 1.657 * Math.pow(Math.E, (1.533 * data.scale)) * Math.pow(dist, -1.607) * (info.site ?? 1);
if (storage.getItem("new_decay_formula") ?? false) {
if (new_decay_formula) {
pga = 12.44 * Math.exp(1.31 * data.scale) * Math.pow(dist, -1.837) * ((depth < 40) ? region[city][town].site_s : region[city][town].site_d);
}
if (pga > eew_max_pga) {
Expand Down
6 changes: 5 additions & 1 deletion src/core/index/loop.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
/* eslint-disable no-undef */
require("expose-gc");
const { autoUpdater } = require("electron-updater");

autoUpdater.checkForUpdatesAndNotify();

let drawer_lock = false;
let focus_lock = false;
let Zoom = false;
Expand Down Expand Up @@ -311,7 +315,7 @@ setInterval(() => {
if (Now().getMinutes() % 10 == 0) {
get_station_info();
refresh_report_list(true);
check_ota();
autoUpdater.checkForUpdatesAndNotify();
}
}, 60_000);

Expand Down
61 changes: 0 additions & 61 deletions src/core/index/ota.js

This file was deleted.

63 changes: 49 additions & 14 deletions src/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "trem_lite",
"version": "1.9.12",
"version": "1.9.13",
"description": "Taiwan Real-time Earthquake Monitoring ( 臺灣即時地震監測 )",
"homepage": "https://exptech.com.tw/",
"main": "main.js",
Expand Down Expand Up @@ -49,7 +49,13 @@
],
"category": "Development",
"maintainer": "ExpTechTW"
}
},
"publish": [{
"provider": "github",
"owner": "ExpTechTW",
"repo": "TREM-Lite",
"private": false
}]
},
"devDependencies": {
"electron": "^26.2.0",
Expand All @@ -65,6 +71,7 @@
"bytenode": "^1.5.1",
"electron-common-ipc": "^16.0.4",
"electron-fcm-push-receiver": "^2.1.7",
"electron-updater": "^6.1.4",
"expose-gc": "^1.0.0",
"leaflet": "^1.9.4",
"leaflet-edgebuffer": "^1.0.6",
Expand All @@ -75,4 +82,4 @@
"unzipper": "^0.10.14",
"ws": "^8.14.1"
}
}
}

0 comments on commit 99baf5a

Please sign in to comment.