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", 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/explorer/explorerNodeManager.ts b/src/explorer/explorerNodeManager.ts index 68b4838..0b5e0e1 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 } } }); @@ -143,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], 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}`; }