fix(ui/components/ErrorBoundaryScreen): minor misspelling & update branding (#57)

Co-authored-by: PalmDevs <git@palmdevs.me>
Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>
This commit is contained in:
maxxus 2024-12-26 12:41:21 -06:00 • committed by GitHub
parent e0cea529f9
commit a71dd7d0eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 1 deletions

View file

@ -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)

View file

@ -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 }}>

View file

@ -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)!;