mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-02 13:03:22 +00:00
config-util: Add isConfigItemExists to check if a key exists.
This commit is contained in:
committed by
Akash Nimare
parent
f7696cc04d
commit
339a415d60
@@ -49,6 +49,16 @@ class ConfigUtil {
|
||||
}
|
||||
}
|
||||
|
||||
isConfigItemExists(key) {
|
||||
this.reloadDB();
|
||||
const value = this.db.getData('/')[key];
|
||||
if (value === undefined) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
setConfigItem(key, value) {
|
||||
this.db.push(`/${key}`, value, true);
|
||||
this.reloadDB();
|
||||
|
Reference in New Issue
Block a user