|
|
@ -42,7 +42,7 @@ export const login = createAction(
|
|
|
|
export const setCacheCollection = createAction(
|
|
|
|
export const setCacheCollection = createAction(
|
|
|
|
"SET_CACHE_COLLECTION",
|
|
|
|
"SET_CACHE_COLLECTION",
|
|
|
|
async (colMgr: Etebase.CollectionManager, col: Etebase.Collection) => {
|
|
|
|
async (colMgr: Etebase.CollectionManager, col: Etebase.Collection) => {
|
|
|
|
return await colMgr.cacheSave(col);
|
|
|
|
return colMgr.cacheSave(col);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
(_colMgr: Etebase.CollectionManager, col: Etebase.Collection) => {
|
|
|
|
(_colMgr: Etebase.CollectionManager, col: Etebase.Collection) => {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
@ -69,7 +69,7 @@ export const collectionUpload = createAction(
|
|
|
|
"COLLECTION_UPLOAD",
|
|
|
|
"COLLECTION_UPLOAD",
|
|
|
|
async (colMgr: Etebase.CollectionManager, col: Etebase.Collection) => {
|
|
|
|
async (colMgr: Etebase.CollectionManager, col: Etebase.Collection) => {
|
|
|
|
await colMgr.upload(col);
|
|
|
|
await colMgr.upload(col);
|
|
|
|
return await colMgr.cacheSave(col);
|
|
|
|
return colMgr.cacheSave(col);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
(_colMgr: Etebase.CollectionManager, col: Etebase.Collection) => {
|
|
|
|
(_colMgr: Etebase.CollectionManager, col: Etebase.Collection) => {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
@ -82,7 +82,7 @@ export const collectionUpload = createAction(
|
|
|
|
export const setCacheItem = createAction(
|
|
|
|
export const setCacheItem = createAction(
|
|
|
|
"SET_CACHE_ITEM",
|
|
|
|
"SET_CACHE_ITEM",
|
|
|
|
async (_col: Etebase.Collection, itemMgr: Etebase.ItemManager, item: Etebase.Item) => {
|
|
|
|
async (_col: Etebase.Collection, itemMgr: Etebase.ItemManager, item: Etebase.Item) => {
|
|
|
|
return await itemMgr.cacheSave(item);
|
|
|
|
return itemMgr.cacheSave(item);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
(col: Etebase.Collection, _itemMgr: Etebase.ItemManager, item: Etebase.Item) => {
|
|
|
|
(col: Etebase.Collection, _itemMgr: Etebase.ItemManager, item: Etebase.Item) => {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
@ -98,7 +98,7 @@ export const setCacheItemMulti = createAction(
|
|
|
|
async (_colUid: string, itemMgr: Etebase.ItemManager, items: Etebase.Item[]) => {
|
|
|
|
async (_colUid: string, itemMgr: Etebase.ItemManager, items: Etebase.Item[]) => {
|
|
|
|
const ret = [];
|
|
|
|
const ret = [];
|
|
|
|
for (const item of items) {
|
|
|
|
for (const item of items) {
|
|
|
|
ret.push(await itemMgr.cacheSave(item));
|
|
|
|
ret.push(itemMgr.cacheSave(item));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
return ret;
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -116,7 +116,7 @@ export const itemBatch = createAction(
|
|
|
|
await itemMgr.batch(items, deps);
|
|
|
|
await itemMgr.batch(items, deps);
|
|
|
|
const ret = [];
|
|
|
|
const ret = [];
|
|
|
|
for (const item of items) {
|
|
|
|
for (const item of items) {
|
|
|
|
ret.push(await itemMgr.cacheSave(item));
|
|
|
|
ret.push(itemMgr.cacheSave(item));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
return ret;
|
|
|
|
},
|
|
|
|
},
|
|
|
|