File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -150,13 +150,22 @@ export const actions = {
150150 }
151151 } ,
152152
153- async notifyDeleteDir ( { commit } , payload : Moonraker . Files . ChangeResponse ) {
153+ async notifyDeleteDir ( { commit, getters } , payload : Moonraker . Files . ChangeResponse ) {
154154 const paths = getFilePaths ( payload . item . path , payload . item . root )
155155
156156 if ( ! paths . filtered ) {
157157 commit ( 'setDirDelete' , paths )
158158
159159 commit ( 'setPathDelete' , paths . rootPathFilename )
160+
161+ const currentPath : string = getters . getCurrentPathByRoot ( paths . root )
162+
163+ if (
164+ currentPath === paths . rootPathFilename ||
165+ currentPath . startsWith ( `${ paths . rootPathFilename } /` )
166+ ) {
167+ commit ( 'setCurrentPath' , { root : paths . root , path : paths . rootPath } )
168+ }
160169 }
161170 } ,
162171
@@ -179,7 +188,7 @@ export const actions = {
179188 commit ( 'setRemoveFileDownload' , payload )
180189 } ,
181190
182- async updateCurrentPathByRoot ( { commit } , payload ) {
191+ async updateCurrentPathByRoot ( { commit } , payload : { root : string , path : string } ) {
183192 commit ( 'setCurrentPath' , payload )
184193 }
185194} satisfies ActionTree < FilesState , RootState >
Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ export const mutations = {
167167 }
168168 } ,
169169
170- setCurrentPath ( state , payload ) {
170+ setCurrentPath ( state , payload : { root : string , path : string } ) {
171171 Vue . set ( state . currentPaths , payload . root , payload . path )
172172 } ,
173173
You can’t perform that action at this time.
0 commit comments