MOBILE-4469 site: Implement new hasInfo function
parent
a3898d7515
commit
748dce1757
|
@ -71,6 +71,18 @@ export class CoreUnauthenticatedSite {
|
||||||
return undefined;
|
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.
|
* Get site name.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue