From 1f43c322603d18ffdeff24a71af0638aa4cb43fb Mon Sep 17 00:00:00 2001 From: Badri Narayanan S Date: Wed, 21 Jan 2026 21:06:39 +0530 Subject: [PATCH] fix: load maxAccounts from config on frontend init The data store's fetchVersion() was never called, so maxAccounts stayed at the default value of 10. Consolidated into the global store's fetchVersion() which is called on init. Co-Authored-By: Claude --- public/js/data-store.js | 18 ------------------ public/js/store.js | 4 ++++ 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/public/js/data-store.js b/public/js/data-store.js index b8a9349..4c7df16 100644 --- a/public/js/data-store.js +++ b/public/js/data-store.js @@ -136,24 +136,6 @@ document.addEventListener('alpine:init', () => { } }, - async fetchVersion(password) { - try { - const { response } = await window.utils.request('/api/config', {}, password); - if (response.ok) { - const data = await response.json(); - if (data.version) { - Alpine.store('global').version = data.version; - } - // Store maxAccounts from config - if (data.config && typeof data.config.maxAccounts === 'number') { - this.maxAccounts = data.config.maxAccounts; - } - } - } catch (error) { - console.warn('Failed to fetch version:', error); - } - }, - async performHealthCheck() { try { // Get password from global store diff --git a/public/js/store.js b/public/js/store.js index 5166bb4..1e6e050 100644 --- a/public/js/store.js +++ b/public/js/store.js @@ -43,6 +43,10 @@ document.addEventListener('alpine:init', () => { if (data.version) { this.version = data.version; } + // Update maxAccounts in data store + if (data.config && typeof data.config.maxAccounts === 'number') { + Alpine.store('data').maxAccounts = data.config.maxAccounts; + } } } catch (error) { console.debug('Could not fetch version:', error);