Fix #2335
This commit is contained in:
parent
78b560d89a
commit
f3936a79aa
@ -105,17 +105,22 @@ export default async (params: any, user: ILocalUser, app: IApp) => new Promise(a
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wallpaperId) {
|
if (wallpaperId !== undefined) {
|
||||||
const wallpaper = await DriveFile.findOne({
|
if (wallpaperId === null) {
|
||||||
_id: wallpaperId
|
updates.wallpaperUrl = null;
|
||||||
});
|
updates.wallpaperColor = null;
|
||||||
|
} else {
|
||||||
|
const wallpaper = await DriveFile.findOne({
|
||||||
|
_id: wallpaperId
|
||||||
|
});
|
||||||
|
|
||||||
if (wallpaper == null) return rej('wallpaper not found');
|
if (wallpaper == null) return rej('wallpaper not found');
|
||||||
|
|
||||||
updates.wallpaperUrl = wallpaper.metadata.url || `${config.drive_url}/${wallpaper._id}`;
|
updates.wallpaperUrl = wallpaper.metadata.url || `${config.drive_url}/${wallpaper._id}`;
|
||||||
|
|
||||||
if (wallpaper.metadata.properties.avgColor) {
|
if (wallpaper.metadata.properties.avgColor) {
|
||||||
updates.wallpaperColor = wallpaper.metadata.properties.avgColor;
|
updates.wallpaperColor = wallpaper.metadata.properties.avgColor;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user