[Hotfix] Fix iOS crash with RDT setting

This commit is contained in:
Beef 2023-01-10 23:44:39 +00:00 committed by GitHub
parent 93c4eef678
commit 0ee50404a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,6 @@ import logger from "@lib/logger";
import AssetDisplay from "@ui/settings/components/AssetDisplay"; import AssetDisplay from "@ui/settings/components/AssetDisplay";
const { FormSection, FormRow, FormInput, FormDivider } = Forms; const { FormSection, FormRow, FormInput, FormDivider } = Forms;
const { connectToDevTools } = window.__vendetta_rdc;
const styles = stylesheet.createThemedStyleSheet({ const styles = stylesheet.createThemedStyleSheet({
search: { search: {
@ -45,13 +44,13 @@ export default function Developer() {
onPress={() => connectToDebugger(debuggerUrl)} onPress={() => connectToDebugger(debuggerUrl)}
/> />
<FormDivider /> <FormDivider />
{connectToDevTools && <FormRow {window.__vendetta_rdc && <FormRow
label="Connect to React DevTools" label="Connect to React DevTools"
leading={() => <FormRow.Icon source={getAssetIDByName("ic_badge_staff")} />} leading={() => <FormRow.Icon source={getAssetIDByName("ic_badge_staff")} />}
trailing={FormRow.Arrow} trailing={FormRow.Arrow}
onPress={() => { onPress={() => {
try { try {
connectToDevTools({ window.__vendetta_rdc?.connectToDevTools({
host: debuggerUrl.split(":")[0], host: debuggerUrl.split(":")[0],
resolveRNStyle: RN.StyleSheet.flatten, resolveRNStyle: RN.StyleSheet.flatten,
}); });