Skip to content

Commit cabf990

Browse files
Merge pull request #300 from cmu15122/jtromero/working
tiny fix
2 parents ba87b8b + d8e9b35 commit cabf990

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

client/src/components/home/shared/AskQuestion.tsx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -109,20 +109,22 @@ export default function AskQuestion() {
109109
location: location,
110110
topic: topic,
111111
}),
112-
).then((res) => {
113-
if (res.status === 200 && res.data.message === 'cooldown_violation') {
114-
setTimePassed(Math.round(res.data.timePassed));
115-
setShowCooldownOverlay(true);
116-
} else {
117-
clearValues();
118-
}
119-
120-
if (res.status === 200) {
121-
manuallyGetNewData();
122-
}
112+
)
113+
.then((res) => {
114+
if (res.status === 200 && res.data.message === 'cooldown_violation') {
115+
setTimePassed(Math.round(res.data.timePassed));
116+
setShowCooldownOverlay(true);
117+
} else {
118+
clearValues();
119+
}
123120

124-
setAskDisabled(false);
125-
});
121+
if (res.status === 200) {
122+
manuallyGetNewData();
123+
}
124+
})
125+
.finally(() => {
126+
setAskDisabled(false);
127+
});
126128
}
127129

128130
const manuallyGetNewData = () => {

0 commit comments

Comments
 (0)