Skip to content
This repository has been archived by the owner on Sep 28, 2020. It is now read-only.

Fix OOO refresh logic that does not always display confirmation modal. #28

Merged
merged 1 commit into from Oct 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions actions/user_actions.jsx
Expand Up @@ -22,7 +22,7 @@ import store from 'stores/redux_store.jsx';
import TeamStore from 'stores/team_store.jsx';
import UserStore from 'stores/user_store.jsx';
import * as Utils from 'utils/utils.jsx';
import {Constants, Preferences} from 'utils/constants.jsx';
import {Constants, Preferences, UserStatuses} from 'utils/constants.jsx';

const dispatch = store.dispatch;
const getState = store.getState;
Expand Down Expand Up @@ -656,7 +656,7 @@ export function autoResetStatus() {
const {currentUserId} = getState().entities.users;
const {data: userStatus} = await UserActions.getStatus(currentUserId)(doDispatch, doGetState);

if (!userStatus.manual) {
if (userStatus.status === UserStatuses.OUT_OF_OFFICE || !userStatus.manual) {
return userStatus;
}

Expand Down
2 changes: 1 addition & 1 deletion components/reset_status_modal/reset_status_modal.jsx
Expand Up @@ -69,7 +69,7 @@ export default class ResetStatusModal extends React.PureComponent {

this.setState({
currentUserStatus: status, // Set in state until status refactor where we store 'manual' field in redux
show: Boolean(statusIsManual && autoResetPrefNotSet),
show: Boolean(status.status === UserStatuses.OUT_OF_OFFICE || (statusIsManual && autoResetPrefNotSet)),
});
}
);
Expand Down