|
|
@ -132,6 +132,8 @@
|
|
|
|
// adding event for open sidebar
|
|
|
|
// adding event for open sidebar
|
|
|
|
formStore.on('open', (id) => {
|
|
|
|
formStore.on('open', (id) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.reset()
|
|
|
|
|
|
|
|
|
|
|
|
// if id is send, load apps from pouchdb
|
|
|
|
// if id is send, load apps from pouchdb
|
|
|
|
if (id) {
|
|
|
|
if (id) {
|
|
|
|
Neutralino.extensions.dispatch('js.neutralino.pouchdb', 'pouchdb.apps.findOne', {
|
|
|
|
Neutralino.extensions.dispatch('js.neutralino.pouchdb', 'pouchdb.apps.findOne', {
|
|
|
@ -166,6 +168,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
appsStore.trigger('updated')
|
|
|
|
appsStore.trigger('updated')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.state.current._id = event.detail._id
|
|
|
|
|
|
|
|
this.state.current._rev = event.detail._rev
|
|
|
|
|
|
|
|
|
|
|
|
// stop loading
|
|
|
|
// stop loading
|
|
|
|
this.state.loading = false
|
|
|
|
this.state.loading = false
|
|
|
|
this.update()
|
|
|
|
this.update()
|
|
|
@ -174,9 +179,12 @@
|
|
|
|
// receive from extensions database
|
|
|
|
// receive from extensions database
|
|
|
|
Neutralino.events.on('pouchdb.apps.readyOne', (event) => {
|
|
|
|
Neutralino.events.on('pouchdb.apps.readyOne', (event) => {
|
|
|
|
|
|
|
|
|
|
|
|
this.reset()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.state.current = event.detail
|
|
|
|
this.state.current = event.detail
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!this.state.current.tags) {
|
|
|
|
|
|
|
|
this.state.current.tags = []
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
tagsStore.trigger('update', this.state.current.tags)
|
|
|
|
tagsStore.trigger('update', this.state.current.tags)
|
|
|
|
|
|
|
|
|
|
|
|
// stop loading
|
|
|
|
// stop loading
|
|
|
@ -232,10 +240,10 @@
|
|
|
|
data.thumbnail = this.state.current.thumbnail
|
|
|
|
data.thumbnail = this.state.current.thumbnail
|
|
|
|
|
|
|
|
|
|
|
|
// send to extensions database
|
|
|
|
// send to extensions database
|
|
|
|
if (data._id) {
|
|
|
|
if (data._id && data._rev) {
|
|
|
|
Neutralino.extensions.dispatch('js.neutralino.pouchdb', 'pouchdb.apps.create', data)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
Neutralino.extensions.dispatch('js.neutralino.pouchdb', 'pouchdb.apps.update', data)
|
|
|
|
Neutralino.extensions.dispatch('js.neutralino.pouchdb', 'pouchdb.apps.update', data)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
Neutralino.extensions.dispatch('js.neutralino.pouchdb', 'pouchdb.apps.create', data)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
@ -279,6 +287,8 @@
|
|
|
|
this.state.current = {
|
|
|
|
this.state.current = {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tagsStore.trigger('update', [])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|