@@ -19,7 +19,7 @@ export function commandFactory(statusBarItems: MobStatusBarItem[]) {
1919 } ) ,
2020 vscode . commands . registerCommand ( "mob-vscode-gui.start" , async ( ) => {
2121 const timeInput = await vscode . window . showInputBox ( {
22- title : "How much time ?" ,
22+ title : "How many minutes ?" ,
2323 placeHolder : "Enter to ignore" ,
2424 validateInput : ( input ) => timerInputValidator ( input ) ,
2525 } ) ;
@@ -49,10 +49,14 @@ export function commandFactory(statusBarItems: MobStatusBarItem[]) {
4949
5050 if ( timer > 0 ) {
5151 const timerCountdown = new TimerCountdown ( ) ;
52- timerCountdown . startTimer ( Number ( timeInput ) ) ;
52+ timerCountdown . startTimer ( timer ) ;
5353 }
5454 } finally {
5555 startItem ?. stopLoading ( ) ;
56+
57+ if ( timer > 0 ) {
58+ startItem ?. startCountDown ( timer )
59+ }
5660 }
5761 } ) ,
5862 vscode . commands . registerCommand ( "mob-vscode-gui.next" , async ( ) => {
@@ -66,6 +70,9 @@ export function commandFactory(statusBarItems: MobStatusBarItem[]) {
6670 await asyncExec ( command , expectedMessage ) ;
6771 } finally {
6872 nextItem ?. stopLoading ( ) ;
73+
74+ const startItem = statusBarItems . find ( ( item ) => item . id === "start" ) ;
75+ startItem ?. stopLoading ( ) ;
6976 }
7077 } ) ,
7178 vscode . commands . registerCommand ( "mob-vscode-gui.done" , async ( ) => {
@@ -79,48 +86,14 @@ export function commandFactory(statusBarItems: MobStatusBarItem[]) {
7986 await asyncExec ( command , expectedMessage ) ;
8087 } finally {
8188 utilsItem ?. stopLoading ( ) ;
82- }
83- } ) ,
84- vscode . commands . registerCommand ( "mob-vscode-gui.reset" , ( ) => {
85- const validInputs = {
86- yes : [ "y" , "yes" ] ,
87- no : [ "n" , "no" ] ,
88- } ;
89-
90- const input = vscode . window . showInputBox ( {
91- title :
92- "Are you sure? This will delete your commits in the WIP branch (but preserves uncommitted work)" ,
93- placeHolder : "yes(y) / no(n)" ,
94- validateInput : ( input ) => {
95- if (
96- ! validInputs . yes . includes ( input . toLowerCase ( ) ) &&
97- ! validInputs . no . includes ( input . toLowerCase ( ) )
98- ) {
99- return "Please enter yes(y) or no(n)" ;
100- }
101-
102- return null ;
103- } ,
104- } ) ;
10589
106- input . then ( async ( input ) => {
107- if ( input && validInputs . yes . includes ( input ) ) {
108- const command = "mob reset" ;
109- const expectedMessage = [ "Branches" , "deleted" ] ;
110-
111- const utilsItem = statusBarItems . find ( ( item ) => item . id === "utils" ) ;
112- utilsItem ?. startLoading ( "Reseting session..." ) ;
113- try {
114- await asyncExec ( command , expectedMessage ) ;
115- } finally {
116- utilsItem ?. stopLoading ( ) ;
117- }
118- }
119- } ) ;
90+ const startItem = statusBarItems . find ( ( item ) => item . id === "start" ) ;
91+ startItem ?. stopLoading ( ) ;
92+ }
12093 } ) ,
12194 vscode . commands . registerCommand ( "mob-vscode-gui.timer" , ( ) => {
12295 const timeInput = vscode . window . showInputBox ( {
123- title : "How much time ?" ,
96+ title : "How many minutes ?" ,
12497 placeHolder : "Enter to ignore" ,
12598 validateInput : ( input ) => timerInputValidator ( input ) ,
12699 } ) ;
@@ -131,6 +104,9 @@ export function commandFactory(statusBarItems: MobStatusBarItem[]) {
131104
132105 if ( timer > 0 ) {
133106 command += ` ${ timer } ` ;
107+
108+ const startItem = statusBarItems . find ( ( item ) => item . id === "start" ) ;
109+ startItem ?. startCountDown ( timer ) ;
134110 }
135111
136112 const expectedMessage = [ "Happy collaborating!" ] ;
@@ -148,11 +124,6 @@ export function commandFactory(statusBarItems: MobStatusBarItem[]) {
148124 description : "Commit mob session" ,
149125 command : "mob-vscode-gui.done" ,
150126 } ,
151- // {
152- // label: "Reset",
153- // description: "Delete local and remote WIP branch",
154- // command: "mob-vscode-gui.reset",
155- // },
156127 {
157128 label : "Timer" ,
158129 description : "Set timer (in minutes)" ,
0 commit comments