Skip to content

Commit

Permalink
fix: type object on Stopwatch
Browse files Browse the repository at this point in the history
  • Loading branch information
lme-axelor committed Jun 14, 2024
1 parent af6f3dd commit 34c5dbf
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
usePermitted,
useSelector,
useTranslator,
useTypes,
} from '@axelor/aos-mobile-core';
import {createTimer, updateTimerStatus} from '../../../features/timerSlice';
import {Time} from '../../../types';
Expand Down Expand Up @@ -64,6 +65,7 @@ const TimerStopwatch = ({
const {canCreate, readonly} = usePermitted({
modelName: 'com.axelor.apps.hr.db.TSTimer',
});
const {Timer} = useTypes();

const [time, setTime] = useState(DEFAULT_TIME);
const [status, setStatus] = useState(DEFAULT_STATUS);
Expand Down Expand Up @@ -102,13 +104,13 @@ const TimerStopwatch = ({
const _timer = res?.payload?.payload?.[0];
if (
toStatus === 'stop' &&
_timer?.statusSelect === Time.statusSelect.Completed
_timer?.statusSelect === Timer?.statusSelect.Stop
) {
setIsAlertVisible(true);
}
});
},
[defaultValue, dispatch, userId],
[defaultValue, dispatch, Timer, userId],
);

const getTimerState = useCallback(() => {
Expand Down

0 comments on commit 34c5dbf

Please sign in to comment.