mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-16 18:26:20 +01:00
✨ Add console warn if apps are missing properties
This commit is contained in:
@@ -7,6 +7,22 @@ export const getFrontendConfig = (name: string): ConfigType => {
|
|||||||
const config = getConfig(name);
|
const config = getConfig(name);
|
||||||
|
|
||||||
Consola.info(`Requested frontend content of configuration '${name}'`);
|
Consola.info(`Requested frontend content of configuration '${name}'`);
|
||||||
|
// Find out if config as apps with integrations that have a property with no value or undefined
|
||||||
|
// If so, remove print an error using consola
|
||||||
|
// If not, return the config
|
||||||
|
const appsWithIntegrationsWithUndefinedProperties = config.apps.filter(
|
||||||
|
(app) =>
|
||||||
|
app.integration?.properties.some(
|
||||||
|
(property) => property.value === null || property.value === undefined
|
||||||
|
) ?? false
|
||||||
|
);
|
||||||
|
if (appsWithIntegrationsWithUndefinedProperties.length > 0) {
|
||||||
|
Consola.warn(
|
||||||
|
`The following apps have integrations with errored properties: [${appsWithIntegrationsWithUndefinedProperties
|
||||||
|
.map((app) => app.name)
|
||||||
|
.join(', ')}] please input the correct secrets once again for the concerned app(s), save them, exit edit mode and reload the page.`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...config,
|
...config,
|
||||||
|
|||||||
Reference in New Issue
Block a user