FIX: Haptic was looping

This commit is contained in:
Marcos Rodriguez Vélez 2021-10-19 16:22:39 -04:00
parent ae22eaea66
commit fbfa310b52
No known key found for this signature in database
GPG key ID: 0D64671698D11C5C

View file

@ -184,12 +184,17 @@ const LNDViewInvoice = () => {
useEffect(() => {
if (invoice.ispaid && invoiceStatusChanged) {
ReactNativeHapticFeedback.trigger('notificationSuccess', { ignoreAndroidSystemSettings: false });
setInvoiceStatusChanged(true);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [invoice]);
useEffect(() => {
if (invoiceStatusChanged) {
ReactNativeHapticFeedback.trigger('notificationSuccess', { ignoreAndroidSystemSettings: false });
}
}, [invoiceStatusChanged]);
const onLayout = e => {
const { height, width } = e.nativeEvent.layout;
setQRCodeSize(height > width ? width - 40 : e.nativeEvent.layout.width / 1.8);