From ebb87eea8cd3d992f74573bc78e52c02b51913c1 Mon Sep 17 00:00:00 2001 From: Bauke Date: Tue, 18 Jul 2023 18:57:46 +0200 Subject: [PATCH] If user labels or colors are already defined, use them. --- source/storage/migrations/v1-1-2.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/storage/migrations/v1-1-2.ts b/source/storage/migrations/v1-1-2.ts index e3ffa69..a06c44e 100644 --- a/source/storage/migrations/v1-1-2.ts +++ b/source/storage/migrations/v1-1-2.ts @@ -10,6 +10,16 @@ export function v112DeserializeData(data: Record): { usernameColors: [], }; + if (data.data?.userLabels !== undefined) { + deserialized.userLabels = data.data + .userLabels as V112Settings["data"]["userLabels"]; + } + + if (data.data?.usernameColors !== undefined) { + deserialized.usernameColors = data.data + .usernameColors as V112Settings["data"]["usernameColors"]; + } + for (const [key, value] of Object.entries(data)) { if (key.startsWith("userLabel")) { deserialized.userLabels.push(