diff --git a/src/core/classes/sites/unauthenticated-site.ts b/src/core/classes/sites/unauthenticated-site.ts index 7263086b8..fe4134fbd 100644 --- a/src/core/classes/sites/unauthenticated-site.ts +++ b/src/core/classes/sites/unauthenticated-site.ts @@ -71,6 +71,18 @@ export class CoreUnauthenticatedSite { return undefined; } + /** + * Check if the site has info with the given key and it doesn't contain an empty value. + * + * @param key Info key. + * @returns Whether the key is filled within site info. + */ + hasInfo(key: string): boolean { + const info = this.getInfo()?.[key] ?? null; + + return info === false || info === 0 || !!info; + } + /** * Get site name. *