mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 17:06:15 -08:00
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:
1 parent
4437d2c2cd
commit
aba6ef024f
2 files changed
+3
-1
No files matched your search
+1
-1
@@ -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();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user