Patch modal to prevent warnings

This commit is contained in:
minibits-cash
2026-01-10 00:27:59 +01:00
parent 480b0db1a2
commit 2ed6130976
2 changed files with 65 additions and 1 deletions

View File

@@ -0,0 +1,54 @@
diff --git a/node_modules/react-native-modal/dist/modal.js b/node_modules/react-native-modal/dist/modal.js
index 74edee4..9c5bc1f 100644
--- a/node_modules/react-native-modal/dist/modal.js
+++ b/node_modules/react-native-modal/dist/modal.js
@@ -1,5 +1,5 @@
import * as React from 'react';
-import { Animated, DeviceEventEmitter, Dimensions, InteractionManager, KeyboardAvoidingView, Modal, PanResponder, Platform, TouchableWithoutFeedback, View, } from 'react-native';
+import { Animated, DeviceEventEmitter, Dimensions, KeyboardAvoidingView, Modal, PanResponder, Platform, TouchableWithoutFeedback, View, } from 'react-native';
import * as animatable from 'react-native-animatable';
import { buildAnimations, initializeAnimations, reversePercentage, } from './utils';
import styles from './modal.style';
@@ -116,7 +116,7 @@ export class ReactNativeModal extends React.Component {
this.didUpdateDimensionsEmitter.remove();
}
if (this.interactionHandle) {
- InteractionManager.clearInteractionHandle(this.interactionHandle);
+ cancelIdleCallback(this.interactionHandle);
this.interactionHandle = null;
}
}
@@ -394,14 +394,14 @@ export class ReactNativeModal extends React.Component {
if (this.contentRef) {
this.props.onModalWillShow && this.props.onModalWillShow();
if (this.interactionHandle == null) {
- this.interactionHandle = InteractionManager.createInteractionHandle();
+ this.interactionHandle = requestIdleCallback(() => {});
}
this.contentRef
.animate(this.animationIn, this.props.animationInTiming)
.then(() => {
this.isTransitioning = false;
if (this.interactionHandle) {
- InteractionManager.clearInteractionHandle(this.interactionHandle);
+ cancelIdleCallback(this.interactionHandle);
this.interactionHandle = null;
}
if (!this.props.isVisible) {
@@ -440,14 +440,14 @@ export class ReactNativeModal extends React.Component {
if (this.contentRef) {
this.props.onModalWillHide && this.props.onModalWillHide();
if (this.interactionHandle == null) {
- this.interactionHandle = InteractionManager.createInteractionHandle();
+ this.interactionHandle = requestIdleCallback(() => {});
}
this.contentRef
.animate(animationOut, this.props.animationOutTiming)
.then(() => {
this.isTransitioning = false;
if (this.interactionHandle) {
- InteractionManager.clearInteractionHandle(this.interactionHandle);
+ cancelIdleCallback(this.interactionHandle);
this.interactionHandle = null;
}
if (this.props.isVisible) {

View File

@@ -17,6 +17,13 @@ import { generateId } from '../utils/utils'
import { Proof } from './Proof'
import { CashuProof, CashuUtils } from '../services/cashu/cashuUtils'
// Helper function to serialize MeltPreview and convert BigInt to string
function serializeMeltPreview(meltPreview: MeltPreview): any {
return JSON.parse(JSON.stringify(meltPreview, (_key, value) =>
typeof value === 'bigint' ? value.toString() : value
))
}
export type MintBalance = {
mintUrl: string
balances: {
@@ -148,10 +155,13 @@ export const MintProofsCounterModel = types
return self.meltCounterValues.get(key)!.counterAtMelt
}
// Serialize MeltPreview to handle BigInt values
const serializableMeltPreview = meltPreview ? serializeMeltPreview(meltPreview) : undefined
self.meltCounterValues.set(key, {
transactionId,
counterAtMelt: self.counter,
meltPreview,
meltPreview: serializableMeltPreview as any,
createdAt: new Date(),
})