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:
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user