feat(core): Lazy-load nodes and credentials to reduce baseline memory usage (#4577)
This commit is contained in:
committed by
GitHub
parent
f63cd3b89e
commit
b6c57e19fc
@@ -154,7 +154,7 @@ export const useCredentialsStore = defineStore(STORES.CREDENTIALS, {
|
||||
return;
|
||||
}
|
||||
const rootStore = useRootStore();
|
||||
const credentialTypes = await getCredentialTypes(rootStore.getRestApiContext);
|
||||
const credentialTypes = await getCredentialTypes(rootStore.getBaseUrl);
|
||||
this.setCredentialTypes(credentialTypes);
|
||||
},
|
||||
async fetchAllCredentials(): Promise<ICredentialsResponse[]> {
|
||||
|
||||
@@ -26,6 +26,10 @@ export const useRootStore = defineStore(STORES.ROOT, {
|
||||
instanceId: '',
|
||||
}),
|
||||
getters: {
|
||||
getBaseUrl(): string {
|
||||
return this.baseUrl;
|
||||
},
|
||||
|
||||
getWebhookUrl(): string {
|
||||
return `${this.urlBaseWebhook}${this.endpointWebhook}`;
|
||||
},
|
||||
|
||||
@@ -120,7 +120,7 @@ export const useNodeTypesStore = defineStore(STORES.NODE_TYPES, {
|
||||
},
|
||||
async getNodeTypes(): Promise<void> {
|
||||
const rootStore = useRootStore();
|
||||
const nodeTypes = await getNodeTypes(rootStore.getRestApiContext);
|
||||
const nodeTypes = await getNodeTypes(rootStore.getBaseUrl);
|
||||
if (nodeTypes.length) {
|
||||
this.setNodeTypes(nodeTypes);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user