From d652d1e50d934bb476ab22be9636fbc9a1806c18 Mon Sep 17 00:00:00 2001 From: Piotr Machowski Date: Fri, 31 Mar 2023 01:26:34 +0200 Subject: [PATCH] Fix toast in editor --- src/editor.ts | 10 ++++++---- src/localize/languages/en.json | 3 +++ src/localize/languages/pl.json | 3 +++ src/xiaomi-vacuum-map-card.ts | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/editor.ts b/src/editor.ts index 37210849..d43cf48a 100644 --- a/src/editor.ts +++ b/src/editor.ts @@ -65,8 +65,10 @@ export class XiaomiVacuumMapCardEditor extends LitElement implements Omit
- + ${this._localize("editor.label.set_static_config")}
-
${this._localize("common.version")} ${CARD_VERSION} +
${this._localize("common.version")} ${CARD_VERSION}
${ToastRenderer.render("editor")}
`; diff --git a/src/localize/languages/en.json b/src/localize/languages/en.json index 59568b51..e4caf0f2 100644 --- a/src/localize/languages/en.json +++ b/src/localize/languages/en.json @@ -254,6 +254,9 @@ "config_set_failed": "Failed to update config.", "generate_rooms_config": "Generate rooms config", "copy_service_call": "Copy service call" + }, + "alerts": { + "set_static_config": "You should use this functionality only if you want to manually adjust automatically generated configuration.\nContinue?" } } } diff --git a/src/localize/languages/pl.json b/src/localize/languages/pl.json index 84d8f0ac..dfa2553d 100644 --- a/src/localize/languages/pl.json +++ b/src/localize/languages/pl.json @@ -254,6 +254,9 @@ "config_set_failed": "Błąd aktualizacji konfiguracji.", "generate_rooms_config": "Wygeneruj konfigurację pokoi", "copy_service_call": "Skopiuj wywołanie usługi" + }, + "alerts": { + "set_static_config": "Ten przycisk powinien zostać użyty tylko wtedy, jeśli chcesz ręcznie dostosować automatycznie wygenerowaną konfigurację.\nKontynuować?" } } } diff --git a/src/xiaomi-vacuum-map-card.ts b/src/xiaomi-vacuum-map-card.ts index b14b81f2..1ab43761 100644 --- a/src/xiaomi-vacuum-map-card.ts +++ b/src/xiaomi-vacuum-map-card.ts @@ -576,7 +576,7 @@ export class XiaomiVacuumMapCard extends LitElement { }) : new Promise(resolve => resolve(config.tiles ?? [])); tilesGenerated - .then(t => t.sort(sortTiles)) + .then(t => [...t].sort(sortTiles)) .then(tiles => this._setPreset({ ...config, tiles: tiles, icons: icons })) .then(() => setTimeout(() => this.requestUpdate(), 100)) .then(() => this._setCurrentMode(0, false));