Skip to content

Commit

Permalink
fix: favicon reactivity in settings modal
Browse files Browse the repository at this point in the history
  • Loading branch information
RitvikSardana committed Sep 6, 2024
1 parent ba1f420 commit 04d3151
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions desk/src/components/Settings/Branding.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<p class="text-sm text-gray-600">{{ config.title }}</p>
<div class="flex gap-4 items-center">
<Avatar
v-if="config.image && !websiteSettings.loading"
v-if="config.image && !config.loading"
size="3xl"
:image="config.image"
/>
Expand Down Expand Up @@ -51,9 +51,22 @@ import { createToast } from "@/utils";
const config = useConfigStore();
const websiteSettings = createResource({
url: "frappe.client.get_value",
cache: true,
params: {
doctype: "Website Settings",
fieldname: "favicon",
},
onSuccess(data) {
state.brandFavicon = data.favicon;
},
auto: true,
});
const state = reactive({
brandLogo: config.brandLogo,
brandFavicon: "",
brandFavicon: websiteSettings.data?.favicon || "",
});
const loadingState = reactive({
Expand All @@ -78,19 +91,6 @@ const brandingConfig = computed(() => [
},
]);
const websiteSettings = createResource({
url: "frappe.client.get_value",
cache: true,
params: {
doctype: "Website Settings",
fieldname: "favicon",
},
onSuccess(data) {
state.brandFavicon = data.favicon;
},
auto: true,
});
const settingsResource = createResource({
url: "frappe.client.set_value",
debounce: 1000,
Expand Down

0 comments on commit 04d3151

Please sign in to comment.