1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

Mobile: Resolves #350: Open non-image resources in external application

This commit is contained in:
Laurent Cozic
2018-06-30 19:45:21 +01:00
parent 08ee939951
commit 2c6c20f44f
7 changed files with 25 additions and 1 deletions

View File

@ -35,6 +35,8 @@ const ImagePicker = require('react-native-image-picker');
const AlarmService = require('lib/services/AlarmService.js');
const { SelectDateTimeDialog } = require('lib/components/select-date-time-dialog.js');
import FileViewer from 'react-native-file-viewer';
class NoteScreenComponent extends BaseScreenComponent {
static navigationOptions(options) {
@ -131,6 +133,9 @@ class NoteScreenComponent extends BaseScreenComponent {
noteId: item.id,
});
}, 5);
} else if (item.type_ === BaseModel.TYPE_RESOURCE) {
const resourcePath = Resource.fullPath(item);
await FileViewer.open(resourcePath);
} else {
throw new Error(_('The Joplin mobile app does not currently support this type of link: %s', BaseModel.modelTypeToName(item.type_)));
}