fix version selection while switching sites
This commit is contained in:
@@ -275,12 +275,20 @@ 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.loadVersions();
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user