🩹 Move schema to Component.data + remove unnecessary null checks

This commit is contained in:
Marcell Fülöp
2022-06-19 16:31:54 +00:00
parent db0fc0454d
commit 991cf0bf5a
4 changed files with 110 additions and 116 deletions

View File

@@ -152,13 +152,13 @@ export default {
/* Update the sate based on the capabilites response */
processCapabilities(capResponse) {
const ocdata = this.validateResponse(capResponse);
const capNotif = ocdata?.capabilities?.notifications?.['ocs-endpoints'];
this.branding = ocdata?.capabilities?.theming;
const capNotif = ocdata.capabilities?.notifications?.['ocs-endpoints'];
this.branding = ocdata.capabilities?.theming;
this.capabilities.notifications.enabled = !!(capNotif?.length);
this.capabilities.notifications.features = capNotif || [];
this.capabilities.userStatus = !!(ocdata?.capabilities?.user_status?.enabled);
this.version.string = ocdata?.version?.string;
this.version.edition = ocdata?.version?.edition;
this.capabilities.userStatus = !!(ocdata.capabilities?.user_status?.enabled);
this.version.string = ocdata.version?.string;
this.version.edition = ocdata.version?.edition;
this.capabilitiesLastUpdated = new Date().getTime();
},
/* Shared template helpers */