Skip to content

Commit 55a85ae

Browse files
committed
refactor(FileSystem): rename operations
Signed-off-by: Pedro Lamas <[email protected]>
1 parent a2db732 commit 55a85ae

File tree

1 file changed

+7
-27
lines changed

1 file changed

+7
-27
lines changed

src/store/files/actions.ts

+7-27
Original file line numberDiff line numberDiff line change
@@ -125,40 +125,20 @@ export const actions: ActionTree<FilesState, RootState> = {
125125
}
126126
},
127127

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
132130

133-
if (source_item) {
134-
const sourcePaths = getFilePaths(source_item.path, source_item.root)
131+
dispatch('notifyCreateFile', { item })
135132

136-
if (!sourcePaths.filtered) {
137-
commit('setFileDelete', sourcePaths)
138-
}
139-
}
133+
dispatch('notifyDeleteFile', { item: source_item })
140134
},
141135

142-
async notifyMoveDir ({ commit }, payload: FileChange) {
136+
async notifyMoveDir ({ dispatch }, payload: FileChange) {
143137
const { item, source_item } = payload
144138

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 })
155140

156-
if (!sourcePaths.filtered) {
157-
commit('setDirDelete', sourcePaths)
158-
159-
commit('setPathDelete', sourcePaths.rootPathFilename)
160-
}
161-
}
141+
dispatch('notifyDeleteDir', { item: source_item })
162142
},
163143

164144
async notifyDeleteFile ({ commit }, payload: FileChange) {

0 commit comments

Comments
 (0)