Skip to content

Commit 024ae21

Browse files
committed
add catch ex
1 parent 8eaf529 commit 024ae21

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/App.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,15 @@ function App() {
6969
}
7070

7171
const init = async () => {
72-
const vpnTimeUsedInMin = parseInt(localStorage.getItem("vpnTimeUsedInMin") || "0");
72+
let vpnTimeUsedInMin = 0
73+
try {
74+
const ss = await localStorage.getItem("vpnTimeUsedInMin")
75+
if (ss) {
76+
vpnTimeUsedInMin = parseInt(ss)
77+
}
78+
} catch (ex) {
79+
80+
}
7381
_vpnTimeUsedInMin.current = vpnTimeUsedInMin;
7482

7583
const queryParams = parseQueryParams(window.location.search);

0 commit comments

Comments
 (0)