Skip to content

Commit

Permalink
fix(app): add iOS crash fix back
Browse files Browse the repository at this point in the history
  • Loading branch information
PalmDevs committed Dec 11, 2024
1 parent 7dd6b31 commit 0fd85f3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libraries/app/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { React, ReactNative } from '@revenge-mod/modules/common'
import { findByName } from '@revenge-mod/modules/finders'
import { BundleUpdaterManager } from '@revenge-mod/modules/native'
import { createPatcherInstance } from '@revenge-mod/patcher'
import { ReactJSXLibrary } from '@revenge-mod/react/jsx'
import { createLogger } from '@revenge-mod/utils/library'

import type { Component, FC, ReactNode } from 'react'
Expand Down Expand Up @@ -68,6 +69,12 @@ const unpatchCreateElement = patcher.after(
const afterErrorBoundaryPatchable = ReactNative.Platform.OS === 'ios' ? afterAppRender : afterAppInitialize

afterErrorBoundaryPatchable(async function patchErrorBoundary() {
// Patching ErrorBoundary causes the weird "Element type is invalid" error due to TextInputWrapper's children being undefined
// The reason for it being undefined is unknown, but it's not a problem on Android
// Using this patch on Android also breaks how the chat input bar avoids the keyboard
if (ReactNative.Platform.OS === 'ios')
ReactJSXLibrary.afterElementCreate('PortalKeyboardPlaceholderInner', () => null)

const { default: Screen } = await import('./components/ErrorBoundaryScreen')

setImmediate(() => {
Expand Down

0 comments on commit 0fd85f3

Please sign in to comment.