Skip to content

Commit

Permalink
preferences usage and code cleanup (#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
xavluiz authored May 17, 2024
1 parent 9cf6dd5 commit 6285403
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 47 deletions.
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "swdc-vscode",
"displayName": "Code Time",
"version": "2.7.11",
"version": "2.7.12",
"publisher": "softwaredotcom",
"description": "Code Time is an open source plugin that provides programming metrics right in Visual Studio Code.",
"author": {
Expand Down Expand Up @@ -76,10 +76,6 @@
"command": "codetime.registerAccount",
"title": "Code Time: Sign up"
},
{
"command": "codetime.disconnectSlackWorkspace",
"title": "Code Time: Disconnect Slack workspace"
},
{
"command": "codetime.connectSlack",
"title": "Code Time: Connect Slack workspace"
Expand Down
9 changes: 1 addition & 8 deletions src/DataController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,7 @@ export function isRegistered() {
export async function getUserPreferences() {
currentUser = await getCachedUser()
if (currentUser) {
let prefs = currentUser.preferences;
if (prefs && typeof prefs === 'string') {
try {
return JSON.parse(prefs);
} catch (e: any) {
logIt(`Error parsing preferences: ${e.message}`, true);
}
}
return currentUser.preferences_parsed;
}
return {}
}
Expand Down
6 changes: 0 additions & 6 deletions src/command-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,6 @@ export function createCommands(
})
);

cmds.push(
commands.registerCommand('codetime.disconnectSlackWorkspace', (auth_id: any) => {
launchWebUrl(`${app_url}/data_sources/integration_types/slack`);
})
);

cmds.push(
commands.registerCommand('codetime.enableFlowMode', () => {
enableFlow({automated: false});
Expand Down
19 changes: 0 additions & 19 deletions src/managers/ProgressManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,6 @@ export class ProgressManager {

return ProgressManager.instance;
}

reportProgress(progress: any, increment: number): void {
if (this.doneWriting) {
return;
}

if (increment < 80) {
increment += 10;
} else if (increment < 90) {
increment += 1;
}

increment = Math.min(90, increment);

setTimeout(() => {
progress.report({increment});
this.reportProgress(progress, increment);
}, 450);
}
}

export function progressIt(msg: string, asyncFunc: any, args: any[] = []) {
Expand Down
9 changes: 0 additions & 9 deletions src/managers/SyncManger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@ import { commands } from 'vscode';

const fs = require('fs');

const thirty_seconds: number = 1000 * 30;

export function passedThreshold(now_in_millis: number, synced_val: number) {
if (!synced_val || now_in_millis - synced_val > thirty_seconds) {
return true;
}
return false;
}

export class SyncManager {
private static _instance: SyncManager;

Expand Down
Binary file removed swdc-vscode-2.7.11.vsix
Binary file not shown.
Binary file added swdc-vscode-2.7.12.vsix
Binary file not shown.

0 comments on commit 6285403

Please sign in to comment.