diff --git a/packages/web-app-files/src/helpers/resource/actions/transfer.ts b/packages/web-app-files/src/helpers/resource/actions/transfer.ts index edc3ecb0d2c..82e3d5da69a 100644 --- a/packages/web-app-files/src/helpers/resource/actions/transfer.ts +++ b/packages/web-app-files/src/helpers/resource/actions/transfer.ts @@ -1,7 +1,7 @@ import { Resource } from 'web-client' import { join } from 'path' import { SpaceResource } from 'web-client/src/helpers' -import { ClientService, LoadingService, LoadingTaskState } from 'web-pkg/src/services' +import { ClientService, LoadingService, LoadingTaskCallbackArguments } from 'web-pkg/src/services' import { ConflictDialog, ResolveStrategy, @@ -120,12 +120,9 @@ export class ResourceTransfer extends ConflictDialog { return this.loadingService.addTask( ({ setProgress }) => { - return this.moveResources( - resolvedConflicts, - targetFolderResources, - transferType, + return this.moveResources(resolvedConflicts, targetFolderResources, transferType, { setProgress - ) + }) }, { indeterminate: false } ) @@ -135,7 +132,7 @@ export class ResourceTransfer extends ConflictDialog { resolvedConflicts: FileConflict[], targetFolderResources: Resource[], transferType: TransferType, - setProgress: (args: LoadingTaskState) => void + { setProgress }: LoadingTaskCallbackArguments ) { const movedResources: Resource[] = [] const errors = [] diff --git a/packages/web-app-files/src/mixins/actions/restore.ts b/packages/web-app-files/src/mixins/actions/restore.ts index 8ad35cc862b..4734f2b8df1 100644 --- a/packages/web-app-files/src/mixins/actions/restore.ts +++ b/packages/web-app-files/src/mixins/actions/restore.ts @@ -2,7 +2,7 @@ import { mapActions, mapGetters, mapMutations, mapState } from 'vuex' import { dirname } from 'path' import { isLocationTrashActive } from '../../router' -import { clientService, LoadingTaskState } from 'web-pkg/src/services' +import { clientService, LoadingTaskCallbackArguments } from 'web-pkg/src/services' import { Resource, isProjectSpaceResource, extractExtensionFromFile } from 'web-client/src/helpers' import { ResolveStrategy, @@ -168,7 +168,7 @@ export default { async $_restore_restoreResources( resources: Resource[], missingFolderPaths: string[], - setProgress: (args: LoadingTaskState) => void + { setProgress }: LoadingTaskCallbackArguments ) { const restoredResources = [] const failedResources = [] @@ -283,7 +283,9 @@ export default { } return this.$loadingService.addTask( ({ setProgress }) => { - return this.$_restore_restoreResources(resolvedResources, missingFolderPaths, setProgress) + return this.$_restore_restoreResources(resolvedResources, missingFolderPaths, { + setProgress + }) }, { indeterminate: false } ) diff --git a/packages/web-app-files/src/mixins/deleteResources.ts b/packages/web-app-files/src/mixins/deleteResources.ts index 04eb65e518c..b5fc1053279 100644 --- a/packages/web-app-files/src/mixins/deleteResources.ts +++ b/packages/web-app-files/src/mixins/deleteResources.ts @@ -154,13 +154,13 @@ export default { $_deleteResources_filesList_delete() { return this.$loadingService.addTask( - ({ setProgress }) => { + (loadingCallbackArgs) => { return this.deleteFiles({ ...this.$language, space: this.space, files: this.$_deleteResources_resources, clientService: this.$clientService, - setProgress + loadingCallbackArgs }).then(async () => { this.hideModal() this.toggleModalConfirmButton() diff --git a/packages/web-app-files/src/store/actions.ts b/packages/web-app-files/src/store/actions.ts index 75787c49eb1..521b9dcf9ec 100644 --- a/packages/web-app-files/src/store/actions.ts +++ b/packages/web-app-files/src/store/actions.ts @@ -17,7 +17,7 @@ import { SpaceResource } from 'web-client/src/helpers' import { WebDAV } from 'web-client/src/webdav' -import { ClientService, LoadingTaskState } from 'web-pkg/src/services' +import { ClientService, LoadingTaskCallbackArguments } from 'web-pkg/src/services' import { Language } from 'vue3-gettext' import { DavProperty } from 'web-client/src/webdav/constants' import { AncestorMetaData } from 'web-app-files/src/helpers/resource/ancestorMetaData' @@ -160,7 +160,7 @@ export default { space: SpaceResource files: Resource[] clientService: ClientService - setProgress: (args: LoadingTaskState) => void + loadingCallbackArgs: LoadingTaskCallbackArguments firstRun: boolean } & Language ) { @@ -170,9 +170,10 @@ export default { space, files, clientService, - setProgress, + loadingCallbackArgs, firstRun = true } = options + const { setProgress } = loadingCallbackArgs const promises = [] const removedFiles = [] for (const file of files) { diff --git a/packages/web-app-files/tests/unit/mixins/actions/emptyTrashBin.spec.ts b/packages/web-app-files/tests/unit/mixins/actions/emptyTrashBin.spec.ts index 3019270cce8..6762352f990 100644 --- a/packages/web-app-files/tests/unit/mixins/actions/emptyTrashBin.spec.ts +++ b/packages/web-app-files/tests/unit/mixins/actions/emptyTrashBin.spec.ts @@ -3,7 +3,7 @@ import { createLocationTrash, createLocationSpaces } from '../../../../src/route import { mock, mockDeep } from 'jest-mock-extended' import { OwnCloudSdk } from 'web-client/src/types' import { createStore, defaultPlugins, mount, defaultStoreMockOptions } from 'web-test-helpers' -import { LoadingService } from 'web-pkg' +import { LoadingService, LoadingTaskCallbackArguments } from 'web-pkg' const Component = { template: '
', @@ -87,7 +87,7 @@ function getWrapper({ space: { driveType, isEditor: () => false, isManager: () => false }, $loadingService: mock