Update url on tab reorder (#18169)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
Piero 2023-10-11 12:49:08 +02:00 committed by GitHub
parent 095d171a61
commit 479a625662
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -844,6 +844,9 @@ class HUIRoot extends LitElement {
const oldIndex = this._curView as number;
const newIndex = (this._curView as number) - 1;
this._curView = newIndex;
if (!this.config.views[oldIndex].path) {
this._navigateToView(newIndex, true);
}
lovelace.saveConfig(swapView(lovelace.config, oldIndex, newIndex));
}
@ -856,6 +859,9 @@ class HUIRoot extends LitElement {
const oldIndex = this._curView as number;
const newIndex = (this._curView as number) + 1;
this._curView = newIndex;
if (!this.config.views[oldIndex].path) {
this._navigateToView(newIndex, true);
}
lovelace.saveConfig(swapView(lovelace.config, oldIndex, newIndex));
}