update: add 'hasCap(flag)' function to WTVClientSessionData for easier client-capabilities checking (see wtv-home/home.js for an example)

This commit is contained in:
zefie
2021-07-26 06:12:53 -04:00
parent 03a3337cd4
commit 41b4deb831
3 changed files with 25 additions and 7 deletions

View File

@@ -9,11 +9,19 @@ class WTVClientSessionData {
\***********************************/
data_store = null;
capabilities = null;
constructor() {
this.data_store = new Array();
}
hasCap(cap) {
if (this.capabilities) {
return this.capabilities[cap] || false;
}
return false;
}
get(key = null) {
if (typeof (this.data_store) === 'undefined') return null;
else if (key === null) return this.data_store;