Update branch selection logic in BranchView component

- Enhanced the onBranchSelected method to reload branches for updated weather information and reset the selected branch after reloading.
- Improved user experience by ensuring the correct branch is selected post-refresh, maintaining data accuracy and consistency.
This commit is contained in:
Torsten Schulz (local)
2025-12-08 11:34:50 +01:00
parent 274c2a3292
commit 814f972287

View File

@@ -448,6 +448,12 @@ export default {
async onBranchSelected(newBranch) { async onBranchSelected(newBranch) {
this.selectedBranch = newBranch; this.selectedBranch = newBranch;
// Branches neu laden, um das Wetter zu aktualisieren
await this.loadBranches();
// Den ausgewählten Branch nach dem Neuladen wieder setzen
if (newBranch) {
this.selectedBranch = this.branches.find(b => b.id === newBranch.id) || newBranch;
}
await this.loadProducts(); await this.loadProducts();
await this.loadVehicles(); await this.loadVehicles();
await this.loadProductPricesForCurrentBranch(); await this.loadProductPricesForCurrentBranch();