Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
avrcoelho committed Oct 15, 2022
1 parent 07e67f8 commit dbea84c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 42 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-hook-notification",
"version": "2.2.5",
"version": "2.2.6",
"license": "MIT",
"main": "dist/main/index.js",
"typings": "dist/main/index.d.ts",
Expand Down
7 changes: 2 additions & 5 deletions src/presentation/components/Notification/useController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
import { getAnimation } from '../../utils/getAnimation';
import { useNotificationWidth } from '../../hooks/useNotificationWidth';
import { useLimitToRemove } from '../../hooks/useLimitToRemove';
import { useIsMounted } from '../../hooks/useIsMounted';

type UseControllerHookProps = {
dragDirection: NotificationDragDirection;
Expand Down Expand Up @@ -222,16 +221,14 @@ export const useController: UseControllerHook = ({
const delayDecrement = useRef(delay / DELAY);
const timerRef = useRef<NodeJS.Timeout>();

const isMounted = useIsMounted();
const onExecuteTimer = useCallback((): void => {
timerRef.current = setInterval(() => {
delayDecrement.current -= 1;
const canExecute = isMounted() && delayDecrement.current === 0;
if (canExecute) {
if (delayDecrement.current === 0) {
onRemove();
}
}, DELAY);
}, [onRemove, isMounted]);
}, [onRemove]);

useEffect(() => {
const canExecute = autoClose && !isPaused;
Expand Down
19 changes: 0 additions & 19 deletions src/presentation/hooks/__tests__/useIsMounted.spec.ts

This file was deleted.

17 changes: 0 additions & 17 deletions src/presentation/hooks/useIsMounted.ts

This file was deleted.

0 comments on commit dbea84c

Please sign in to comment.