From 489d95f23fb602dd1dce0bcdd0973baf8096b77b Mon Sep 17 00:00:00 2001 From: cutls Date: Fri, 10 Jul 2020 14:21:24 +0900 Subject: [PATCH] fix --- app/js/common/version.js | 2 +- app/js/login/login.js | 3 ++- app/js/ui/tips.js | 12 ++++-------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/app/js/common/version.js b/app/js/common/version.js index 031c5623..1606c51a 100644 --- a/app/js/common/version.js +++ b/app/js/common/version.js @@ -160,7 +160,7 @@ setInterval(function () { infowebsocket() } }, 10000) -function toastInterpret(obj) { +async function toastInterpret(obj) { if (obj.type == 'textv2') { if (~obj.languages.indexOf(lang.language)) { let showVer = true diff --git a/app/js/login/login.js b/app/js/login/login.js index 6027c01b..c3c7a657 100644 --- a/app/js/login/login.js +++ b/app/js/login/login.js @@ -387,7 +387,8 @@ function ckdb(acct_id) { var letters = domain + '_letters' var quoteMarker = domain + '_quote' if (idata) { - var json = JSON.parse(idata) + //check and replace json to idata + var json = idata if (json[quoteMarker] == 'enabled') { localStorage.setItem('quoters', 'true') localStorage.setItem('quote_' + acct_id, 'true') diff --git a/app/js/ui/tips.js b/app/js/ui/tips.js index bb6bce74..b33057b1 100644 --- a/app/js/ui/tips.js +++ b/app/js/ui/tips.js @@ -157,7 +157,7 @@ function spotifytips() { setLog(start, 'JSON', error) console.error(error) }) - .then(function(json) { + .then(async function(json) { var ms = json.progress_ms if(!ms) { tips('ver') @@ -175,7 +175,7 @@ function spotifytips() { } } artisttxt = escapeHTML(artisttxt) - sleep(last) + await sleep(last) var tms = item.duration_ms var per = (ms / item.duration_ms) * 100 ms = ms / 1000 @@ -251,10 +251,10 @@ function trendTagonTipInterval() { } //時計 var clockint -function clock() { +async function clock() { var now = new Date() var last = 1000 - (now.getTime() % 1000) - sleep(last) + await sleep(last) clockint = setInterval(clockStart, 1000) } function clockStart() { @@ -286,10 +286,6 @@ function clockStart() { '' $('#tips-text').html(msg) } -function sleep(waitMsec) { - var startMsec = new Date() - while (new Date() - startMsec < waitMsec); -} function tipsToggle() { $('#tips').toggleClass('hide') $('#tips-menu').toggleClass('hide')