mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Replace crypto-js
with expo-crypto
This commit is contained in:
parent
b5f267e6bf
commit
97442b31db
@ -15,11 +15,11 @@
|
|||||||
"@react-navigation/native": "^5.8.10",
|
"@react-navigation/native": "^5.8.10",
|
||||||
"@reduxjs/toolkit": "^1.5.0",
|
"@reduxjs/toolkit": "^1.5.0",
|
||||||
"axios": "^0.21.0",
|
"axios": "^0.21.0",
|
||||||
"crypto-js": "^3.3.0",
|
|
||||||
"expo": "^40.0.0",
|
"expo": "^40.0.0",
|
||||||
"expo-auth-session": "~3.0.0",
|
"expo-auth-session": "~3.0.0",
|
||||||
"expo-av": "~8.7.0",
|
"expo-av": "~8.7.0",
|
||||||
"expo-blur": "~8.2.2",
|
"expo-blur": "~8.2.2",
|
||||||
|
"expo-crypto": "~8.4.0",
|
||||||
"expo-image-picker": "~9.2.0",
|
"expo-image-picker": "~9.2.0",
|
||||||
"expo-linear-gradient": "~8.4.0",
|
"expo-linear-gradient": "~8.4.0",
|
||||||
"expo-linking": "~2.0.0",
|
"expo-linking": "~2.0.0",
|
||||||
|
@ -20,7 +20,7 @@ import {
|
|||||||
} from 'react-native'
|
} from 'react-native'
|
||||||
import { SafeAreaView } from 'react-native-safe-area-context'
|
import { SafeAreaView } from 'react-native-safe-area-context'
|
||||||
import { createNativeStackNavigator } from 'react-native-screens/native-stack'
|
import { createNativeStackNavigator } from 'react-native-screens/native-stack'
|
||||||
import sha256 from 'crypto-js/sha256'
|
import * as Crypto from 'expo-crypto'
|
||||||
|
|
||||||
import { store } from '@root/store'
|
import { store } from '@root/store'
|
||||||
import ComposeRoot from '@screens/Shared/Compose/Root'
|
import ComposeRoot from '@screens/Shared/Compose/Root'
|
||||||
@ -464,7 +464,8 @@ const Compose: React.FC<Props> = ({ route: { params }, navigation }) => {
|
|||||||
instance: 'local',
|
instance: 'local',
|
||||||
url: 'statuses',
|
url: 'statuses',
|
||||||
headers: {
|
headers: {
|
||||||
'Idempotency-Key': sha256(
|
'Idempotency-Key': await Crypto.digestStringAsync(
|
||||||
|
Crypto.CryptoDigestAlgorithm.SHA256,
|
||||||
composeState.spoiler.raw +
|
composeState.spoiler.raw +
|
||||||
composeState.text.raw +
|
composeState.text.raw +
|
||||||
composeState.poll.options['0'] +
|
composeState.poll.options['0'] +
|
||||||
@ -477,7 +478,7 @@ const Compose: React.FC<Props> = ({ route: { params }, navigation }) => {
|
|||||||
composeState.attachments.uploads.map(upload => upload.id) +
|
composeState.attachments.uploads.map(upload => upload.id) +
|
||||||
composeState.visibility +
|
composeState.visibility +
|
||||||
(params?.type === 'edit' ? Math.random() : '')
|
(params?.type === 'edit' ? Math.random() : '')
|
||||||
).toString()
|
)
|
||||||
},
|
},
|
||||||
body: formData
|
body: formData
|
||||||
})
|
})
|
||||||
|
@ -2390,11 +2390,6 @@ cross-spawn@^6.0.0, cross-spawn@^6.0.5:
|
|||||||
shebang-command "^1.2.0"
|
shebang-command "^1.2.0"
|
||||||
which "^1.2.9"
|
which "^1.2.9"
|
||||||
|
|
||||||
crypto-js@^3.3.0:
|
|
||||||
version "3.3.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-3.3.0.tgz#846dd1cce2f68aacfa156c8578f926a609b7976b"
|
|
||||||
integrity sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q==
|
|
||||||
|
|
||||||
css-select@^2.1.0:
|
css-select@^2.1.0:
|
||||||
version "2.1.0"
|
version "2.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/css-select/-/css-select-2.1.0.tgz#6a34653356635934a81baca68d0255432105dbef"
|
resolved "https://registry.yarnpkg.com/css-select/-/css-select-2.1.0.tgz#6a34653356635934a81baca68d0255432105dbef"
|
||||||
@ -2832,7 +2827,7 @@ expo-constants@^9.3.3, expo-constants@~9.3.3:
|
|||||||
fbjs "1.0.0"
|
fbjs "1.0.0"
|
||||||
uuid "^3.3.2"
|
uuid "^3.3.2"
|
||||||
|
|
||||||
expo-crypto@^8.4.0:
|
expo-crypto@^8.4.0, expo-crypto@~8.4.0:
|
||||||
version "8.4.0"
|
version "8.4.0"
|
||||||
resolved "https://registry.yarnpkg.com/expo-crypto/-/expo-crypto-8.4.0.tgz#59a5b0640bb39db93e6857feafa2c9514b172cef"
|
resolved "https://registry.yarnpkg.com/expo-crypto/-/expo-crypto-8.4.0.tgz#59a5b0640bb39db93e6857feafa2c9514b172cef"
|
||||||
integrity sha512-EHEFx5sHTDVIuQH8/juuecQWj1uQ7ClM98fKXPFcNYcBlYSCQvkik37hwfJC5WLcVnelFDpvZJmHxiTfB5GKCg==
|
integrity sha512-EHEFx5sHTDVIuQH8/juuecQWj1uQ7ClM98fKXPFcNYcBlYSCQvkik37hwfJC5WLcVnelFDpvZJmHxiTfB5GKCg==
|
||||||
|
Loading…
x
Reference in New Issue
Block a user