feat: add readNotes and clearAllData option

This commit is contained in:
Vlad Stan 2023-07-19 11:50:47 +03:00
parent bb2d68d7dc
commit ee3b161b47
6 changed files with 166 additions and 40 deletions

View file

@ -2,7 +2,7 @@ async function marketConfig(path) {
const template = await loadTemplateAsync(path)
Vue.component('market-config', {
name: 'market-config',
props: ['merchants', 'relays', 'config-ui'],
props: ['merchants', 'relays', 'config-ui', 'read-notes'],
template,
data: function () {
@ -85,17 +85,26 @@ async function marketConfig(path) {
console.log('### this.info', { name, about, ui })
this.$emit('ui-config-update', { name, about, ui })
},
publishNaddr(){
publishNaddr() {
this.$emit('publish-naddr')
},
clearAllData() {
this.$emit('clear-all-data')
},
markNoteAsRead(noteId) {
this.$emit('note-read', noteId)
}
},
created: async function () {
console.log('### this.configData', this.configData)
console.log('### this.configUi', this.configUi)
if (this.configUi) {
this.configData = { ...this.configData, ...this.configUi, ui: { ...this.configData.ui, ...(this.configUi.ui || {}) } }
this.configData = {
...this.configData,
...this.configUi,
ui: {
...this.configData.ui, ...(this.configUi.ui || {})
}
}
}
console.log('### this.configData', this.configData)
}
})