A music player that connects to your cloud/distributed storage.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: couple more issues with dasl sync

+8 -11
+8 -11
src/components/transformer/output/bytes/dasl-sync/element.js
··· 5 5 import "@components/output/polymorphic/indexed-db/element.js"; 6 6 7 7 import * as CID from "@common/cid.js"; 8 - import { computed, signal, untracked } from "@common/signal.js"; 8 + import { computed, signal } from "@common/signal.js"; 9 9 import { compareTimestamps } from "@common/utils.js"; 10 10 import { OutputTransformer } from "../../base.js"; 11 11 import { IDB_PREFIX } from "./constants.js"; ··· 51 51 }); 52 52 53 53 const isReady = signal(false); 54 - 55 - let isMerging = false; 54 + const isMerging = signal(false); 56 55 57 56 this.effect(() => { 58 57 if (!isReady.value) return; 59 - if (isMerging) return; 58 + if (isMerging.value) return; 60 59 61 60 const lb = localCollection(); 62 61 const rb = remote.ready() ? remoteCollection() : undefined; ··· 86 85 container.value = l; 87 86 88 87 if (this.hasDiverged({ local: l, remote: r })) { 89 - isMerging = true; 88 + isMerging.value = true; 90 89 91 90 this.merge(l, r).then(async (c) => { 92 91 container.value = c; ··· 98 97 await saveRemote(bytes); 99 98 } 100 99 101 - isMerging = false; 100 + isMerging.value = false; 102 101 }); 103 102 } 104 103 } 105 104 }); 106 105 107 106 return computed(() => { 108 - if (!untracked(isReady.get)) isReady.value = true; 107 + if (!isReady.get()) isReady.value = true; 109 108 return container.get(); 110 109 }); 111 110 }; ··· 264 263 * @returns {Promise<Container<T>>} 265 264 */ 266 265 async merge(a, b) { 267 - console.log("Merging:", a, b); 268 - 269 266 const removedA = new Set(a.inventory.removed); 270 267 const removedB = new Set(b.inventory.removed); 271 268 const allRemoved = removedA.union(removedB); ··· 373 370 managerProp(local, remote, container) { 374 371 return { 375 372 collection: computed(() => { 376 - return container()?.data ?? []; 373 + return container().data; 377 374 }), 378 375 reload: remote.reload, 379 376 save: async (/** @type {T[]} */ newItems) => { ··· 386 383 await local.save(bytes); 387 384 }, 388 385 state: computed(() => { 389 - if (container()?.cid) return "loaded"; 386 + if (container().cid) return "loaded"; 390 387 return "loading"; 391 388 }), 392 389 };