Skip to content

Commit 457d2da

Browse files
committed
💡update 1.2.9 修改数据唯一标识,使得用户数据缓存更新
1 parent e93a176 commit 457d2da

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

leetcodeRating_greasyfork.user.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==UserScript==
22
// @name LeetCodeRating|显示力扣周赛难度分
33
// @namespace https://github.com/zhang-wangz
4-
// @version 1.2.8
4+
// @version 1.2.9
55
// @license MIT
66
// @description LeetCodeRating 力扣周赛分数显现,目前支持tag页面,题库页面和题目页面
77
// @author 小东是个阳光蛋(力扣名
@@ -35,6 +35,7 @@
3535
// @note 2022-09-11 1.2.6 fix当 hover题目后面的反馈按钮的时候,会不断的添加周赛link的bug
3636
// @note 2022-09-11 1.2.7 更新具体问题页面, 题目侧边弹出页难度分显示
3737
// @note 2022-09-12 1.2.8 重构数据标识为题目id,因为lc不计算剑指offer,lcp这种题号,id作为标识更加准确些
38+
// @note 2022-09-12 1.2.9 修改数据唯一标识,使得用户数据缓存更新
3839
// ==/UserScript==
3940

4041
(function () {
@@ -229,7 +230,7 @@
229230
t2rate = JSON.parse(GM_getValue("t2ratedb", "{}").toString())
230231
preDate = GM_getValue("preDate", "")
231232
let now = getCurrentDate(1)
232-
if (t2rate["idx"] == undefined || (preDate == "" || preDate != now)) {
233+
if (t2rate["idx10"] == undefined || (preDate == "" || preDate != now)) {
233234
GM_xmlhttpRequest({
234235
method: "get",
235236
url: 'https://zerotrac.github.io/leetcode_problem_rating/data.json',
@@ -247,7 +248,7 @@
247248
t2rate[json[i].ID] = json[i]
248249
t2rate[json[i].ID]["Rating"] = Number.parseInt(Number.parseFloat(json[i]["Rating"])+0.5)
249250
}
250-
t2rate["idx"] = -1
251+
t2rate["idx10"] = -10
251252
console.log("everyday getdate once...")
252253

253254
preDate = now

0 commit comments

Comments
 (0)