fix version selection while switching sites
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user