@@ -125,40 +125,20 @@ export const actions: ActionTree<FilesState, RootState> = {
125
125
}
126
126
} ,
127
127
128
- async notifyMoveFile ( { commit, dispatch } , payload : FileChange ) {
129
- const { source_item } = payload
130
-
131
- dispatch ( 'notifyCreateFile' , payload )
128
+ async notifyMoveFile ( { dispatch } , payload : FileChange ) {
129
+ const { item, source_item } = payload
132
130
133
- if ( source_item ) {
134
- const sourcePaths = getFilePaths ( source_item . path , source_item . root )
131
+ dispatch ( 'notifyCreateFile' , { item } )
135
132
136
- if ( ! sourcePaths . filtered ) {
137
- commit ( 'setFileDelete' , sourcePaths )
138
- }
139
- }
133
+ dispatch ( 'notifyDeleteFile' , { item : source_item } )
140
134
} ,
141
135
142
- async notifyMoveDir ( { commit } , payload : FileChange ) {
136
+ async notifyMoveDir ( { dispatch } , payload : FileChange ) {
143
137
const { item, source_item } = payload
144
138
145
- const paths = getFilePaths ( item . path , item . root )
146
-
147
- if ( ! paths . filtered ) {
148
- const dir = itemAsMoonrakerDir ( payload . item , paths )
149
-
150
- commit ( 'setDirUpdate' , { paths, dir } )
151
- }
152
-
153
- if ( source_item ) {
154
- const sourcePaths = getFilePaths ( source_item . path , source_item . root )
139
+ dispatch ( 'notifyCreateDir' , { item } )
155
140
156
- if ( ! sourcePaths . filtered ) {
157
- commit ( 'setDirDelete' , sourcePaths )
158
-
159
- commit ( 'setPathDelete' , sourcePaths . rootPathFilename )
160
- }
161
- }
141
+ dispatch ( 'notifyDeleteDir' , { item : source_item } )
162
142
} ,
163
143
164
144
async notifyDeleteFile ( { commit } , payload : FileChange ) {
0 commit comments