mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-29 20:26:39 +00:00
Activate edit mode after taking control (#2486)
* Activate edit mode after taking control * Move to take-control
This commit is contained in:
parent
427f0f5e66
commit
1b2e052f05
@ -112,6 +112,7 @@ export class HuiSaveConfig extends hassLocalizeLitMixin(LitElement) {
|
||||
try {
|
||||
const lovelace = this._params!.lovelace;
|
||||
await lovelace.saveConfig(lovelace.config);
|
||||
lovelace.setEditMode(true);
|
||||
this._saving = false;
|
||||
this._closeDialog();
|
||||
} catch (err) {
|
||||
|
@ -184,13 +184,19 @@ class LovelacePanel extends hassLocalizeLitMixin(LitElement) {
|
||||
const { config, mode } = this.lovelace!;
|
||||
try {
|
||||
// Optimistic update
|
||||
this._updateLovelace({ config: newConfig, mode: "storage" });
|
||||
this._updateLovelace({
|
||||
config: newConfig,
|
||||
mode: "storage",
|
||||
});
|
||||
await saveConfig(this.hass!, newConfig);
|
||||
} catch (err) {
|
||||
// tslint:disable-next-line
|
||||
console.error(err);
|
||||
// Rollback the optimistic update
|
||||
this._updateLovelace({ config, mode });
|
||||
this._updateLovelace({
|
||||
config,
|
||||
mode,
|
||||
});
|
||||
throw err;
|
||||
}
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user