Skip to content

Commit 25e6b1e

Browse files
committed
fix: move timer activaition to form onFinish
1 parent 4b4f805 commit 25e6b1e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

apps/frontend/src/app/matching/MatchingModal.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ const MatchingModal: React.FC<MatchingModalProps> = ({ isOpen, close: _close })
6161

6262
const startMatch = matchingState.state == "closed" || matchingState.state == "timeout" ? async (params: MatchParams): Promise<void> => {
6363
const user = await ValidateUser();
64+
65+
restartTimer(
66+
new Date(Date.now() + MATCH_TIMEOUT * 1000),
67+
);
68+
6469
matchingState.start({
6570
email: user.data.email,
6671
username: user.data.username,
@@ -86,12 +91,7 @@ const MatchingModal: React.FC<MatchingModalProps> = ({ isOpen, close: _close })
8691
case 'closed':
8792
switch (closedType) {
8893
case "finding":
89-
return <FindMatchContent beginMatch={params => {
90-
restartTimer(
91-
new Date(Date.now() + MATCH_TIMEOUT * 1000),
92-
);
93-
matchingState.start(params);
94-
}}/>;
94+
return <FindMatchContent beginMatch={params => {}}/>;
9595
case "cancelled":
9696
return <MatchCancelledContent
9797
reselect={() => {

0 commit comments

Comments
 (0)