mirror of
https://github.com/KoalaSat/nostros.git
synced 2024-09-29 06:30:47 +00:00
Fix bug
This commit is contained in:
parent
3e4369aaa4
commit
9d70478d80
@ -15,4 +15,4 @@ export const defaultRelays = [
|
||||
]
|
||||
|
||||
export const REGEX_SOCKET_LINK =
|
||||
/((wss):\/\/)?([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?/i
|
||||
/^wss:\/\/.*\..*$/i
|
||||
|
@ -65,7 +65,7 @@ export const RelaysPage: React.FC = () => {
|
||||
}
|
||||
|
||||
const onPressAddRelay: () => void = () => {
|
||||
if ((addRelayInput.match(REGEX_SOCKET_LINK) ?? []).length > 0) {
|
||||
if (REGEX_SOCKET_LINK.test(addRelayInput)) {
|
||||
bottomSheetAddRef.current?.close()
|
||||
addRelayItem({
|
||||
url: addRelayInput,
|
||||
@ -100,7 +100,7 @@ export const RelaysPage: React.FC = () => {
|
||||
const renderItem: ListRenderItem<Relay> = ({ index, item }) => (
|
||||
<List.Item
|
||||
key={index}
|
||||
title={item.url.split('wss://')[1].split('/')[0]}
|
||||
title={item.url.split('wss://')[1]?.split('/')[0]}
|
||||
right={() => relayToggle(item)}
|
||||
onPress={() => {
|
||||
setSelectedRelay(item)
|
||||
@ -201,7 +201,7 @@ export const RelaysPage: React.FC = () => {
|
||||
</View>
|
||||
</View>
|
||||
<Divider style={styles.divider}/>
|
||||
<Text variant='titleLarge'>{selectedRelay?.url.split('wss://')[1].split('/')[0]}</Text>
|
||||
<Text variant='titleLarge'>{selectedRelay?.url.split('wss://')[1]?.split('/')[0]}</Text>
|
||||
</View>
|
||||
</RBSheet>
|
||||
</View>
|
||||
|
Loading…
Reference in New Issue
Block a user