From b0f91a83ee7d0a089a26dc22412cbc8a4f3d06de Mon Sep 17 00:00:00 2001 From: ccagml Date: Fri, 21 Oct 2022 16:20:41 +0800 Subject: [PATCH 1/4] update --- src/explorer/explorerNodeManager.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/explorer/explorerNodeManager.ts b/src/explorer/explorerNodeManager.ts index 68b4838..aa55548 100644 --- a/src/explorer/explorerNodeManager.ts +++ b/src/explorer/explorerNodeManager.ts @@ -71,6 +71,8 @@ class ExplorerNodeManager implements Disposable { if (element.type == SearchSetType.Day) { if (day_start <= element.time && element.time <= day_end) { need_get_today = false; + } else { + this.waitTodayQuestion = false } } }); From 3eb027dfa04d0aad0f4954620c849a0e98c1fedb Mon Sep 17 00:00:00 2001 From: ccagml Date: Fri, 21 Oct 2022 16:27:04 +0800 Subject: [PATCH 2/4] fix --- CHANGELOG.md | 3 +++ package.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ffd8ea..a47085a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## version 1.1.3 +- 修复每日一题隔天刷新问题 + ## version 1.1.2 - 去除多余客户端代码 diff --git a/package.json b/package.json index 3316188..855e0dc 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vscode-leetcode-problem-rating", "displayName": "LeetCode problem rating", "description": "为LeetCode题目难度进行打分。避免只有简单、中等、困难三种难度", - "version": "1.1.2", + "version": "1.1.3", "author": "ccagml", "publisher": "ccagml", "license": "MIT", From 6e02b3dda6f1e316b84589b85212b09d2192aee7 Mon Sep 17 00:00:00 2001 From: ccagml Date: Sat, 22 Oct 2022 10:38:39 +0800 Subject: [PATCH 3/4] update --- src/explorer/explorerNodeManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/explorer/explorerNodeManager.ts b/src/explorer/explorerNodeManager.ts index aa55548..0b5e0e1 100644 --- a/src/explorer/explorerNodeManager.ts +++ b/src/explorer/explorerNodeManager.ts @@ -145,7 +145,7 @@ class ExplorerNodeManager implements Disposable { ]; this.searchSet.forEach(element => { if (element.type == SearchSetType.Day) { - const curDate = new Date() + const curDate = new Date(element.time * 1000) baseNode.push(new LeetCodeNode(Object.assign({}, defaultProblem, { id: element.type, name: "[" + (curDate.getFullYear()) + "-" + (curDate.getMonth() + 1) + "-" + (curDate.getDate()) + "]" + SearchSetTypeName[SearchSetType.Day], From c7a8215c167550cf9d8be6a8755224ec9625271f Mon Sep 17 00:00:00 2001 From: ccagml Date: Sat, 22 Oct 2022 10:53:32 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=88=A0=E9=99=A4session?= =?UTF-8?q?=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/commands/session.ts | 38 +++++++++++++------------- src/statusbar/LeetCodeStatusBarItem.ts | 2 +- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/commands/session.ts b/src/commands/session.ts index f86d4cf..ae435af 100644 --- a/src/commands/session.ts +++ b/src/commands/session.ts @@ -33,25 +33,25 @@ export async function getSessionList(): Promise { } export async function manageSessions(): Promise { - const choice: IQuickItemEx | undefined = await vscode.window.showQuickPick(parseSessionsToPicks(true /* includeOperation */)); - if (!choice || choice.description === "Active") { - return; - } - if (choice.value === ":createSession") { - await createSession(); - return; - } - if (choice.value === ":deleteSession") { - await deleteSession(); - return; - } - try { - await leetCodeExecutor.enableSession((choice.value as ISession).id); - vscode.window.showInformationMessage(`Successfully switched to session '${choice.label}'.`); - await vscode.commands.executeCommand("leetcode.refreshExplorer"); - } catch (error) { - await promptForOpenOutputChannel("Failed to switch session. Please open the output channel for details.", DialogType.error); - } + // const choice: IQuickItemEx | undefined = await vscode.window.showQuickPick(parseSessionsToPicks(true /* includeOperation */)); + // if (!choice || choice.description === "Active") { + // return; + // } + // if (choice.value === ":createSession") { + // await createSession(); + // return; + // } + // if (choice.value === ":deleteSession") { + // await deleteSession(); + // return; + // } + // try { + // await leetCodeExecutor.enableSession((choice.value as ISession).id); + // vscode.window.showInformationMessage(`Successfully switched to session '${choice.label}'.`); + // await vscode.commands.executeCommand("leetcode.refreshExplorer"); + // } catch (error) { + // await promptForOpenOutputChannel("Failed to switch session. Please open the output channel for details.", DialogType.error); + // } } async function parseSessionsToPicks(includeOperations: boolean = false): Promise>> { diff --git a/src/statusbar/LeetCodeStatusBarItem.ts b/src/statusbar/LeetCodeStatusBarItem.ts index 3b9ef82..e863f1c 100644 --- a/src/statusbar/LeetCodeStatusBarItem.ts +++ b/src/statusbar/LeetCodeStatusBarItem.ts @@ -16,7 +16,7 @@ export class LeetCodeStatusBarItem implements vscode.Disposable { switch (status) { case UserStatus.SignedIn: if (UserContestInfo && UserContestInfo.attendedContestsCount > 0) { - this.statusBarItem.text = `用户: ${user}, 积分: ${UserContestInfo.rating}, 名次: ${UserContestInfo.localRanking} / ${UserContestInfo.localTotalParticipants} (${UserContestInfo.topPercentage}%), 全部名次: ${UserContestInfo.globalRanking} / ${UserContestInfo.globalTotalParticipants}`; + this.statusBarItem.text = `用户: ${user}, 积分: ${Math.floor(UserContestInfo.rating)}, 名次: ${UserContestInfo.localRanking} / ${UserContestInfo.localTotalParticipants} (${UserContestInfo.topPercentage}%), 全部名次: ${UserContestInfo.globalRanking} / ${UserContestInfo.globalTotalParticipants}`; } else { this.statusBarItem.text = `user: ${user}`; }