-
-
Notifications
You must be signed in to change notification settings - Fork 666
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
redux: Various small prep changes for multi-org support #5016
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b2c3cb9
typing-status tests [nfc]: Cut a redundant reference to GlobalState
gnprice 1cc2833
accounts [nfc]: Cut unused tryGetCurrentRealm
gnprice 217ee25
presence [nfc]: Strength-reduce an Auth to a boolean hasAuth
gnprice 46532fc
presence [nfc]: Drop a tryGetAuth for plain getAuth, like other actions
gnprice a1f0dde
account [nfc]: Strength-reduce various getActiveAccount calls
gnprice 9dfdcc4
outbox [nfc]: Unexport trySendMessages
gnprice e26539c
presence [nfc]: Make choice of newUserInput explicit; add TODO
gnprice 838133a
redux [nfc]: Drop some redundant Dispatch / GetState annotations
gnprice e6d81b8
redux types [nfc]: Inline away GetState
gnprice ebbd1ca
sharing [nfc]: Stop taking `dispatch`, no longer used here
gnprice cafeebe
redux types [nfc]: Cut disused PlainDispatch
gnprice 41848b3
MessageList [nfc]: Mark OuterProps read-only
gnprice e19f9cd
react-redux types: Add more $ReadOnly
gnprice File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
import { NativeModules, DeviceEventEmitter, Platform } from 'react-native'; | ||
|
||
import * as NavigationService from '../nav/NavigationService'; | ||
import type { Dispatch, GetState } from '../types'; | ||
import type { SharedData } from './types'; | ||
import { navigateToSharing } from '../actions'; | ||
|
||
|
@@ -12,25 +11,20 @@ const Sharing = NativeModules.Sharing ?? { | |
null, | ||
}; | ||
|
||
const goToSharing = (data: SharedData) => (dispatch: Dispatch, getState: GetState) => { | ||
const goToSharing = (data: SharedData) => { | ||
NavigationService.dispatch(navigateToSharing(data)); | ||
}; | ||
|
||
export const handleInitialShare = async (dispatch: Dispatch) => { | ||
export const handleInitialShare = async () => { | ||
const initialSharedData: SharedData | null = await Sharing.readInitialSharedContent(); | ||
if (initialSharedData !== null) { | ||
dispatch(goToSharing(initialSharedData)); | ||
goToSharing(initialSharedData); | ||
} | ||
}; | ||
|
||
export class ShareReceivedListener { | ||
dispatch: Dispatch; | ||
unsubs: Array<() => void> = []; | ||
|
||
constructor(dispatch: Dispatch) { | ||
this.dispatch = dispatch; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This is great!! |
||
} | ||
|
||
/** Private. */ | ||
listen(name: string, handler: (...empty) => void | Promise<void>) { | ||
if (Platform.OS === 'android') { | ||
|
@@ -47,7 +41,7 @@ export class ShareReceivedListener { | |
} | ||
|
||
handleShareReceived: SharedData => void = data => { | ||
this.dispatch(goToSharing(data)); | ||
goToSharing(data); | ||
}; | ||
|
||
/** Start listening. Don't call twice without intervening `stop`. */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Wow, really? Nice!