mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-08-14 14:22:38 -05:00
Fix users without weapon pool having one "null weapon"
This commit is contained in:
@@ -7,8 +7,10 @@ export function parseDBJsonArray(value: any) {
|
||||
|
||||
// If the returned array of JSON objects from DB is empty
|
||||
// it will be returned as object with all values being null
|
||||
// this is a workaround for that
|
||||
return parsed.filter((item: any) => Object.values(item).some(Boolean));
|
||||
// this is a (hacky) workaround for that
|
||||
return parsed.filter((item: any) =>
|
||||
Object.values(item).some((val) => val !== null)
|
||||
);
|
||||
}
|
||||
|
||||
export function parseDBArray(value: any) {
|
||||
|
||||
Reference in New Issue
Block a user