mirror of
https://github.com/gethomepage/homepage.git
synced 2026-01-05 06:52:11 +08:00
Chore: change hoarder widget to karakeep (#5143)
Some checks failed
Crowdin Action / Crowdin Sync (push) Has been cancelled
Docker CI / Linting Checks (push) Has been cancelled
Docker CI / Docker Build & Push (push) Has been cancelled
Repository Maintenance / Stale (push) Has been cancelled
Repository Maintenance / Lock Old Threads (push) Has been cancelled
Repository Maintenance / Close Answered Discussions (push) Has been cancelled
Repository Maintenance / Close Outdated Discussions (push) Has been cancelled
Repository Maintenance / Close Unsupported Feature Requests (push) Has been cancelled
Some checks failed
Crowdin Action / Crowdin Sync (push) Has been cancelled
Docker CI / Linting Checks (push) Has been cancelled
Docker CI / Docker Build & Push (push) Has been cancelled
Repository Maintenance / Stale (push) Has been cancelled
Repository Maintenance / Lock Old Threads (push) Has been cancelled
Repository Maintenance / Close Answered Discussions (push) Has been cancelled
Repository Maintenance / Close Outdated Discussions (push) Has been cancelled
Repository Maintenance / Close Unsupported Feature Requests (push) Has been cancelled
This commit is contained in:
@@ -3,6 +3,11 @@ import { SettingsContext } from "utils/contexts/settings";
|
||||
|
||||
import Error from "./error";
|
||||
|
||||
const ALIASED_WIDGETS = {
|
||||
pialert: "netalertx",
|
||||
hoarder: "karakeep",
|
||||
};
|
||||
|
||||
export default function Container({ error = false, children, service }) {
|
||||
const { settings } = useContext(SettingsContext);
|
||||
|
||||
@@ -32,7 +37,17 @@ export default function Container({ error = false, children, service }) {
|
||||
if (!field.includes(".")) {
|
||||
fullField = `${type}.${field}`;
|
||||
}
|
||||
return fullField === child?.props?.label;
|
||||
let matches = fullField === child?.props?.label;
|
||||
// check if the field is an 'alias'
|
||||
if (matches) {
|
||||
return true;
|
||||
} else if (ALIASED_WIDGETS[type]) {
|
||||
matches = fullField.replace(type, ALIASED_WIDGETS[type]) === child?.props?.label;
|
||||
|
||||
return matches;
|
||||
}
|
||||
// no match
|
||||
return false;
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user