From 964660940eb5a5b0af2600426b1938f7e0a9ac76 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Sat, 15 Mar 2025 14:21:55 +0530 Subject: [PATCH] fix: moved FCRM Settings call out of composable to avoid calling everytime --- frontend/src/stores/settings.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/frontend/src/stores/settings.js b/frontend/src/stores/settings.js index 99439587..8a6bcd03 100644 --- a/frontend/src/stores/settings.js +++ b/frontend/src/stores/settings.js @@ -4,17 +4,17 @@ import { reactive, ref } from 'vue' const settings = ref({}) const brand = reactive({}) -export function getSettings() { - const _settings = createDocumentResource({ - doctype: 'FCRM Settings', - name: 'FCRM Settings', - onSuccess: (data) => { - settings.value = data - setupBrand() - return data - }, - }) +const _settings = createDocumentResource({ + doctype: 'FCRM Settings', + name: 'FCRM Settings', + onSuccess: (data) => { + settings.value = data + getSettings().setupBrand() + return data + }, +}) +export function getSettings() { function setupBrand() { brand.name = settings.value?.brand_name brand.logo = settings.value?.brand_logo