Skip to content
Snippets Groups Projects
Commit 0eceb22f authored by Guillaume WEBER's avatar Guillaume WEBER Committed by Mohamed AZIKIOU
Browse files

fix: prevent reviewer from pushing code or updating time spent

parent c82a971c
No related branches found
No related tags found
1 merge request!36fix: prevent reviewer from pushing code or updating time spent
import { window, ExtensionContext, workspace, commands } from 'vscode';
import Controller from './core/controller';
import isDocker from './core/utils/isdocker';
import Recorder, { runTimer } from './recorder/recorder';
import Recorder from './recorder/recorder';
import { extensionError as error } from './recorder/utils/log';
import { DepNodeProvider } from './view/deadlockPanel';
import { CommandTreeProvider } from './view/CommandTree';
......@@ -20,10 +20,6 @@ export async function activate(context: ExtensionContext) {
if (isDocker()) {
commands.executeCommand('setContext', 'deadlock.inContainer', true);
window.registerTreeDataProvider('commandTree', new CommandTreeProvider(context));
} else {
commands.executeCommand('setContext', 'deadlock.inContainer', false);
}
if (isDocker()) {
try {
Recorder.instance.run();
} catch (e) {
......@@ -31,6 +27,7 @@ export async function activate(context: ExtensionContext) {
error(JSON.stringify(e));
window.showErrorMessage("Le recorder n'a pas pu être lancé");
}
runTimer();
} else {
commands.executeCommand('setContext', 'deadlock.inContainer', false);
}
}
......@@ -68,7 +68,8 @@ export default class Recorder {
await this.setupFromRemoteRepo(this._gitMission);
await this.setupProject(this._gitMission);
try {
if (ENABLE_AUTOMATIC_SAVE) new AutomaticSave(MISSION_PATH_IC, this._gitMission);
if (ENABLE_AUTOMATIC_SAVE && !this.userMission.isReviewing())
new AutomaticSave(MISSION_PATH_IC, this._gitMission);
} catch (e) {
error('Error while setup automatic save');
error(e);
......@@ -77,6 +78,9 @@ export default class Recorder {
error('Cannot setup user repo.');
error(e);
}
if (!this.userMission.isReviewing()) {
runTimer();
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment