From 7fd0722eb3626d75679c4793df0841ddf0480331 Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Tue, 11 Feb 2025 21:52:40 -0800 Subject: [PATCH] ensure collection is fully reloaded after an archived item is added or removed follow up to #2332 --- frontend/src/pages/org/collection-detail.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frontend/src/pages/org/collection-detail.ts b/frontend/src/pages/org/collection-detail.ts index b6b0694718..2367f17c29 100644 --- a/frontend/src/pages/org/collection-detail.ts +++ b/frontend/src/pages/org/collection-detail.ts @@ -75,6 +75,9 @@ export class CollectionDetail extends BtrixElement { @state() private isRwpLoaded = false; + @state() + private rwpDoFullReload = false; + @consume({ context: viewStateContext }) viewState?: ViewStateContext; @@ -422,6 +425,8 @@ export class CollectionDetail extends BtrixElement { } catch (e) { console.warn("Full reload not available in RWP"); } + } else { + this.rwpDoFullReload = true; } } @@ -903,6 +908,10 @@ export class CollectionDetail extends BtrixElement { if (!this.isRwpLoaded) { this.isRwpLoaded = true; } + if (this.rwpDoFullReload && this.replayEmbed) { + this.replayEmbed.fullReload(); + this.rwpDoFullReload = false; + } }} > `; @@ -1044,6 +1053,7 @@ export class CollectionDetail extends BtrixElement { icon: "check2-circle", id: "collection-item-remove-status", }); + this.refreshReplay(); void this.fetchCollection(); void this.fetchArchivedItems({ // Update page if last item