Skip to content

Commit

Permalink
Store Media Browser view in localStorage (#23061)
Browse files Browse the repository at this point in the history
feat: store preferredLayout in localStorage
  • Loading branch information
Robert-MacWha authored Dec 2, 2024
1 parent 7191edd commit 96395dd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/panels/media-browser/ha-panel-media-browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ class PanelMediaBrowser extends LitElement {

@state() _currentItem?: MediaPlayerItem;

@state() _preferredLayout: MediaPlayerLayoutType = "auto";
@storage({
key: "mediaBrowserPreferredLayout",
storage: "localStorage",
state: true,
deserializer: (value) => value || "auto",
})
private _preferredLayout!: MediaPlayerLayoutType;

private _navigateIds: MediaPlayerItemId[] = [
{
Expand Down

0 comments on commit 96395dd

Please sign in to comment.