Skip to content

Commit

Permalink
Remove interval
Browse files Browse the repository at this point in the history
  • Loading branch information
elizachi committed Jul 24, 2024
1 parent c85ec65 commit bffc40a
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions codex-ui/src/vue/components/confirm/useConfirm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,12 @@ export const useConfirm = createSharedComposable(() => {
});

/**
* Check every 100 ms to see if the user has pressed the button
* Check if the user has pressed the confirm or close button
*/
return new Promise<boolean>((resolve) => {
const interval = setInterval(() => {
if (result.value !== undefined) {
clearInterval(interval);
resolve(result.value);
}
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
}, 100);
if (result.value !== undefined) {
resolve(result.value);
}
});
};

Expand Down

0 comments on commit bffc40a

Please sign in to comment.