Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Commit

Permalink
Store original URL to allow modifying it
Browse files Browse the repository at this point in the history
  • Loading branch information
valpackett committed Jul 8, 2018
1 parent a835328 commit 1c35f4b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/micro-panel-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export default class MicroPanelEditor extends LitElement {
if (this.entry.properties.url.length < 1) {
this.entry.properties.url.push(url)
}
this.originalUrl = this.entry.properties.url[0] // Store to allow changing the URL
this.entryIsNew = false
this.entryIsModified = false
this.show()
Expand All @@ -140,6 +141,7 @@ export default class MicroPanelEditor extends LitElement {
type: ['h-entry'],
properties,
}
this.originalUrl = undefined
this.entryIsNew = true
this.entryIsModified = false
this.show()
Expand All @@ -161,7 +163,7 @@ export default class MicroPanelEditor extends LitElement {
}

updateEntry () {
const url = ((this.entry.properties || {}).url || [null])[0]
const url = this.originalUrl || ((this.entry.properties || {}).url || [null])[0]
if (!url) {
return alert('Somehow, an entry with no URL! I have no idea how to save that.')
}
Expand Down

0 comments on commit 1c35f4b

Please sign in to comment.