Skip to content

Commit

Permalink
ui: disable delver import button without collection
Browse files Browse the repository at this point in the history
  • Loading branch information
shagu committed Jan 19, 2024
1 parent 3eba332 commit 0c9af8e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/renderer/ui/ui-window-menu-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default class UIWindowMenuMain extends HTMLElement {

static template = html`
<m-button id="metadata">Update Macaco Metadata</m-button>
<m-button id="delver">Import DelverLens Backup</m-button>
<m-button id="delver" disabled>Import DelverLens Backup</m-button>
`

static style = css`
Expand Down Expand Up @@ -52,6 +52,11 @@ export default class UIWindowMenuMain extends HTMLElement {
this.dom.delver.onclick = (e) => {
macaco.ipc.invoke('import-delver')
}

// disable delver import button while nothing is loaded
macaco.events.register('update-collection-contents', (ev, contents) => {
this.dom['delver'].disabled = false
})
}
}

Expand Down

0 comments on commit 0c9af8e

Please sign in to comment.