Skip to content

Commit 4cbcd5d

Browse files
committed
fix: 🐛 task data not directly update
1 parent 3f90da7 commit 4cbcd5d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/apis/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ export const setupInterceptors = (signOut) => {
6262
const { data } = await publicApi.post("/refresh-token", {
6363
refreshToken,
6464
});
65+
console.log("🚀 ~ data:", data);
6566

66-
const { token } = data;
67+
const { token } = data?.data || {};
6768

6869
// Save the new access token
6970
localStorage.setItem("accessToken", token);

src/components/timer/TimerCount.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ export default function TimerCount() {
103103

104104
useEffect(() => {
105105
currentTimerDuration.current = timerDuration;
106-
}, [timerDuration]);
106+
107+
if (!playing) {
108+
setTimeSeconds(timerDuration[selectedOption] * 60);
109+
}
110+
}, [playing, selectedOption, timerDuration]);
107111

108112
const optionData = useMemo(
109113
() => TIMER_OPTIONS.find((option) => option.value === selectedOption) || {},

0 commit comments

Comments
 (0)