mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
fix graphs failing to load until preferences set
The protobuf object will be missing keys that have the default value, so we need to fill the defaults in.
This commit is contained in:
parent
bf130d1da0
commit
6f798930a2
1 changed files with 6 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
import type pb from "anki/backend_proto";
|
||||
import pb from "anki/backend_proto";
|
||||
import { getGraphPreferences, setGraphPreferences } from "./graph-helpers";
|
||||
import { Writable, writable, get } from "svelte/store";
|
||||
|
||||
|
@ -58,7 +58,11 @@ function preparePreferences(
|
|||
setGraphPreferences(constructPreferences());
|
||||
}
|
||||
|
||||
for (const [key, value] of Object.entries(graphsPreferences)) {
|
||||
for (const [key, value] of Object.entries(
|
||||
pb.BackendProto.GraphsPreferences.toObject(graphsPreferences, {
|
||||
defaults: true,
|
||||
})
|
||||
)) {
|
||||
preferences[key] = createPreference(value, savePreferences);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue