-
-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mobile: Support accepting Joplin shares #10300
Mobile: Support accepting Joplin shares #10300
Conversation
| }, [invitation]); | ||
|
|
||
| const sharer = invitation.share.user; | ||
| if (!sharer) return <Text>Error: Share missing user</Text>; // Should not happen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if (!sharer) return <Text>Error: Share missing user</Text>; // Should not happen |
This check might not be necessary. It was added because invitation.share.user is marked as optional in the type StateShare.
| @@ -379,6 +380,7 @@ async function setupDatabase(id: number = null, options: any = null) { | |||
| await clearSettingFile(id); | |||
| await loadKeychainServiceAndSettings(options.keychainEnabled ? KeychainServiceDriver : KeychainServiceDriverDummy); | |||
|
|
|||
| reg.setDb(databases_[id]); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this change, reg.scheduleSync logs a warning related to a missing database during tests.
Summary
This pull request does two things:
ScreenHeadercomponent, which is a connected Redux component. To allow testing this, a small amount of refactoring was required.ShareServicewas moved out ofShareService.test.tsxand intopackages/lib/testing/share/mockShareService.tsto allow using it for tests for the new mobile UI.Note
A large part of the changes made in this pull request are only related to tests. These changes are made in 0c702e7 and can be moved to a separate pull request or discarded on request.
Screenshots
iOS:

Android:

Testing plan
This pull request has automated tests, but they don't cover all cases. As such, this pull request has also been tested manually by:
self@localhostandself2@localhost)self2@localhosttoself@localhostself@localhostThis has been tested successfully on an Android 7 device. (More limited testing was done on iOS).