frontend: conditionally show 'Go back' button based on recording URL

This commit is contained in:
Carlos Santos 2025-07-18 18:01:52 +02:00
parent c0ae9c38b6
commit 2268b0a593
2 changed files with 12 additions and 5 deletions

View File

@ -89,11 +89,12 @@
</div>
<div class="url-actions">
<button mat-button class="back-button" (click)="goBack()">
<mat-icon>arrow_back</mat-icon>
<span>Go back</span>
</button>
@if (shouldShowGoBackButton) {
<button mat-button class="back-button" (click)="goBack()">
<mat-icon>arrow_back</mat-icon>
<span>Go back</span>
</button>
}
</div>
</div>
}

View File

@ -40,6 +40,7 @@ import { RecordingManagerService } from '@lib/services';
export class ShareRecordingDialogComponent {
accessType: 'private' | 'public' = 'public';
recordingUrl?: string;
private initialRecordingUrl?: string;
loading = false;
erroMessage?: string;
@ -51,6 +52,7 @@ export class ShareRecordingDialogComponent {
private clipboard: Clipboard
) {
this.recordingUrl = data.recordingUrl;
this.initialRecordingUrl = data.recordingUrl;
}
async getRecordingUrl() {
@ -83,6 +85,10 @@ export class ShareRecordingDialogComponent {
}, 2000);
}
get shouldShowGoBackButton(): boolean {
return !this.initialRecordingUrl;
}
goBack() {
this.recordingUrl = undefined;
this.copied = false;