From 45f39d65fea0c00ea3b01f0593422d97e791ff16 Mon Sep 17 00:00:00 2001
From: John Molakvoæ <skjnldsv@protonmail.com>
Date: Fri, 7 Apr 2023 09:30:13 +0200
Subject: fix(files): fix private variables and share loading marker between
 header and row
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
---
 apps/files/src/components/FileEntry.vue | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'apps/files/src/components/FileEntry.vue')

diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue
index 130cd12367e..fca83cabbd1 100644
--- a/apps/files/src/components/FileEntry.vue
+++ b/apps/files/src/components/FileEntry.vue
@@ -63,6 +63,7 @@
 			<!-- Menu actions -->
 			<NcActions v-if="active"
 				ref="actionsMenu"
+				:disabled="source._loading"
 				:force-title="true"
 				:inline="enabledInlineActions.length">
 				<NcActionButton v-for="action in enabledMenuActions"
@@ -433,7 +434,10 @@ export default Vue.extend({
 		async onActionClick(action) {
 			const displayName = action.displayName([this.source], this.currentView)
 			try {
+				// Set the loading marker
 				this.loading = action.id
+				Vue.set(this.source, '_loading', true)
+
 				const success = await action.exec(this.source, this.currentView)
 				if (success) {
 					showSuccess(this.t('files', '"{displayName}" action executed successfully', { displayName }))
@@ -444,7 +448,9 @@ export default Vue.extend({
 				logger.error('Error while executing action', { action, e })
 				showError(this.t('files', '"{displayName}" action failed', { displayName }))
 			} finally {
+				// Reset the loading marker
 				this.loading = ''
+				Vue.set(this.source, '_loading', false)
 			}
 		},
 
-- 
cgit v1.2.3

