Stop timer when you undo a set from an open plan

This commit is contained in:
Brandon Presley 2023-11-15 16:05:28 +13:00
parent 086e3ea2df
commit b485175082
1 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,11 @@
import { NavigationProp, useNavigation } from "@react-navigation/native";
import React, { useCallback, useState } from "react";
import { GestureResponderEvent, ListRenderItemInfo, View } from "react-native";
import {
GestureResponderEvent,
ListRenderItemInfo,
NativeModules,
View,
} from "react-native";
import { List, Menu, RadioButton, useTheme } from "react-native-paper";
import { Like } from "typeorm";
import { StackParams } from "./AppStack";
@ -36,6 +41,7 @@ export default function StartPlanItem(props: Props) {
setShowMenu(false);
if (!first) return toast("Nothing to undo.");
await setRepo.delete(first.id);
NativeModules.AlarmModule.stop();
onUndo();
}, [setShowMenu, onUndo, item.name]);