Add Error Handling for collections cache load failures

This commit is contained in:
Max Berger
2026-03-21 23:45:08 +01:00
parent fc18cadd38
commit 01b9df4666
3 changed files with 19 additions and 6 deletions

View File

@@ -52,11 +52,11 @@ class CollectionsCache {
* @param {string} password
* @param {import("../models/collection.js").Collection} principal_collection
* @param {function(string):void} onerror
* @param {function(Array<import("../models/collection.js").Collection>, Array<import("../api/sharing.js").Share>):void} displayData
* @param {function(Array<import("../models/collection.js").Collection>, Array<import("../api/sharing.js").Share>, boolean):void} displayData
*/
getChildCollections(user, password, principal_collection, onerror, displayData) {
if (this.child_collections !== null && this.incoming_shares !== null) {
displayData(this.child_collections, this.incoming_shares);
displayData(this.child_collections, this.incoming_shares, false);
return;
}
@@ -79,7 +79,7 @@ class CollectionsCache {
} else if (collections !== null && shares !== null) {
this.child_collections = collections;
this.incoming_shares = shares;
displayData(this.child_collections, this.incoming_shares);
displayData(this.child_collections, this.incoming_shares, true);
pop_scene();
}
};