feat(ui): enable XC refresh only in Electron environment

Add an isElectron flag to PlaylistItemComponent and conditionally
render the refresh button only when running inside Electron.
This prevents exposing the server refresh action in non-Electron
(environments like the browser) where window.electron is unavailable
and the feature is not supported.

Update ensures safer behavior by checking !!window.electron in the
component and using that value in the template to guard the UI.
This commit is contained in:
4gray committed 2025-12-06 21:44:50 +01:00
1 parent 4437d2c2cd
commit aba6ef024f
2 files changed
+3 -1

No files matched your search

@@ -111,7 +111,7 @@
<mat-icon>sync</mat-icon>
</button>
}
@if (item.serverUrl) {
@if (item.serverUrl && isElectron) {
<button
mat-icon-button
class="refresh-btn"
@@ -33,6 +33,8 @@ export class PlaylistItemComponent implements OnInit {
portalStatus: PortalStatus = 'unavailable';
private readonly portalStatusService = inject(PortalStatusService);
readonly isElectron = !!window.electron;
async ngOnInit() {
await this.checkPortalStatus();
}