mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-10 07:13:09 +02:00
Fix #2335
This commit is contained in:
parent
78b560d89a
commit
f3936a79aa
1 changed files with 13 additions and 8 deletions
|
@ -105,7 +105,11 @@ export default async (params: any, user: ILocalUser, app: IApp) => new Promise(a
|
|||
}
|
||||
}
|
||||
|
||||
if (wallpaperId) {
|
||||
if (wallpaperId !== undefined) {
|
||||
if (wallpaperId === null) {
|
||||
updates.wallpaperUrl = null;
|
||||
updates.wallpaperColor = null;
|
||||
} else {
|
||||
const wallpaper = await DriveFile.findOne({
|
||||
_id: wallpaperId
|
||||
});
|
||||
|
@ -118,6 +122,7 @@ export default async (params: any, user: ILocalUser, app: IApp) => new Promise(a
|
|||
updates.wallpaperColor = wallpaper.metadata.properties.avgColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await User.update(user._id, {
|
||||
$set: updates
|
||||
|
|
Loading…
Reference in a new issue