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

This commit is contained in:
2022-04-12 22:45:22 +09:00
parent 06249f29cf
commit f67fa5c764
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 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) => {
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) => {
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 bettingType = JSON.parse(pickedBetTypeKey.value);
const bettingType = JSON.parse(pickedBetTypeKey.value) as number[];
const amount = betPoint.value;
try {
await SammoAPI.Betting.Bet({
+1 -1
View File
@@ -39,7 +39,7 @@ function getToken(): [number, string] | undefined {
if (!trialToken) {
return;
}
const tokenItems = JSON.parse(trialToken);
const tokenItems = JSON.parse(trialToken) as [number, [number, string], string];
if (tokenItems[0] != TOKEN_VERSION) {
console.log(tokenItems);
resetToken();