From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 0BD221FF146 for ; Tue, 28 Apr 2026 13:05:25 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D08DBEEB4; Tue, 28 Apr 2026 13:05:24 +0200 (CEST) From: Dominik Csapak To: pbs-devel@lists.proxmox.com Subject: [PATCH proxmox-backup] ui: datastore content: fix namespace change after reload Date: Tue, 28 Apr 2026 13:05:15 +0200 Message-ID: <20260428110520.2343917-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.051 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: JUXUEMJ4A2G425NTWSQNXKPRGLXFASNL X-Message-ID-Hash: JUXUEMJ4A2G425NTWSQNXKPRGLXFASNL X-MailFrom: d.csapak@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: A double click on a namespace change it by first setting the namespace value to the namespace selector and then triggering a reload. When a new namespace is added to the view with a manual click on 'reload', this new namespace does not yet exist in the namespace selectors store. So a double click can't properly set this as a value, and thus does not change the namespace. To fix this, always reload the namespace selector at the beginning of a reload, so they should be in sync. To keep the callback we use for the namespace selector, move it to the reload function and pass it through to the load there. Signed-off-by: Dominik Csapak --- www/datastore/Content.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/www/datastore/Content.js b/www/datastore/Content.js index b1e1f66cb..293f9ca26 100644 --- a/www/datastore/Content.js +++ b/www/datastore/Content.js @@ -102,8 +102,11 @@ Ext.define('PBS.DataStoreContent', { this.reload(); }, - reload: function () { + reload: function (nsLoadCallback) { let view = this.getView(); + view.down('pbsNamespaceSelector').store?.load({ + callback: Ext.isFunction(nsLoadCallback) ? nsLoadCallback : undefined, + }); if (!view.store || !this.store) { console.warn('cannot reload, no store(s)'); @@ -560,7 +563,6 @@ Ext.define('PBS.DataStoreContent', { namespace: view.namespace ?? '', apiCallDone: (success) => { if (success) { - view.down('pbsNamespaceSelector').store?.load(); me.reload(); } }, @@ -685,11 +687,8 @@ Ext.define('PBS.DataStoreContent', { // selector's tree store does not know about the just-created target // namespace yet. view.namespace = newNs; - me.reload(); let selector = view.down('pbsNamespaceSelector'); - selector?.store?.load({ - callback: () => selector.setValue(newNs), - }); + me.reload(() => selector.setValue(newNs)); } }, }); -- 2.47.3