Skip to content

Commit f4bfe27

Browse files
committed
chore: notify user the config coming from the database is in the wrong format
1 parent c1afd13 commit f4bfe27

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

frontend/src/ts/db.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ export async function initSnapshot(): Promise<
109109
};
110110
}
111111

112+
if (configData !== null && !("config" in configData)) {
113+
throw new Error(
114+
"Config data is not in the correct format. Please refresh the page or contact support."
115+
);
116+
}
117+
112118
snap.name = userData.name;
113119
snap.personalBests = userData.personalBests;
114120
snap.personalBests ??= {

0 commit comments

Comments
 (0)