1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Mobile: Upgrade to React Native 0.77 (#12179)

This commit is contained in:
Henry Heino
2025-05-19 15:02:18 -07:00
committed by GitHub
parent cbf6d5506f
commit a4dacd65e6
38 changed files with 4191 additions and 3262 deletions

View File

@@ -1,5 +1,5 @@
import shim from '@joplin/lib/shim';
import DocumentPicker, { DocumentPickerResponse } from 'react-native-document-picker';
import { DocumentPickerResponse, pick, isErrorWithCode } from '@react-native-documents/picker';
import { openDocument } from '@joplin/react-native-saf-x';
import Logger from '@joplin/utils/Logger';
import type FsDriverWeb from './fs-driver/fs-driver-rn.web';
@@ -83,9 +83,9 @@ const pickDocument = async ({ multiple = false, preferCamera = false }: Options
} else {
let docPickerResult: DocumentPickerResponse[] = [];
if (multiple) {
docPickerResult = await DocumentPicker.pick({ allowMultiSelection: true });
docPickerResult = await pick({ allowMultiSelection: true });
} else {
docPickerResult = [await DocumentPicker.pickSingle()];
docPickerResult = await pick();
}
result = docPickerResult.map(r => {
@@ -98,7 +98,7 @@ const pickDocument = async ({ multiple = false, preferCamera = false }: Options
});
}
} catch (error) {
if (DocumentPicker?.isCancel?.(error) || error?.message?.includes('cancel')) {
if ((isErrorWithCode(error) && error.code === 'OPERATION_CANCELED') || error?.message?.includes('cancel')) {
logger.info('user has cancelled');
return [];
} else {