Skip to content

Commit

Permalink
Fix #1283 - properly default groupRoms if it doesn't exist in localSt…
Browse files Browse the repository at this point in the history
…orage
  • Loading branch information
MattTW committed Nov 11, 2024
1 parent 277470b commit 4ec4dcc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frontend/src/stores/roms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getStatusKeyForText } from "@/utils";
import { type Platform } from "@/stores/platforms";
import { type Collection } from "@/stores/collections";
import type { ExtractPiniaStoreType } from "@/types";
import { groupBy, uniqBy } from "lodash";
import { groupBy, isNull, uniqBy } from "lodash";
import { nanoid } from "nanoid";
import { defineStore } from "pinia";
import storeGalleryFilter from "./galleryFilter";
Expand Down Expand Up @@ -48,7 +48,9 @@ export default defineStore("roms", {
});

// Check if roms should be grouped
const groupRoms = localStorage.getItem("settings.groupRoms") === "true";
const groupRoms = isNull(localStorage.getItem("settings.groupRoms"))
? true
: localStorage.getItem("settings.groupRoms") === "true";
if (!groupRoms) {
this._grouped = this.allRoms;
return;
Expand Down

0 comments on commit 4ec4dcc

Please sign in to comment.