Skip to content

Commit

Permalink
fix: stop looping when library is ready
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich authored Apr 13, 2022
1 parent b0481a9 commit 5a764d4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/blocks/dropbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ const WithDropbox: React.FC<BlockProps> = (props) => {
let mounted = true;
const wait = () => {
if (!mounted) return;
if (typeof Dropbox !== 'undefined') setReady(true);
if (typeof Dropbox !== 'undefined') {
setReady(true);
return;
}
setTimeout(wait, 100);
};
wait();
Expand Down

0 comments on commit 5a764d4

Please sign in to comment.