Skip to content
Merged

Dev #40

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## version 1.1.3
- 修复每日一题隔天刷新问题

## version 1.1.2
- 去除多余客户端代码

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
38 changes: 19 additions & 19 deletions src/commands/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,25 @@ export async function getSessionList(): Promise<ISession[]> {
}

export async function manageSessions(): Promise<void> {
const choice: IQuickItemEx<ISession | string> | 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<ISession | string> | 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<Array<IQuickItemEx<ISession | string>>> {
Expand Down
4 changes: 3 additions & 1 deletion src/explorer/explorerNodeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
});
Expand Down Expand Up @@ -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],
Expand Down
2 changes: 1 addition & 1 deletion src/statusbar/LeetCodeStatusBarItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
}
Expand Down