mirror of
https://github.com/rommapp/romm.git
synced 2026-12-05 05:07:31 +01:00
Fix #1283 - properly default groupRoms if it doesn't exist in localStorage
This commit is contained in:
@@ -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";
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user