mirror of
https://github.com/ajnart/homarr.git
synced 2026-02-27 00:40:58 +01:00
fix: when no dead icons, all icons are removed (#516)
This commit is contained in:
@@ -87,14 +87,15 @@ export const iconsUpdaterJob = createCronJob(EVERY_WEEK, {
|
||||
if (newIcons.length >= 1) {
|
||||
await transaction.insert(icons).values(newIcons);
|
||||
}
|
||||
await transaction.delete(icons).where(
|
||||
deadIcons.length >= 1
|
||||
? inArray(
|
||||
icons.checksum,
|
||||
deadIcons.map((icon) => icon.checksum),
|
||||
)
|
||||
: undefined,
|
||||
);
|
||||
if (deadIcons.length >= 1) {
|
||||
await transaction.delete(icons).where(
|
||||
inArray(
|
||||
icons.checksum,
|
||||
deadIcons.map((icon) => icon.checksum),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
countDeleted += deadIcons.length;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user