You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-16 00:14:34 +02:00
This commit is contained in:
@ -3,6 +3,7 @@ import shim from '@joplin/lib/shim';
|
||||
|
||||
import Note from '@joplin/lib/models/Note';
|
||||
import checkPermissions from './checkPermissions.js';
|
||||
import NavService from '@joplin/lib/services/NavService';
|
||||
const { ToastAndroid } = require('react-native');
|
||||
const { PermissionsAndroid } = require('react-native');
|
||||
const { Platform } = require('react-native');
|
||||
@ -27,27 +28,21 @@ export default async (sharedData: SharedData, folderId: string, dispatch: Functi
|
||||
}
|
||||
}
|
||||
|
||||
const newNote = await Note.save({
|
||||
parent_id: folderId,
|
||||
}, { provisional: true });
|
||||
|
||||
// This is a bit hacky, but the surest way to go to
|
||||
// the needed note. We go back one screen in case there's
|
||||
// already a note open - if we don't do this, the dispatch
|
||||
// below will do nothing (because routeName wouldn't change)
|
||||
// Then we wait a bit for the state to be set correctly, and
|
||||
// finally we go to the new note.
|
||||
dispatch({ type: 'NAV_BACK' });
|
||||
|
||||
await NavService.go('Notes', { folderId, clearHistory: true });
|
||||
dispatch({ type: 'SIDE_MENU_CLOSE' });
|
||||
|
||||
const newNote = await Note.save({
|
||||
parent_id: folderId,
|
||||
}, { provisional: true });
|
||||
|
||||
shim.setTimeout(() => {
|
||||
dispatch({
|
||||
type: 'NAV_GO',
|
||||
routeName: 'Note',
|
||||
noteId: newNote.id,
|
||||
sharedData: sharedData,
|
||||
});
|
||||
shim.setTimeout(async () => {
|
||||
await NavService.go('Note', { noteId: newNote.id, sharedData });
|
||||
|
||||
ShareExtension.close();
|
||||
}, 5);
|
||||
|
Reference in New Issue
Block a user