We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fff1f31 commit 3a4f42fCopy full SHA for 3a4f42f
1 file changed
rest-on-couch/UserPreferences.js
@@ -71,6 +71,24 @@ class UserPreferences {
71
}
72
73
74
+ /**
75
+ * Returns the current value of a preference key from the live API data.
76
+ * @param {string} key
77
+ * @returns {unknown}
78
+ */
79
+ get(key) {
80
+ const data = API.getData(this.varName);
81
+ return data ? data[key] : undefined;
82
+ }
83
+
84
85
+ * Returns the current list of groups to append for the logged-in user.
86
+ * @returns {string[]}
87
88
+ getGroupsToAppend() {
89
+ return /** @type {string[]} */ (this.get('groupsToAppend') ?? []);
90
91
92
/**
93
* Saves current preferences to CouchDB.
94
* @returns {Promise<void>}
0 commit comments