Add multi selection to tile grouping

This commit is contained in:
Mitchell McCaffrey
2021-05-25 15:47:52 +10:00
parent 68a084ebc9
commit 71b8aeec6c
18 changed files with 201 additions and 80 deletions

View File

@@ -4,6 +4,8 @@ import { decode } from "@msgpack/msgpack";
import { useAuth } from "./AuthContext";
import { useDatabase } from "./DatabaseContext";
import { applyObservableChange } from "../helpers/dexie";
const MapDataContext = React.createContext();
const defaultMapState = {
@@ -207,7 +209,9 @@ export function MapDataProvider({ children }) {
}
if (change.table === "groups") {
if (change.type === 2 && change.key === "maps") {
setMapGroups(change.obj.items);
const group = applyObservableChange(change);
const groups = group.items.filter((item) => item !== null);
setMapGroups(groups);
}
}
}