1
Fork 0

If user labels or colors are already defined, use them.

This commit is contained in:
Bauke 2023-07-18 18:57:46 +02:00
parent ceba850215
commit ebb87eea8c
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 10 additions and 0 deletions

View File

@ -10,6 +10,16 @@ export function v112DeserializeData(data: Record<string, any>): {
usernameColors: [], 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)) { for (const [key, value] of Object.entries(data)) {
if (key.startsWith("userLabel")) { if (key.startsWith("userLabel")) {
deserialized.userLabels.push( deserialized.userLabels.push(