1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-30 10:36:35 +02:00

Mobile: Fixes #9863: Fix share to Joplin when only "All notes" has been opened (#9876)

Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
This commit is contained in:
Henry Heino 2024-02-08 08:54:23 -08:00 committed by GitHub
parent c163491371
commit 628877147e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -981,9 +981,13 @@ class AppComponent extends React.Component {
if (sharedData) {
reg.logger().info('Received shared data');
if (this.props.selectedFolderId) {
// selectedFolderId can be null if no screens other than "All notes"
// have been opened.
const targetFolder = this.props.selectedFolderId ?? (await Folder.defaultFolder())?.id;
if (targetFolder) {
logger.info('Sharing: handleShareData: Processing...');
await handleShared(sharedData, this.props.selectedFolderId, this.props.dispatch);
await handleShared(sharedData, targetFolder, this.props.dispatch);
} else {
reg.logger().info('Cannot handle share - default folder id is not set');
}