From 33bb523352b280fbd632de7599ed7c1468a3e56a Mon Sep 17 00:00:00 2001 From: htmltiger <1429451+htmltiger@users.noreply.github.com> Date: Tue, 18 Jan 2022 12:21:10 +0000 Subject: [PATCH] fix new file ext --- config-editor-card.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config-editor-card.js b/config-editor-card.js index c6e5831..17449e6 100644 --- a/config-editor-card.js +++ b/config-editor-card.js @@ -1,4 +1,4 @@ -console.info("Config Editor 3.0"); +console.info("Config Editor 3.1"); const LitElement = window.LitElement || Object.getPrototypeOf(customElements.get("hui-masonry-view") ); const html = LitElement.prototype.html; @@ -145,9 +145,9 @@ async Save() { return; } if(!this.openedFile && this.code){ - this.openedFile=prompt("type abc.yaml or folder/abc.yaml"); + this.openedFile=prompt("type abc."+this.edit.ext+" or folder/abc."+this.edit.ext); } - if(this.openedFile && this.openedFile.endsWith(".yaml")){ + if(this.openedFile && this.openedFile.endsWith("."+this.edit.ext)){ if(!this.code){this.infoLine='';this.infoLine = 'Text is empty!'; return;} this.infoLine = 'Saving: '+this.openedFile; const e=(await this._hass.callWS({type: "config_editor/ws", action: 'save', data: this.code, file: this.openedFile, ext: this.edit.ext}));