From af3efc030f44f602e3c5f4f3eab577fa2ea52458 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Thu, 23 Oct 2025 16:02:19 +0000 Subject: [PATCH] Bug 39320: (QA follow-up): Fix widget with settings This was broken from the rewrite into bug 38201. Fixed here. Without this patch, if you click 'settings' on the licenses widgets and pick different values, you get errors on the console and everything breaks --- .../intranet-tmpl/prog/js/vue/composables/base-widget.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/composables/base-widget.js b/koha-tmpl/intranet-tmpl/prog/js/vue/composables/base-widget.js index 7dd41d7398f..37db6dd8185 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/composables/base-widget.js +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/composables/base-widget.js @@ -39,7 +39,7 @@ export function useBaseWidget(widgetConfig, emit) { const savedSettings = localStorage.getItem( "widget-" + widgetConfig.id + "-settings" ); - return savedSettings || null; + return JSON.parse(savedSettings) || null; }; onBeforeMount(() => { @@ -65,6 +65,10 @@ export function useBaseWidget(widgetConfig, emit) { onMounted(() => { if (widgetConfig.display === "dashboard") { callback?.(); + const savedSettings = getWidgetSavedSettings(); + if (savedSettings) { + settings.value = savedSettings; + } } }); } -- 2.39.5