Check role when receiving status updates in the Operator Status Indicator (#7509)

* check role when receiving status updates

* pass role to get status
This commit is contained in:
Scott Bell 2024-02-16 22:45:04 +01:00 committed by GitHub
parent 317ea8c275
commit 9870a6bc9c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -129,7 +129,7 @@ export default {
this.role = activeRole;
const status = await this.openmct.user.status.getStatusForRole(activeRole);
if (status !== undefined) {
this.setStatus({ status });
this.setStatus({ role: this.role, status });
}
},
subscribeToMyStatus() {
@ -141,7 +141,11 @@ export default {
subscribeToRoleChange() {
this.openmct.user.on('roleChanged', this.fetchMyStatus);
},
setStatus({ status }) {
setStatus({ role, status }) {
if (role !== this.role) {
// not my role
return;
}
status = this.applyStyling(status);
this.selectedStatus = status.key;
this.indicator.iconClass(status.iconClassPoll);