misc: JSON.parse 중 any인 것에 type 지정

This commit is contained in:
2022-04-12 22:45:22 +09:00
parent 6b1006ec19
commit 24474c9f7a
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -456,12 +456,12 @@ const inheritRequiredPoint = computed(() => {
const toggleZoom = ref(true); const toggleZoom = ref(true);
const displayTable = ref(JSON.parse(localStorage.getItem(`conf.${serverID}.join.displayTable`) ?? "true")); const displayTable = ref<boolean>(JSON.parse(localStorage.getItem(`conf.${serverID}.join.displayTable`) ?? "true"));
watch(displayTable, (newValue: boolean) => { watch(displayTable, (newValue: boolean) => {
localStorage.setItem(`conf.${serverID}.join.displayTable`, JSON.stringify(newValue)); localStorage.setItem(`conf.${serverID}.join.displayTable`, JSON.stringify(newValue));
}); });
const displayInherit = ref(JSON.parse(localStorage.getItem(`conf.${serverID}.join.displayInherit`) ?? "true")); const displayInherit = ref<boolean>(JSON.parse(localStorage.getItem(`conf.${serverID}.join.displayInherit`) ?? "true"));
watch(displayInherit, (newValue: boolean) => { watch(displayInherit, (newValue: boolean) => {
localStorage.setItem(`conf.${serverID}.join.displayInherit`, JSON.stringify(newValue)); localStorage.setItem(`conf.${serverID}.join.displayInherit`, JSON.stringify(newValue));
}); });
+1 -1
View File
@@ -418,7 +418,7 @@ async function submitBet(): Promise<void> {
} }
const bettingID = bettingInfo.id; const bettingID = bettingInfo.id;
const bettingType = JSON.parse(pickedBetTypeKey.value); const bettingType = JSON.parse(pickedBetTypeKey.value) as number[];
const amount = betPoint.value; const amount = betPoint.value;
try { try {
await SammoAPI.Betting.Bet({ await SammoAPI.Betting.Bet({
+1 -1
View File
@@ -39,7 +39,7 @@ function getToken(): [number, string] | undefined {
if (!trialToken) { if (!trialToken) {
return; return;
} }
const tokenItems = JSON.parse(trialToken); const tokenItems = JSON.parse(trialToken) as [number, [number, string], string];
if (tokenItems[0] != TOKEN_VERSION) { if (tokenItems[0] != TOKEN_VERSION) {
console.log(tokenItems); console.log(tokenItems);
resetToken(); resetToken();