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

Configure Feed

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

fix: more loading issues

+15 -7
+1 -2
src/components/engine/queue/element.js
··· 1 1 import { DiffuseElement } from "@common/element.js"; 2 2 import { signal } from "@common/signal.js"; 3 3 import { listen } from "@common/worker.js"; 4 - import { hash } from "@common/utils.js"; 5 4 6 5 /** 7 6 * @import {ProxiedActions} from "@common/worker.d.ts"; ··· 37 36 #future = signal(/** @type {Array<Item>} */ ([])); 38 37 #now = signal(/** @type {Item | null} */ (null)); 39 38 #past = signal(/** @type {Array<Item>} */ ([])); 40 - #poolHash = signal(hash([])); 39 + #poolHash = signal(/** @type {string | undefined} */ (undefined)); 41 40 42 41 // STATE 43 42
+1 -1
src/components/engine/queue/types.d.ts
··· 24 24 future: SignalReader<Item[]>; 25 25 now: SignalReader<Item | null>; 26 26 past: SignalReader<Item[]>; 27 - poolHash: SignalReader<string>; 27 + poolHash: SignalReader<string | undefined>; 28 28 };
+2 -2
src/components/engine/queue/worker.js
··· 17 17 export const $future = signal(/** @type {Item[]} */ ([])); 18 18 export const $now = signal(/** @type {Item | null} */ (null)); 19 19 export const $past = signal(/** @type {Item[]} */ ([])); 20 - export const $poolHash = signal(hash([])); 20 + export const $poolHash = signal(/** @type {string | undefined} */ (undefined)); 21 21 22 22 //////////////////////////////////////////// 23 23 // ACTIONS ··· 55 55 */ 56 56 export function pool(tracks) { 57 57 $lake.value = tracks; 58 - $poolHash.value = hash(tracks); 58 + $poolHash.value = tracks.length ? hash(tracks) : undefined; 59 59 } 60 60 61 61 /**
+8 -2
src/themes/webamp/browser/element.js
··· 19 19 20 20 // SIGNALS 21 21 22 + #collectionSize = signal(0); 22 23 #searchResults = signal(/** @type {Track[]} */ ([])); 23 24 24 25 $input = signal( ··· 70 71 }); 71 72 72 73 this.effect(() => { 73 - this.forceRender(); 74 + this.#collectionSize.value = output.tracks.collection().filter( 75 + (t) => t.kind !== "placeholder", 76 + ).length; 74 77 }); 78 + 79 + this.forceRender(); 75 80 }); 76 81 77 82 // Effects ··· 112 117 */ 113 118 render({ html }) { 114 119 const isLoading = this.$output.value?.tracks?.state() !== "loaded" || 115 - (this.$output.value?.tracks?.collection()?.length && 120 + (this.#collectionSize.value > 0 && 116 121 this.$search.value?.cacheId() === undefined); 122 + 117 123 const tracks = this.#searchResults.value; 118 124 119 125 return html`
+3
src/themes/webamp/index.js
··· 119 119 const cacheId = search.cacheId(); 120 120 if (cacheId === undefined) return; 121 121 122 + const poolHash = queue.poolHash(); 123 + if (poolHash === undefined) return; 124 + 122 125 tracksPromise.resolve("loaded"); 123 126 }); 124 127