From 493f7a1c92d77d3c75fc311892e53f43e1fb367f Mon Sep 17 00:00:00 2001
From: Alex Grozav <alex@grozav.com>
Date: Thu, 9 Mar 2023 14:23:38 +0200
Subject: [PATCH] fix: Fetch credentials on workflows view to include in
 duplicated workflows (#5532)

fix: fetch credentials on workflows view to include in duplicated workflows
---
 packages/editor-ui/src/views/WorkflowsView.vue | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/packages/editor-ui/src/views/WorkflowsView.vue b/packages/editor-ui/src/views/WorkflowsView.vue
index 4dd61ca1be..4fa1073315 100644
--- a/packages/editor-ui/src/views/WorkflowsView.vue
+++ b/packages/editor-ui/src/views/WorkflowsView.vue
@@ -137,6 +137,7 @@ import { useUIStore } from '@/stores/ui';
 import { useSettingsStore } from '@/stores/settings';
 import { useUsersStore } from '@/stores/users';
 import { useWorkflowsStore } from '@/stores/workflows';
+import { useCredentialsStore } from '@/stores/credentials';
 import { usePostHog } from '@/stores/posthog';
 
 type IResourcesListLayoutInstance = Vue & { sendFiltersTelemetry: (source: string) => void };
@@ -170,7 +171,13 @@ const WorkflowsView = mixins(showMessage, debounceHelper).extend({
 		};
 	},
 	computed: {
-		...mapStores(useSettingsStore, useUIStore, useUsersStore, useWorkflowsStore),
+		...mapStores(
+			useSettingsStore,
+			useUIStore,
+			useUsersStore,
+			useWorkflowsStore,
+			useCredentialsStore,
+		),
 		currentUser(): IUser {
 			return this.usersStore.currentUser || ({} as IUser);
 		},
@@ -229,6 +236,8 @@ const WorkflowsView = mixins(showMessage, debounceHelper).extend({
 				this.workflowsStore.fetchActiveWorkflows(),
 			]);
 
+			this.credentialsStore.fetchAllCredentials();
+
 			// If the user has no workflows and is not participating in the demo experiment,
 			// redirect to the new workflow view
 			if (!this.isDemoTest && this.allWorkflows.length === 0) {