Skip to content

Commit

Permalink
Fix local storage user choices (#970)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasIO authored Sep 17, 2024
1 parent 7a3ce63 commit 3b66cf3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/eighty-poems-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@livekit/components-core": patch
---

Fix local storage user choices
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ function saveToLocalStorage<T extends JsonValue>(key: string, value: T): void {

try {
if (value) {
const nonEmptySettings = Object.entries(value).filter(([, value]) => value !== '');
const nonEmptySettings = Object.fromEntries(
Object.entries(value).filter(([, value]) => value !== ''),
);
localStorage.setItem(key, JSON.stringify(nonEmptySettings));
}
} catch (error) {
Expand Down

0 comments on commit 3b66cf3

Please sign in to comment.