From 8ef789ac8ae1b4731a4aefb33e5d0aaafd73a008 Mon Sep 17 00:00:00 2001 From: 4gray Date: Fri, 13 Feb 2026 00:19:12 +0100 Subject: [PATCH] fix(xtream): persist live channel sort mode in local storage --- .../live-stream-layout.component.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apps/web/src/app/xtream-tauri/live-stream-layout/live-stream-layout.component.ts b/apps/web/src/app/xtream-tauri/live-stream-layout/live-stream-layout.component.ts index 9b7c53cc0..e6888a423 100644 --- a/apps/web/src/app/xtream-tauri/live-stream-layout/live-stream-layout.component.ts +++ b/apps/web/src/app/xtream-tauri/live-stream-layout/live-stream-layout.component.ts @@ -37,6 +37,7 @@ import { FavoritesService } from '../services/favorites.service'; import { XtreamStore } from '../stores/xtream.store'; type LiveChannelSortMode = 'server' | 'name-asc' | 'name-desc'; +const LIVE_CHANNEL_SORT_STORAGE_KEY = 'xtream-live-channel-sort-mode'; @Component({ selector: 'app-live-stream-layout', @@ -109,6 +110,17 @@ export class LiveStreamLayoutComponent implements OnInit { favorites = new Map(); ngOnInit() { + const savedSortMode = localStorage.getItem( + LIVE_CHANNEL_SORT_STORAGE_KEY + ); + if ( + savedSortMode === 'server' || + savedSortMode === 'name-asc' || + savedSortMode === 'name-desc' + ) { + this.liveChannelSortMode.set(savedSortMode); + } + const playlist = this.xtreamStore.currentPlaylist(); if (playlist) { this.favoritesService @@ -188,5 +200,6 @@ export class LiveStreamLayoutComponent implements OnInit { setLiveChannelSortMode(mode: LiveChannelSortMode): void { this.liveChannelSortMode.set(mode); + localStorage.setItem(LIVE_CHANNEL_SORT_STORAGE_KEY, mode); } }