From b4f4de7798e7d17f249ab46d05409839fbd486c6 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Wed, 16 Sep 2020 16:07:34 +0300 Subject: [PATCH] Update etebase and adjust usage accordingly. --- package.json | 2 +- src/Debug.tsx | 4 ++-- src/etebase-helpers.ts | 4 ++-- src/store/actions.ts | 10 +++++----- yarn.lock | 8 ++++---- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 12c184e..cedb7f8 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "@material-ui/lab": "^4.0.0-alpha.56", "@material-ui/pickers": "^3.2.10", "@material-ui/styles": "^4.10.0", - "etebase": "^0.11.0", + "etebase": "^0.12.0", "fuse.js": "^5.0.9-beta", "ical.js": "^1.4.0", "immutable": "^4.0.0-rc.12", diff --git a/src/Debug.tsx b/src/Debug.tsx index be3dfb6..a9a21aa 100644 --- a/src/Debug.tsx +++ b/src/Debug.tsx @@ -60,7 +60,7 @@ export default function Debug() { } const colMgr = getCollectionManager(etebase); - const col = await colMgr.cacheLoad(cachedCollection); + const col = colMgr.cacheLoad(cachedCollection); const itemMgr = colMgr.getItemManager(col); const wantedEntries = {}; @@ -70,7 +70,7 @@ export default function Debug() { const retEntries = []; console.log(wantAll, colItems.size); for (const cached of colItems.values()) { - const item = await itemMgr.cacheLoad(cached); + const item = itemMgr.cacheLoad(cached); const meta = await item.getMeta(); const content = await item.getContent(Etebase.OutputFormat.String); if (wantAll || wantedEntries[item.uid]) { diff --git a/src/etebase-helpers.ts b/src/etebase-helpers.ts index f15db0e..0e1d94e 100644 --- a/src/etebase-helpers.ts +++ b/src/etebase-helpers.ts @@ -11,7 +11,7 @@ export const getCollections = memoize(async function (cachedCollections: CacheCo const colMgr = getCollectionManager(etebase); const ret: Etebase.Collection[] = []; for (const cached of cachedCollections.values()) { - ret.push(await colMgr.cacheLoad(cached)); + ret.push(colMgr.cacheLoad(cached)); } return ret; }, { length: 1 }); @@ -31,7 +31,7 @@ export const getCollectionsByType = memoize(async function (cachedCollections: C export const getItems = memoize(async function (cachedItems: CacheItems, itemMgr: Etebase.ItemManager) { const ret = new Map(); for (const cached of cachedItems.values()) { - const item = await itemMgr.cacheLoad(cached); + const item = itemMgr.cacheLoad(cached); ret.set(item.uid, item); } return ret; diff --git a/src/store/actions.ts b/src/store/actions.ts index efe23e3..f4d0cbf 100644 --- a/src/store/actions.ts +++ b/src/store/actions.ts @@ -42,7 +42,7 @@ export const login = createAction( export const setCacheCollection = createAction( "SET_CACHE_COLLECTION", async (colMgr: Etebase.CollectionManager, col: Etebase.Collection) => { - return await colMgr.cacheSave(col); + return colMgr.cacheSave(col); }, (_colMgr: Etebase.CollectionManager, col: Etebase.Collection) => { return { @@ -69,7 +69,7 @@ export const collectionUpload = createAction( "COLLECTION_UPLOAD", async (colMgr: Etebase.CollectionManager, col: Etebase.Collection) => { await colMgr.upload(col); - return await colMgr.cacheSave(col); + return colMgr.cacheSave(col); }, (_colMgr: Etebase.CollectionManager, col: Etebase.Collection) => { return { @@ -82,7 +82,7 @@ export const collectionUpload = createAction( export const setCacheItem = createAction( "SET_CACHE_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) => { return { @@ -98,7 +98,7 @@ export const setCacheItemMulti = createAction( async (_colUid: string, itemMgr: Etebase.ItemManager, items: Etebase.Item[]) => { const ret = []; for (const item of items) { - ret.push(await itemMgr.cacheSave(item)); + ret.push(itemMgr.cacheSave(item)); } return ret; }, @@ -116,7 +116,7 @@ export const itemBatch = createAction( await itemMgr.batch(items, deps); const ret = []; for (const item of items) { - ret.push(await itemMgr.cacheSave(item)); + ret.push(itemMgr.cacheSave(item)); } return ret; }, diff --git a/yarn.lock b/yarn.lock index 391920c..e05f20d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4644,10 +4644,10 @@ etag@~1.8.1: resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= -etebase@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/etebase/-/etebase-0.11.0.tgz#082e6785167957723419c8eac59372b70953a921" - integrity sha512-VZwYf/i9yy89TEm2vR2dREukVcfrLmnRPS6xo5WmOTZHqBXxxMfjXtIKbH9B4xpqT5khzHmKQW6y9qFCxmWzgg== +etebase@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/etebase/-/etebase-0.12.0.tgz#91cba73d059f7828c9d1ab7c76fb250fdcbf26a3" + integrity sha512-z/UUdNyPmml5W0MQ+RS9r8tZE727t0UcQsCb9UhReTDDZLvTXh8uMJS6hjL9Tfqgj1iDCZ0jPo7KzAYXxOVVYw== dependencies: "@msgpack/msgpack" "^1.12.2" libsodium-wrappers "0.7.6"