Chore: Fix presence for current user (#1001)
Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
This commit is contained in:
@@ -34,6 +34,10 @@ export const getters = {
|
||||
return _state.currentUser.id;
|
||||
},
|
||||
|
||||
getCurrentUserAvailabilityStatus(_state) {
|
||||
return _state.currentUser.availability_status;
|
||||
},
|
||||
|
||||
getCurrentAccountId(_state) {
|
||||
return _state.currentAccountId;
|
||||
},
|
||||
@@ -104,10 +108,22 @@ export const actions = {
|
||||
setCurrentAccountId({ commit }, accountId) {
|
||||
commit(types.default.SET_CURRENT_ACCOUNT_ID, accountId);
|
||||
},
|
||||
|
||||
setCurrentUserAvailabilityStatus({ commit, state: $state }, data) {
|
||||
if (data[$state.currentUser.id]) {
|
||||
commit(
|
||||
types.default.SET_CURRENT_USER_AVAILABILITY,
|
||||
data[$state.currentUser.id]
|
||||
);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
// mutations
|
||||
const mutations = {
|
||||
[types.default.SET_CURRENT_USER_AVAILABILITY](_state, status) {
|
||||
Vue.set(_state.currentUser, 'availability_status', status);
|
||||
},
|
||||
[types.default.CLEAR_USER](_state) {
|
||||
_state.currentUser.id = null;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user