mirror of
https://github.com/gethomepage/homepage.git
synced 2026-05-18 19:40:58 +08:00
Fix: prevent Seerr widget incorrectly injecting "available" field (#6663)
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
@@ -30,10 +30,12 @@ export default function Component({ service }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (statsData.completed === undefined) {
|
if (
|
||||||
// Newer versions added "completed", fallback to available
|
statsData.completed === undefined &&
|
||||||
widget.fields = widget.fields.filter((field) => field !== "completed");
|
(widget.fields.includes("completed") || widget.fields.includes("available"))
|
||||||
widget.fields.push("available");
|
) {
|
||||||
|
// Fallback to "available" if "completed" requested but not available
|
||||||
|
widget.fields = widget.fields.map((field) => (field === "completed" ? "available" : field));
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user