Skip to content

Commit

Permalink
Refactor input handling for Electrum URI, remove unused callback
Browse files Browse the repository at this point in the history
  • Loading branch information
landabaso committed Oct 25, 2024
1 parent c1ef89f commit 529b234
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions app/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useCallback, useState } from "react";
import { ScrollView, Text, TextInput, View, ViewBase } from "react-native";
import { ScrollView, Text, TextInput, View } from "react-native";

import { networks } from "bitcoinjs-lib";
const network = networks.bitcoin;
Expand Down Expand Up @@ -52,12 +52,6 @@ export default function Home() {
setDiscovery(null);
}, [discovery]);

const onChangeElectrumURI = useCallback(async (electrumURI: string) => {
setElectrumURI(electrumURI);
try {
} catch (err) {}
}, []);

const fetch = useCallback(async () => {
if (discovery) {
setFetching(true);
Expand Down Expand Up @@ -89,7 +83,7 @@ export default function Home() {
<Text className="mt-1">Enter your Electrum node URI:</Text>
<TextInput
value={electrumURI}
onChangeText={onChangeElectrumURI}
onChangeText={setElectrumURI}
className="border border-gray-300 p-2 rounded-lg w-full mt-1 bg-white"
placeholder="e.g., ssl://electrum.example.com:50002"
/>
Expand Down

0 comments on commit 529b234

Please sign in to comment.