mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-30 12:46:35 +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 {
|
try {
|
||||||
const lovelace = this._params!.lovelace;
|
const lovelace = this._params!.lovelace;
|
||||||
await lovelace.saveConfig(lovelace.config);
|
await lovelace.saveConfig(lovelace.config);
|
||||||
|
lovelace.setEditMode(true);
|
||||||
this._saving = false;
|
this._saving = false;
|
||||||
this._closeDialog();
|
this._closeDialog();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -184,13 +184,19 @@ class LovelacePanel extends hassLocalizeLitMixin(LitElement) {
|
|||||||
const { config, mode } = this.lovelace!;
|
const { config, mode } = this.lovelace!;
|
||||||
try {
|
try {
|
||||||
// Optimistic update
|
// Optimistic update
|
||||||
this._updateLovelace({ config: newConfig, mode: "storage" });
|
this._updateLovelace({
|
||||||
|
config: newConfig,
|
||||||
|
mode: "storage",
|
||||||
|
});
|
||||||
await saveConfig(this.hass!, newConfig);
|
await saveConfig(this.hass!, newConfig);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// tslint:disable-next-line
|
// tslint:disable-next-line
|
||||||
console.error(err);
|
console.error(err);
|
||||||
// Rollback the optimistic update
|
// Rollback the optimistic update
|
||||||
this._updateLovelace({ config, mode });
|
this._updateLovelace({
|
||||||
|
config,
|
||||||
|
mode,
|
||||||
|
});
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user