1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-11-03 14:53:10 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
sunnylqm
2024-08-01 11:00:39 +08:00
parent 5e89fb4a25
commit d666e8c0f3
3 changed files with 11 additions and 6 deletions

View File

@@ -290,10 +290,9 @@ export const PushyProvider = ({
);
const parseTestQrCode = useCallback(
(code: string) => {
let payload: PushyTestPayload;
(code: string | PushyTestPayload) => {
try {
payload = JSON.parse(code);
const payload = typeof code === 'string' ? JSON.parse(code) : code;
return parseTestPayload(payload);
} catch {
return false;