Update etebase dep and adjust according to the async changes.

master
Tom Hacohen 4 years ago
parent e9cbb9bf37
commit 990f693da8

@ -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.20.0",
"etebase": "^0.30.0",
"fuse.js": "^5.0.9-beta",
"ical.js": "^1.4.0",
"immutable": "^4.0.0-rc.12",

@ -29,7 +29,7 @@ async function decryptItems(items: Map<string, Map<string, Etebase.Item>>) {
for (const item of col.values()) {
cur.set(item.uid, {
item,
metadata: await item.getMeta(),
metadata: item.getMeta(),
content: await item.getContent(Etebase.OutputFormat.String),
});
}

@ -98,7 +98,7 @@ export default function CollectionEdit(props: PropsType) {
let collection;
if (props.collection) {
collection = props.collection.collection;
await collection.setMeta(meta);
collection.setMeta(meta);
} else {
collection = await colMgr.create(colType, meta, "");
}

@ -56,9 +56,9 @@ export default function CollectionsMain() {
async function onDelete(collection: Etebase.Collection) {
const colMgr = getCollectionManager(etebase);
const mtime = (new Date()).getTime();
const meta = await collection.getMeta();
await collection.setMeta({ ...meta, mtime });
await collection.delete(true);
const meta = collection.getMeta();
collection.setMeta({ ...meta, mtime });
collection.delete(true);
await dispatch(collectionUpload(colMgr, collection));
dispatch(pushMessage({ message: "Collection deleted", severity: "success" }));

@ -71,7 +71,7 @@ export default function Debug() {
console.log(wantAll, colItems.size);
for (const cached of colItems.values()) {
const item = itemMgr.cacheLoad(cached);
const meta = await item.getMeta();
const meta = item.getMeta();
const content = await item.getContent(Etebase.OutputFormat.String);
if (wantAll || wantedEntries[item.uid]) {
retEntries.push(`${JSON.stringify(meta)}\n${content}`);

@ -39,7 +39,7 @@ async function loadRevisions(etebase: Etebase.Account, col: Etebase.Collection,
for (const item of revisions.data) {
ret.push({
item,
metadata: await item.getMeta(),
metadata: item.getMeta(),
content: await item.getContent(Etebase.OutputFormat.String),
});
}

@ -40,8 +40,8 @@ export function getDecryptCollectionsFunction(_colType?: string) {
try {
entries.push({
collection,
metadata: await collection.getMeta(),
collectionType: await collection.getCollectionType(),
metadata: collection.getMeta(),
collectionType: collection.getCollectionType(),
});
} catch (e) {
store.dispatch(appendError(e));
@ -98,9 +98,9 @@ export async function itemSave(etebase: Etebase.Account, collection: Etebase.Col
// Existing item
eteItem = items!.get(collectionUid)?.get(itemUid)!;
await eteItem.setContent(content);
const meta = await eteItem.getMeta();
const meta = eteItem.getMeta();
meta.mtime = mtime;
await eteItem.setMeta(meta);
eteItem.setMeta(meta);
} else {
// New
const meta: Etebase.ItemMetadata = {
@ -120,10 +120,10 @@ export async function itemDelete(etebase: Etebase.Account, collection: Etebase.C
const eteItem = items!.get(collectionUid)?.get(itemUid)!;
const mtime = (new Date()).getTime();
const meta = await eteItem.getMeta();
const meta = eteItem.getMeta();
meta.mtime = mtime;
await eteItem.setMeta(meta);
await eteItem.delete(true);
eteItem.setMeta(meta);
eteItem.delete(true);
await asyncDispatch(itemBatch(collection, itemMgr, [eteItem]));
}

@ -20,7 +20,7 @@ export const getCollectionsByType = memoize(async function (cachedCollections: C
const collections = await getCollections(cachedCollections, etebase);
const ret: Etebase.Collection[] = [];
for (const col of collections) {
const collectionType = await col.getCollectionType();
const collectionType = col.getCollectionType();
if (collectionType === colType) {
ret.push(col);
}

@ -66,7 +66,7 @@ export class SyncManager {
while (!done) {
const collections = await colMgr.list(this.COLLECTION_TYPES, { stoken, limit });
for (const col of collections.data) {
const collectionType = await col.getCollectionType();
const collectionType = col.getCollectionType();
if (this.COLLECTION_TYPES.includes(collectionType)) {
store.dispatch(setCacheCollection(colMgr, col));
await this.fetchCollection(col);

@ -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.20.0:
version "0.20.0"
resolved "https://registry.yarnpkg.com/etebase/-/etebase-0.20.0.tgz#53537d76d71d356d2538c85292ee40ed32fde625"
integrity sha512-jmrrflrSG0kLe1ud3FjDishQ93Jx8s72r9xgkDxlVioxRJamJ0mE/+9KjfDRAFjWAzui8LIblOcIDw+NYPfbsA==
etebase@^0.30.0:
version "0.30.0"
resolved "https://registry.yarnpkg.com/etebase/-/etebase-0.30.0.tgz#60c33e0acaefcf02704ce31d0b831f0874de4f2a"
integrity sha512-MUQi04iQfDHaGhmx7b/JdouX2JZTEqnkqWUX+eedg1KHpa+se+kra/byQvrY7zzAbUueJiLnEdGfuFGCL/8ohw==
dependencies:
"@msgpack/msgpack" "^1.12.2"
libsodium-wrappers "0.7.6"

Loading…
Cancel
Save