image upload and keep if not changed
This commit is contained in:
parent
be52a51055
commit
5b3a72820a
3 changed files with 17 additions and 9 deletions
|
@ -130,10 +130,10 @@ export async function getApplicationLogo(req: Request, res: Response): Promise<a
|
|||
"Timing-Allow-Origin": "*",
|
||||
});
|
||||
|
||||
if (setLogo == "") {
|
||||
res.sendFile(FileSystemHelper.readAssetFile("admin-logo.png", true));
|
||||
} else {
|
||||
if (setLogo != "" && FileSystemHelper.getFilesInDirectory("/app", ".png").includes("admin-icon.png")) {
|
||||
res.sendFile(FileSystemHelper.formatPath("/app/admin-logo.png"));
|
||||
} else {
|
||||
res.sendFile(FileSystemHelper.readAssetFile("admin-logo.png", true));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -147,8 +147,8 @@ export async function getApplicationFavicon(req: Request, res: Response): Promis
|
|||
let icon = FileSystemHelper.readAssetFile("icon.png", true);
|
||||
let setLogo = SettingHelper.getSetting("club.icon");
|
||||
|
||||
if (setLogo != "") {
|
||||
icon = FileSystemHelper.formatPath("/app/icon.png");
|
||||
if (setLogo != "" && FileSystemHelper.getFilesInDirectory("/app", ".png").includes("admin-icon.png")) {
|
||||
icon = FileSystemHelper.formatPath("/app/admin-icon.png");
|
||||
}
|
||||
|
||||
let image = await sharp(icon)
|
||||
|
@ -184,8 +184,8 @@ export async function getApplicationIcon(req: Request, res: Response): Promise<a
|
|||
let icon = FileSystemHelper.readAssetFile("icon.png", true);
|
||||
let setLogo = SettingHelper.getSetting("club.icon");
|
||||
|
||||
if (setLogo != "") {
|
||||
icon = FileSystemHelper.formatPath("/app/icon.png");
|
||||
if (setLogo != "" && FileSystemHelper.getFilesInDirectory("/app", ".png").includes("admin-icon.png")) {
|
||||
icon = FileSystemHelper.formatPath("/app/admin-icon.png");
|
||||
}
|
||||
|
||||
let image = await sharp(icon)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue