Skip to content

Commit

Permalink
fix(ui/components/ErrorBoundaryScreen): minor misspelling & update br…
Browse files Browse the repository at this point in the history
…anding (#57)

Co-authored-by: PalmDevs <git@palmdevs.me>
Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>
  • Loading branch information
3 people authored Dec 26, 2024
1 parent e0cea52 commit a71dd7d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [1.5.3](https://github.com/revenge-mod/revenge-bundle/compare/v1.5.2...v1.5.3) (2024-12-05)


* backport iOS invalid element type crash fix ([afacfa0](https://github.com/revenge-mod/revenge-bundle/commit/afacfa06480f60d461840a211c09abb363dc8546))

## [1.5.3-dev.1](https://github.com/revenge-mod/revenge-bundle/compare/v1.5.2...v1.5.3-dev.1) (2024-11-24)


Expand Down
2 changes: 1 addition & 1 deletion src/core/ui/reporter/components/ErrorBoundaryScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function ErrorBoundaryScreen(props: {
<SafeAreaView style={styles.container}>
<View style={{ gap: 4 }}>
<Text variant="display-lg">Uh oh.</Text>
<Text variant="text-md/normal">A crash occured while rendering a component. This could be caused by a plugin, Bunny or Discord itself.</Text>
<Text variant="text-md/normal">A crash occurred while rendering a component. This could be caused by a plugin, Revenge or Discord itself.</Text>
<Text variant="text-sm/normal" color="text-muted">{debugInfo.os.name}; {debugInfo.discord.build} ({debugInfo.discord.version}); {debugInfo.bunny.version}</Text>
</View>
<ScrollView fadingEdgeLength={64} contentContainerStyle={{ gap: 12 }}>
Expand Down
6 changes: 6 additions & 0 deletions src/lib/api/react/jsx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ export function deleteJsxCreate(Component: string, callback: Callback) {
*/
export function patchJsx() {
const callback = ([Component]: unknown[], ret: JSX.Element) => {
// Band-aid fix for iOS invalid element type crashes
if (typeof ret.type === 'undefined') {
ret.type = 'RCTView'
return ret
}

// The check could be more complex, but this is fine for now to avoid overhead
if (typeof Component === "function" && callbacks.has(Component.name)) {
const cbs = callbacks.get(Component.name)!;
Expand Down

0 comments on commit a71dd7d

Please sign in to comment.