Skip to content

Commit

Permalink
Pause timer if toast appears when the document is hidden (#426)
Browse files Browse the repository at this point in the history
  • Loading branch information
pytnik23 committed Jun 8, 2024
1 parent cc2e8ef commit 3f4ec53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

export const useIsDocumentHidden = () => {
const [isDocumentHidden, setIsDocumentHidden] = React.useState(false);
const [isDocumentHidden, setIsDocumentHidden] = React.useState(document.hidden);

React.useEffect(() => {
const callback = () => {
Expand Down

0 comments on commit 3f4ec53

Please sign in to comment.