Skip to content

Commit

Permalink
Merge pull request #1284 from MattTW/release
Browse files Browse the repository at this point in the history
Fix #1283 - properly default groupRoms if it doesn't exist in localStorage
  • Loading branch information
zurdi15 authored Nov 11, 2024
2 parents a27404c + ba73e38 commit 0f58db7
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 @@ -3,7 +3,7 @@ import type { DetailedRomSchema, SimpleRomSchema } from "@/__generated__/";
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 @@ -47,7 +47,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 0f58db7

Please sign in to comment.