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>(); private destroy$ = new Subject<void>();
ngOnInit(): void { ngOnInit(): void {
this.siteId = this.route.snapshot.paramMap.get('siteId'); this.route.paramMap
const existingPrompt = this.session.currentPrompt; .pipe(takeUntil(this.destroy$))
if (existingPrompt) { .subscribe(params => {
this.prompt = existingPrompt; 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(); this.loadVersions();
} }
});
}
private loadVersions(): void { private loadVersions(): void {
if (!this.siteId) return; if (!this.siteId) return;