Skip to content

Commit 7fd0722

Browse files
committed
ensure collection is fully reloaded after an archived item is added or removed
follow up to #2332
1 parent 3586412 commit 7fd0722

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

frontend/src/pages/org/collection-detail.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ export class CollectionDetail extends BtrixElement {
7575
@state()
7676
private isRwpLoaded = false;
7777

78+
@state()
79+
private rwpDoFullReload = false;
80+
7881
@consume({ context: viewStateContext })
7982
viewState?: ViewStateContext;
8083

@@ -422,6 +425,8 @@ export class CollectionDetail extends BtrixElement {
422425
} catch (e) {
423426
console.warn("Full reload not available in RWP");
424427
}
428+
} else {
429+
this.rwpDoFullReload = true;
425430
}
426431
}
427432

@@ -903,6 +908,10 @@ export class CollectionDetail extends BtrixElement {
903908
if (!this.isRwpLoaded) {
904909
this.isRwpLoaded = true;
905910
}
911+
if (this.rwpDoFullReload && this.replayEmbed) {
912+
this.replayEmbed.fullReload();
913+
this.rwpDoFullReload = false;
914+
}
906915
}}
907916
></replay-web-page>
908917
</section>`;
@@ -1044,6 +1053,7 @@ export class CollectionDetail extends BtrixElement {
10441053
icon: "check2-circle",
10451054
id: "collection-item-remove-status",
10461055
});
1056+
this.refreshReplay();
10471057
void this.fetchCollection();
10481058
void this.fetchArchivedItems({
10491059
// Update page if last item

0 commit comments

Comments
 (0)