Skip to content

Commit efa4a45

Browse files
committed
reset on close
1 parent 69ead2d commit efa4a45

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

frontend/src/features/collections/collection-replay-dialog.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,12 @@ export class CollectionStartPageDialog extends BtrixElement {
9393
.open=${this.open}
9494
class="[--width:60rem]"
9595
@sl-show=${() => (this.showContent = true)}
96-
@sl-after-hide=${() => (this.showContent = false)}
96+
@sl-after-hide=${() => {
97+
this.homeView = this.homeUrl ? HomeView.URL : HomeView.Pages;
98+
this.isSubmitting = false;
99+
this.selectedSnapshot = null;
100+
this.showContent = false;
101+
}}
97102
>
98103
${this.showContent ? this.renderContent() : nothing}
99104
<div slot="footer" class="flex items-center justify-between gap-3">
@@ -207,6 +212,16 @@ export class CollectionStartPageDialog extends BtrixElement {
207212
?disabled=${!this.replayLoaded}
208213
@sl-change=${(e: SlChangeEvent) => {
209214
this.homeView = (e.currentTarget as SlSelect).value as HomeView;
215+
216+
if (this.homeView === HomeView.Pages) {
217+
if (
218+
!this.homePageId ||
219+
this.homePageId !== this.selectedSnapshot?.pageId
220+
) {
221+
// Reset unsaved selected snapshot
222+
this.selectedSnapshot = null;
223+
}
224+
}
210225
}}
211226
>
212227
${this.replayLoaded

0 commit comments

Comments
 (0)