fix version selection while switching sites

This commit is contained in:
Krrish Ghimire
2026-07-02 01:35:17 +05:45
parent d29de6fdbc
commit dd102aa87c

View File

@@ -275,13 +275,21 @@ export class LlmWorkspaceComponent implements OnInit, OnDestroy {
private destroy$ = new Subject<void>();
ngOnInit(): void {
this.siteId = this.route.snapshot.paramMap.get('siteId');
const existingPrompt = this.session.currentPrompt;
if (existingPrompt) {
this.prompt = existingPrompt;
}
this.route.paramMap
.pipe(takeUntil(this.destroy$))
.subscribe(params => {
const siteId = params.get('siteId');
if (siteId !== this.siteId) {
this.siteId = siteId;
this.prompt = '';
this.refinePrompt = '';
this.showRefine = false;
this.versions = [];
this.session.clearHistory();
this.loadVersions();
}
});
}
private loadVersions(): void {
if (!this.siteId) return;