mirror of
https://github.com/spacebarchat/server.git
synced 2026-03-30 13:55:39 +00:00
Try to fix duplicate user settings
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -358,6 +358,7 @@ export async function onIdentify(this: WebSocket, data: Payload) {
|
||||
// so for instances that migrated, users may not have a `user_settings` row.
|
||||
let createUserSettingsTime: ElapsedTime | undefined = undefined;
|
||||
if (!user.settings) {
|
||||
console.warn("[WARN] Creating new user settings!")
|
||||
user.settings = new UserSettings();
|
||||
await user.settings.save();
|
||||
createUserSettingsTime = taskSw.getElapsedAndReset();
|
||||
|
||||
@@ -58,7 +58,7 @@ export enum PrivateUserEnum {
|
||||
purchased_flags,
|
||||
premium_usage_flags,
|
||||
disabled,
|
||||
// settings, // now a relation
|
||||
settings,
|
||||
// locale
|
||||
}
|
||||
export type PrivateUserKeys = keyof typeof PrivateUserEnum | PublicUserKeys;
|
||||
|
||||
Reference in New Issue
Block a user