From 2ed61309769485005a42766005f8ed3de9f3c1f6 Mon Sep 17 00:00:00 2001 From: minibits-cash Date: Sat, 10 Jan 2026 00:27:59 +0100 Subject: [PATCH] Patch modal to prevent warnings --- patches/react-native-modal+14.0.0-rc.1.patch | 54 ++++++++++++++++++++ src/models/Mint.ts | 12 ++++- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 patches/react-native-modal+14.0.0-rc.1.patch diff --git a/patches/react-native-modal+14.0.0-rc.1.patch b/patches/react-native-modal+14.0.0-rc.1.patch new file mode 100644 index 00000000..a70b24c7 --- /dev/null +++ b/patches/react-native-modal+14.0.0-rc.1.patch @@ -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) { diff --git a/src/models/Mint.ts b/src/models/Mint.ts index 1978078f..655865b9 100644 --- a/src/models/Mint.ts +++ b/src/models/Mint.ts @@ -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(), })