mirror of
https://github.com/flynx/pWiki.git
synced 2025-10-28 09:30:07 +00:00
several fixes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
52ccc121c9
commit
6de491a3fe
@ -76,12 +76,12 @@ object.Constructor('JournalDB', {
|
||||
that.__db = req.result } }) },
|
||||
|
||||
// XXX
|
||||
get length(){
|
||||
get length(){ return async function(){
|
||||
return this.__promisify(
|
||||
(await this.db)
|
||||
.transaction('journal', 'readonly')
|
||||
.objectStore('journal')
|
||||
.count()) },
|
||||
.count()) }.call(this) },
|
||||
|
||||
slice: async function(from, to){
|
||||
return this.__promisify(
|
||||
@ -299,7 +299,7 @@ module.BaseStore = {
|
||||
var update = this.__names.options.update
|
||||
var index = {}
|
||||
for(var path of (await this.paths)){
|
||||
index = update.call(this, index, name, path) }
|
||||
index = update.call(this, index, 'names', path) }
|
||||
return index }, {
|
||||
update: async function(data, name, path){
|
||||
data = await data
|
||||
@ -372,7 +372,7 @@ module.BaseStore = {
|
||||
var index = {tags: {}, paths: {}}
|
||||
var update = this.__tags.options.update
|
||||
for(var path of (await this.paths)){
|
||||
index = update.call(this, index, name, path, await this.get(path)) }
|
||||
index = update.call(this, index, 'tags', path, await this.get(path)) }
|
||||
return index } }, {
|
||||
update: async function(data, name, path, update){
|
||||
/*/ XXX CACHE_INDEX...
|
||||
@ -457,7 +457,7 @@ module.BaseStore = {
|
||||
?? {})
|
||||
var update = this.__search.options.update
|
||||
for(var path of (await this.paths)){
|
||||
update.call(this, index, name, path, await this.get(path)) }
|
||||
update.call(this, index, 'search', path, await this.get(path)) }
|
||||
return index } }, {
|
||||
update: async function(data, name, path, update){
|
||||
/*/ XXX CACHE_INDEX...
|
||||
@ -593,7 +593,7 @@ module.BaseStore = {
|
||||
var path = this.__cache_path__ +'/'+ name+'_index'
|
||||
data = (await this.get(path) ?? {}).index ?? [] }
|
||||
return data },
|
||||
reset: function(){
|
||||
reset: function(data, name){
|
||||
this.__cache_path__
|
||||
&& this.delete(this.__cache_path__ +'/'+ name+'_index') }, }),
|
||||
journal: function(){
|
||||
|
||||
@ -18,7 +18,7 @@ var pouchdbstore = require('./pwiki/store/pouchdb')
|
||||
var filestore = require('./pwiki/store/file')
|
||||
|
||||
// XXX this fails silently in browser...
|
||||
var bootstrap = require('./bootstrap')
|
||||
//var bootstrap = require('./bootstrap')
|
||||
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user