remove react-native-get-random-values (#87)

swap in react-native-uuid, which is a js-only impl of uuid without native requirements
This commit is contained in:
austinried
2022-04-06 01:22:05 +09:00
committed by GitHub
parent caf544069e
commit ecb706310b
4 changed files with 11 additions and 26 deletions

View File

@@ -9,7 +9,7 @@ import { useNavigation } from '@react-navigation/native'
import md5 from 'md5'
import React, { useCallback, useState } from 'react'
import { StyleSheet, Text, TextInput, View, ViewStyle } from 'react-native'
import { v4 as uuidv4 } from 'uuid'
import uuid from 'react-native-uuid'
import SettingsSwitch from '@app/components/SettingsSwitch'
const PASSWORD_PLACEHOLDER = 'PASSWORD_PLACEHOLDER'
@@ -57,7 +57,7 @@ const ServerView: React.FC<{
const createServer = useCallback<() => Server>(() => {
if (usePlainPassword) {
return {
id: server?.id || uuidv4(),
id: server?.id || (uuid.v4() as string),
usePlainPassword,
plainPassword: password,
address,
@@ -72,12 +72,12 @@ const ServerView: React.FC<{
salt = server.salt
token = server.token
} else {
salt = uuidv4()
salt = uuid.v4() as string
token = md5(password + salt)
}
return {
id: server?.id || uuidv4(),
id: server?.id || (uuid.v4() as string),
address,
username,
usePlainPassword,