author
int64
658
755k
date
stringlengths
19
19
timezone
int64
-46,800
43.2k
hash
stringlengths
40
40
message
stringlengths
5
490
mods
list
language
stringclasses
20 values
license
stringclasses
3 values
repo
stringlengths
5
68
original_message
stringlengths
12
491
129,187
01.04.2020 15:42:13
14,400
a9c9027c7e7e588a4e48d566ef270d89349e042b
[native] Don't crash if ComposeThread parentThread invalidated
[ { "change_type": "MODIFY", "old_path": "native/chat/compose-thread.react.js", "new_path": "native/chat/compose-thread.react.js", "diff": "@@ -70,7 +70,7 @@ type NavProp = NavigationScreenProp<{|\n...NavigationLeafRoute,\nparams: {|\nthreadType?: ThreadType,\n- parentThreadID?: string,\n+ parentThreadInfo?: ThreadInfo,\ncreateButtonDisabled?: boolean,\n|},\n|}>;\n@@ -122,8 +122,9 @@ class ComposeThread extends React.PureComponent<Props, State> {\nstate: PropTypes.shape({\nkey: PropTypes.string.isRequired,\nparams: PropTypes.shape({\n- parentThreadID: PropTypes.string,\nthreadType: threadTypePropType,\n+ parentThreadInfo: threadInfoPropType,\n+ createButtonDisabled: PropTypes.bool,\n}).isRequired,\n}).isRequired,\nsetParams: PropTypes.func.isRequired,\n@@ -169,12 +170,30 @@ class ComposeThread extends React.PureComponent<Props, State> {\nsetOnPressCreateThread(null);\n}\n+ componentDidUpdate(prevProps: Props) {\n+ const oldReduxParentThreadInfo = prevProps.parentThreadInfo;\n+ const newReduxParentThreadInfo = this.props.parentThreadInfo;\n+ if (\n+ newReduxParentThreadInfo &&\n+ newReduxParentThreadInfo !== oldReduxParentThreadInfo\n+ ) {\n+ this.props.navigation.setParams({\n+ parentThreadInfo: newReduxParentThreadInfo,\n+ });\n+ }\n+ }\n+\n+ static getParentThreadInfo(props: { navigation: NavProp }): ?ThreadInfo {\n+ return props.navigation.state.params.parentThreadInfo;\n+ }\n+\nuserSearchResultsSelector = createSelector(\n(propsAndState: PropsAndState) => propsAndState.usernameInputText,\n(propsAndState: PropsAndState) => propsAndState.otherUserInfos,\n(propsAndState: PropsAndState) => propsAndState.userSearchIndex,\n(propsAndState: PropsAndState) => propsAndState.userInfoInputArray,\n- (propsAndState: PropsAndState) => propsAndState.parentThreadInfo,\n+ (propsAndState: PropsAndState) =>\n+ ComposeThread.getParentThreadInfo(propsAndState),\n(\ntext: string,\nuserInfos: { [id: string]: AccountUserInfo },\n@@ -196,7 +215,8 @@ class ComposeThread extends React.PureComponent<Props, State> {\n}\nexistingThreadsSelector = createSelector(\n- (propsAndState: PropsAndState) => propsAndState.parentThreadInfo,\n+ (propsAndState: PropsAndState) =>\n+ ComposeThread.getParentThreadInfo(propsAndState),\n(propsAndState: PropsAndState) => propsAndState.threadInfos,\n(propsAndState: PropsAndState) => propsAndState.userInfoInputArray,\n(\n@@ -252,17 +272,12 @@ class ComposeThread extends React.PureComponent<Props, State> {\n);\n}\nlet parentThreadRow = null;\n- const parentThreadID = this.props.navigation.getParam('parentThreadID');\n- if (parentThreadID) {\n- const parentThreadInfo = this.props.parentThreadInfo;\n- invariant(\n- parentThreadInfo,\n- `can't find ThreadInfo for parent ${parentThreadID}`,\n- );\n+ const parentThreadInfo = ComposeThread.getParentThreadInfo(this.props);\n+ if (parentThreadInfo) {\nconst threadType = this.props.navigation.getParam('threadType');\ninvariant(\nthreadType !== undefined && threadType !== null,\n- `no threadType provided for ${parentThreadID}`,\n+ `no threadType provided for ${parentThreadInfo.id}`,\n);\nconst threadVisibilityColor = this.props.colors.modalForegroundLabel;\nparentThreadRow = (\n@@ -385,15 +400,12 @@ class ComposeThread extends React.PureComponent<Props, State> {\nconst initialMemberIDs = this.state.userInfoInputArray.map(\n(userInfo: AccountUserInfo) => userInfo.id,\n);\n+ const parentThreadInfo = ComposeThread.getParentThreadInfo(this.props);\nreturn await this.props.newThread({\ntype: threadType,\n- parentThreadID: this.props.parentThreadInfo\n- ? this.props.parentThreadInfo.id\n- : null,\n+ parentThreadID: parentThreadInfo ? parentThreadInfo.id : null,\ninitialMemberIDs,\n- color: this.props.parentThreadInfo\n- ? this.props.parentThreadInfo.color\n- : null,\n+ color: parentThreadInfo ? parentThreadInfo.color : null,\n});\n} catch (e) {\nthis.createThreadPressed = false;\n@@ -504,14 +516,13 @@ registerFetchKey(searchUsersActionTypes);\nexport default connect(\n(state: AppState, ownProps: { navigation: NavProp }) => {\n- let parentThreadInfo = null;\n- const parentThreadID = ownProps.navigation.getParam('parentThreadID');\n- if (parentThreadID) {\n- parentThreadInfo = threadInfoSelector(state)[parentThreadID];\n- invariant(parentThreadInfo, 'parent thread should exist');\n+ let reduxParentThreadInfo = null;\n+ const parentThreadInfo = ownProps.navigation.state.params.parentThreadInfo;\n+ if (parentThreadInfo) {\n+ reduxParentThreadInfo = threadInfoSelector(state)[parentThreadInfo.id];\n}\nreturn {\n- parentThreadInfo,\n+ parentThreadInfo: reduxParentThreadInfo,\nloadingStatus: loadingStatusSelector(state),\notherUserInfos: userInfoSelectorForOtherMembersOfThread((null: ?string))(\nstate,\n" }, { "change_type": "MODIFY", "old_path": "native/chat/settings/compose-subthread-modal.react.js", "new_path": "native/chat/settings/compose-subthread-modal.react.js", "diff": "@@ -106,26 +106,26 @@ class ComposeSubthreadModal extends React.PureComponent<Props> {\n}\nonPressOpen = () => {\n- const threadID = this.props.navigation.state.params.threadInfo.id;\n+ const threadInfo = this.props.navigation.state.params.threadInfo;\nthis.props.navigation.navigate({\nrouteName: ComposeThreadRouteName,\nparams: {\nthreadType: threadTypes.CHAT_NESTED_OPEN,\n- parentThreadID: threadID,\n+ parentThreadInfo: threadInfo,\n},\n- key: `${ComposeThreadRouteName}|${threadID}|${threadTypes.CHAT_NESTED_OPEN}`,\n+ key: `${ComposeThreadRouteName}|${threadInfo.id}|${threadTypes.CHAT_NESTED_OPEN}`,\n});\n};\nonPressSecret = () => {\n- const threadID = this.props.navigation.state.params.threadInfo.id;\n+ const threadInfo = this.props.navigation.state.params.threadInfo;\nthis.props.navigation.navigate({\nrouteName: ComposeThreadRouteName,\nparams: {\nthreadType: threadTypes.CHAT_SECRET,\n- parentThreadID: threadID,\n+ parentThreadInfo: threadInfo,\n},\n- key: `${ComposeThreadRouteName}|${threadID}|${threadTypes.CHAT_SECRET}`,\n+ key: `${ComposeThreadRouteName}|${threadInfo.id}|${threadTypes.CHAT_SECRET}`,\n});\n};\n}\n" }, { "change_type": "MODIFY", "old_path": "native/utils/navigation-utils.js", "new_path": "native/utils/navigation-utils.js", "diff": "@@ -85,13 +85,20 @@ function getThreadIDFromParams(params: ?NavigationParams): string {\n}\nfunction getParentThreadIDFromParams(params: ?NavigationParams): ?string {\n+ if (!params) {\n+ return undefined;\n+ }\n+ const { parentThreadInfo } = params;\n+ if (!parentThreadInfo) {\n+ return undefined;\n+ }\ninvariant(\n- params &&\n- (typeof params.parentThreadID === 'string' ||\n- (typeof params.parentThreadID === 'object' && !params.parentThreadID)),\n+ typeof parentThreadInfo === 'object' &&\n+ parentThreadInfo.id &&\n+ typeof parentThreadInfo.id === 'string',\n\"there's no way in react-navigation/Flow to type this\",\n);\n- return params.parentThreadID;\n+ return parentThreadInfo.id;\n}\nfunction getThreadIDFromRoute(\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Don't crash if ComposeThread parentThread invalidated
129,187
01.04.2020 18:16:22
14,400
20643d8afe703011bb49ef44b7e6e8e8411cd8ac
Fix up ThreadChanges type
[ { "change_type": "MODIFY", "old_path": "lib/types/thread-types.js", "new_path": "lib/types/thread-types.js", "diff": "@@ -283,18 +283,14 @@ export type LeaveThreadPayload = {|\nthreadID: string,\n|};\n-export type ThreadChanges = {\n- type?: ?ThreadType,\n- name?: ?string,\n- description?: ?string,\n- color?: ?string,\n- parentThreadID?: ?string,\n- newMemberIDs?: ?$ReadOnlyArray<string>,\n- // This type should be exact\n- // https://github.com/facebook/flow/issues/2386\n- // https://github.com/facebook/flow/issues/2405\n- [any]: empty,\n-};\n+export type ThreadChanges = $Shape<{|\n+ type: ThreadType,\n+ name: string,\n+ description: string,\n+ color: string,\n+ parentThreadID: string,\n+ newMemberIDs: $ReadOnlyArray<string>,\n+|}>;\nexport type UpdateThreadRequest = {|\nthreadID: string,\n" }, { "change_type": "MODIFY", "old_path": "web/modals/threads/thread-settings-modal.react.js", "new_path": "web/modals/threads/thread-settings-modal.react.js", "diff": "@@ -364,7 +364,7 @@ class ThreadSettingsModal extends React.PureComponent<Props, State> {\nonChangeName = (event: SyntheticEvent<HTMLInputElement>) => {\nconst target = event.currentTarget;\nconst newValue =\n- target.value !== this.props.threadInfo.name ? target.value : null;\n+ target.value !== this.props.threadInfo.name ? target.value : undefined;\nthis.setState((prevState: State) => ({\n...prevState,\nqueuedChanges: {\n@@ -377,7 +377,9 @@ class ThreadSettingsModal extends React.PureComponent<Props, State> {\nonChangeDescription = (event: SyntheticEvent<HTMLTextAreaElement>) => {\nconst target = event.currentTarget;\nconst newValue =\n- target.value !== this.props.threadInfo.description ? target.value : null;\n+ target.value !== this.props.threadInfo.description\n+ ? target.value\n+ : undefined;\nthis.setState((prevState: State) => ({\n...prevState,\nqueuedChanges: {\n@@ -388,7 +390,7 @@ class ThreadSettingsModal extends React.PureComponent<Props, State> {\n};\nonChangeColor = (color: string) => {\n- const newValue = color !== this.props.threadInfo.color ? color : null;\n+ const newValue = color !== this.props.threadInfo.color ? color : undefined;\nthis.setState((prevState: State) => ({\n...prevState,\nqueuedChanges: {\n@@ -400,7 +402,8 @@ class ThreadSettingsModal extends React.PureComponent<Props, State> {\nonChangeThreadType = (event: SyntheticEvent<HTMLInputElement>) => {\nconst uiValue = assertThreadType(parseInt(event.currentTarget.value, 10));\n- const newValue = uiValue !== this.props.threadInfo.type ? uiValue : null;\n+ const newValue =\n+ uiValue !== this.props.threadInfo.type ? uiValue : undefined;\nthis.setState((prevState: State) => ({\n...prevState,\nqueuedChanges: {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Fix up ThreadChanges type
129,187
01.04.2020 19:05:34
14,400
4f290919fa401dd007205c566184b1ee59c4bfef
[lib] Still show thread creation message even if the parent is secret
[ { "change_type": "MODIFY", "old_path": "lib/shared/message-utils.js", "new_path": "lib/shared/message-utils.js", "diff": "@@ -233,9 +233,6 @@ function createMessageInfo(\nlet parentThreadInfo = null;\nif (initialParentThreadID) {\nparentThreadInfo = threadInfos[initialParentThreadID];\n- if (!parentThreadInfo) {\n- return null;\n- }\n}\nreturn {\ntype: messageTypes.CREATE_THREAD,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Still show thread creation message even if the parent is secret
129,187
01.04.2020 19:07:25
14,400
91e2edeb1a23c9273d47635fee983437845e46cf
[native] CLEAR_INVALIDATED_THREADS -> CLEAR_THREADS
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-router.js", "new_path": "native/chat/chat-router.js", "diff": "@@ -29,15 +29,15 @@ type ReplaceWithThreadAction = {|\n+type: 'REPLACE_WITH_THREAD',\n+threadInfo: ThreadInfo,\n|};\n-type ClearInvalidatedThreadsAction = {|\n- +type: 'CLEAR_INVALIDATED_THREADS',\n+type ClearThreadsAction = {|\n+ +type: 'CLEAR_THREADS',\n+threadIDs: $ReadOnlyArray<string>,\n|};\nexport type ChatRouterNavigationAction =\n| NavigationAction\n| ClearScreensAction\n| ReplaceWithThreadAction\n- | ClearInvalidatedThreadsAction;\n+ | ClearThreadsAction;\nconst defaultConfig = Object.freeze({});\nfunction ChatRouter(\n@@ -83,7 +83,7 @@ function ChatRouter(\nparams: { threadInfo },\n});\nreturn stackRouter.getStateForAction(navigateAction, clearedState);\n- } else if (action.type === 'CLEAR_INVALIDATED_THREADS') {\n+ } else if (action.type === 'CLEAR_THREADS') {\nconst threadIDs = new Set(action.threadIDs);\nif (!lastState) {\nreturn lastState;\n@@ -113,8 +113,8 @@ function ChatRouter(\ntype: 'REPLACE_WITH_THREAD',\nthreadInfo,\n}),\n- clearInvalidatedThreads: (threadIDs: $ReadOnlyArray<string>) => ({\n- type: 'CLEAR_INVALIDATED_THREADS',\n+ clearThreads: (threadIDs: $ReadOnlyArray<string>) => ({\n+ type: 'CLEAR_THREADS',\nthreadIDs,\n}),\n}),\n" }, { "change_type": "MODIFY", "old_path": "native/chat/chat.react.js", "new_path": "native/chat/chat.react.js", "diff": "@@ -43,7 +43,7 @@ import ThreadScreenPruner from './thread-screen-pruner.react';\ntype NavigationProp = NavigationStackProp<NavigationState> & {\nclearScreens: (routeNames: $ReadOnlyArray<string>) => void,\nreplaceWithThread: (threadInfo: ThreadInfo) => void,\n- clearInvalidatedThreads: (threadIDs: $ReadOnlyArray<string>) => void,\n+ clearThreads: (threadIDs: $ReadOnlyArray<string>) => void,\n};\ntype Props = {| navigation: NavigationProp |};\ntype StackViewProps = React.ElementConfig<typeof StackView> & {\n" }, { "change_type": "MODIFY", "old_path": "native/chat/thread-screen-pruner.react.js", "new_path": "native/chat/thread-screen-pruner.react.js", "diff": "@@ -68,7 +68,7 @@ function ThreadScreenPruner() {\n);\n}\nnavContext.dispatch({\n- type: 'CLEAR_INVALIDATED_THREADS',\n+ type: 'CLEAR_THREADS',\nthreadIDs: pruneThreadIDs,\n});\n}, [pruneThreadIDs, navContext, activeThreadID]);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] CLEAR_INVALIDATED_THREADS -> CLEAR_THREADS
129,187
01.04.2020 19:08:32
14,400
83b9afc92867cc2ab9d76431e247609467b3b9cb
[native] Allow ThreadEntity to handle missing thread
[ { "change_type": "MODIFY", "old_path": "native/chat/robotext-message.react.js", "new_path": "native/chat/robotext-message.react.js", "diff": "@@ -16,6 +16,7 @@ import * as React from 'react';\nimport { Text, TouchableWithoutFeedback, View } from 'react-native';\nimport PropTypes from 'prop-types';\nimport Hyperlink from 'react-native-hyperlink';\n+import invariant from 'invariant';\nimport {\nmessageKey,\n@@ -139,7 +140,7 @@ type InnerThreadEntityProps = {\nid: string,\nname: string,\n// Redux state\n- threadInfo: ThreadInfo,\n+ threadInfo: ?ThreadInfo,\nstyles: Styles,\n// Redux dispatch functions\ndispatch: Dispatch,\n@@ -148,12 +149,15 @@ class InnerThreadEntity extends React.PureComponent<InnerThreadEntityProps> {\nstatic propTypes = {\nid: PropTypes.string.isRequired,\nname: PropTypes.string.isRequired,\n- threadInfo: threadInfoPropType.isRequired,\n+ threadInfo: threadInfoPropType,\nstyles: PropTypes.objectOf(PropTypes.object).isRequired,\ndispatch: PropTypes.func.isRequired,\n};\nrender() {\n+ if (!this.props.threadInfo) {\n+ return <Text>{this.props.name}</Text>;\n+ }\nreturn (\n<Text style={this.props.styles.link} onPress={this.onPressThread}>\n{this.props.name}\n@@ -163,6 +167,7 @@ class InnerThreadEntity extends React.PureComponent<InnerThreadEntityProps> {\nonPressThread = () => {\nconst { threadInfo, dispatch } = this.props;\n+ invariant(threadInfo, 'onPressThread should have threadInfo');\ndispatch({\ntype: 'Navigation/NAVIGATE',\nrouteName: MessageListRouteName,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Allow ThreadEntity to handle missing thread
129,187
01.04.2020 19:09:42
14,400
b878fbeff00235a181ea293444b7c6822a0e21d0
[server] updatesForCurrentSession: "return" for thread leave/delete
[ { "change_type": "MODIFY", "old_path": "server/src/deleters/thread-deleters.js", "new_path": "server/src/deleters/thread-deleters.js", "diff": "@@ -114,7 +114,7 @@ async function deleteThread(\n}\nconst [{ viewerUpdates }] = await Promise.all([\n- createUpdates(updateDatas, { viewer }),\n+ createUpdates(updateDatas, { viewer, updatesForCurrentSession: 'return' }),\ndbQuery(query),\n]);\n" }, { "change_type": "MODIFY", "old_path": "server/src/updaters/thread-permission-updaters.js", "new_path": "server/src/updaters/thread-permission-updaters.js", "diff": "@@ -577,6 +577,7 @@ async function commitMembershipChangeset(\nviewer,\ncalendarQuery,\n...threadInfoFetchResult,\n+ updatesForCurrentSession: 'return',\n});\nreturn {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] updatesForCurrentSession: "return" for thread leave/delete
129,187
01.04.2020 19:10:30
14,400
96899ecb1a6771368efde2e2d45965c0f0c017ef
Don't treat user-driven leave/delete thread as invalidation
[ { "change_type": "MODIFY", "old_path": "lib/shared/thread-utils.js", "new_path": "lib/shared/thread-utils.js", "diff": "@@ -251,6 +251,19 @@ function memberIsAdmin(memberInfo: RelativeMemberInfo, threadInfo: ThreadInfo) {\nreturn role && !role.isDefault && role.name === 'Admins';\n}\n+function identifyInvalidatedThreads(\n+ prevThreadInfos: { [id: string]: RawThreadInfo },\n+ newThreadInfos: { [id: string]: RawThreadInfo },\n+): Set<string> {\n+ const invalidated = new Set();\n+ for (let threadID in prevThreadInfos) {\n+ if (!newThreadInfos[threadID]) {\n+ invalidated.add(threadID);\n+ }\n+ }\n+ return invalidated;\n+}\n+\nexport {\ncolorIsDark,\ngenerateRandomColor,\n@@ -269,4 +282,5 @@ export {\nthreadTypeDescriptions,\nusersInThreadInfo,\nmemberIsAdmin,\n+ identifyInvalidatedThreads,\n};\n" }, { "change_type": "MODIFY", "old_path": "native/chat/settings/delete-thread.react.js", "new_path": "native/chat/settings/delete-thread.react.js", "diff": "@@ -9,6 +9,8 @@ import {\ntype ThreadInfo,\nthreadInfoPropType,\ntype LeaveThreadPayload,\n+ type RawThreadInfo,\n+ rawThreadInfoPropType,\n} from 'lib/types/thread-types';\nimport { type GlobalTheme, globalThemePropType } from '../../types/themes';\nimport type { Styles } from '../../types/styles';\n@@ -33,6 +35,7 @@ import {\n} from 'lib/actions/thread-actions';\nimport { createLoadingStatusSelector } from 'lib/selectors/loading-selectors';\nimport { threadInfoSelector } from 'lib/selectors/thread-selectors';\n+import { identifyInvalidatedThreads } from 'lib/shared/thread-utils';\nimport Button from '../../components/button.react';\nimport OnePasswordButton from '../../components/one-password-button.react';\n@@ -42,6 +45,11 @@ import {\ncolorsSelector,\nstyleSelector,\n} from '../../themes/colors';\n+import {\n+ withNavContext,\n+ type NavContextType,\n+ navContextPropType,\n+} from '../../navigation/navigation-context';\ntype NavProp = {\nstate: { params: { threadInfo: ThreadInfo } },\n@@ -55,6 +63,7 @@ type Props = {|\nactiveTheme: ?GlobalTheme,\ncolors: Colors,\nstyles: Styles,\n+ rawThreadInfos: { [id: string]: RawThreadInfo },\n// Redux dispatch functions\ndispatchActionPromise: DispatchActionPromise,\n// async functions that hit server APIs\n@@ -62,12 +71,14 @@ type Props = {|\nthreadID: string,\ncurrentAccountPassword: string,\n) => Promise<LeaveThreadPayload>,\n+ // withNavContext\n+ navContext: ?NavContextType,\n|};\ntype State = {|\npassword: string,\nonePasswordSupported: boolean,\n|};\n-class InnerDeleteThread extends React.PureComponent<Props, State> {\n+class DeleteThread extends React.PureComponent<Props, State> {\nstatic propTypes = {\nnavigation: PropTypes.shape({\nstate: PropTypes.shape({\n@@ -83,8 +94,10 @@ class InnerDeleteThread extends React.PureComponent<Props, State> {\nactiveTheme: globalThemePropType,\ncolors: colorsPropType.isRequired,\nstyles: PropTypes.objectOf(PropTypes.object).isRequired,\n+ rawThreadInfos: PropTypes.objectOf(rawThreadInfoPropType).isRequired,\ndispatchActionPromise: PropTypes.func.isRequired,\ndeleteThread: PropTypes.func.isRequired,\n+ navContext: navContextPropType,\n};\nstatic navigationOptions = {\nheaderTitle: 'Delete thread',\n@@ -156,7 +169,7 @@ class InnerDeleteThread extends React.PureComponent<Props, State> {\n) : (\n<Text style={this.props.styles.deleteText}>Delete thread</Text>\n);\n- const threadInfo = InnerDeleteThread.getThreadInfo(this.props);\n+ const threadInfo = DeleteThread.getThreadInfo(this.props);\nconst { panelForegroundTertiaryLabel } = this.props.colors;\nreturn (\n<ScrollView\n@@ -223,9 +236,23 @@ class InnerDeleteThread extends React.PureComponent<Props, State> {\n};\nasync deleteThread() {\n- const threadInfo = InnerDeleteThread.getThreadInfo(this.props);\n+ const { navContext } = this.props;\n+ invariant(navContext, 'navContext should exist in deleteThread');\n+ const threadInfo = DeleteThread.getThreadInfo(this.props);\ntry {\n- return await this.props.deleteThread(threadInfo.id, this.state.password);\n+ const result = await this.props.deleteThread(\n+ threadInfo.id,\n+ this.state.password,\n+ );\n+ const invalidated = identifyInvalidatedThreads(\n+ this.props.rawThreadInfos,\n+ result.threadInfos,\n+ );\n+ navContext.dispatch({\n+ type: 'CLEAR_THREADS',\n+ threadIDs: [...invalidated],\n+ });\n+ return result;\n} catch (e) {\nif (\ne.message === 'invalid_credentials' ||\n@@ -315,7 +342,7 @@ const loadingStatusSelector = createLoadingStatusSelector(\ndeleteThreadActionTypes,\n);\n-const DeleteThread = connect(\n+export default connect(\n(state: AppState, ownProps: { navigation: NavProp }): * => {\nconst threadID = ownProps.navigation.state.params.threadInfo.id;\nreturn {\n@@ -324,9 +351,8 @@ const DeleteThread = connect(\nactiveTheme: state.globalThemeInfo.activeTheme,\ncolors: colorsSelector(state),\nstyles: stylesSelector(state),\n+ rawThreadInfos: state.threadStore.threadInfos,\n};\n},\n{ deleteThread },\n-)(InnerDeleteThread);\n-\n-export default DeleteThread;\n+)(withNavContext(DeleteThread));\n" }, { "change_type": "MODIFY", "old_path": "native/chat/settings/thread-settings-leave-thread.react.js", "new_path": "native/chat/settings/thread-settings-leave-thread.react.js", "diff": "@@ -4,6 +4,8 @@ import {\ntype ThreadInfo,\nthreadInfoPropType,\ntype LeaveThreadPayload,\n+ type RawThreadInfo,\n+ rawThreadInfoPropType,\n} from 'lib/types/thread-types';\nimport type { LoadingStatus } from 'lib/types/loading-types';\nimport { loadingStatusPropType } from 'lib/types/loading-types';\n@@ -14,6 +16,7 @@ import type { Styles } from '../../types/styles';\nimport * as React from 'react';\nimport { Text, Alert, ActivityIndicator, View, Platform } from 'react-native';\nimport PropTypes from 'prop-types';\n+import invariant from 'invariant';\nimport { connect } from 'lib/utils/redux-utils';\nimport {\n@@ -22,6 +25,7 @@ import {\n} from 'lib/actions/thread-actions';\nimport { createLoadingStatusSelector } from 'lib/selectors/loading-selectors';\nimport { otherUsersButNoOtherAdmins } from 'lib/selectors/thread-selectors';\n+import { identifyInvalidatedThreads } from 'lib/shared/thread-utils';\nimport Button from '../../components/button.react';\nimport {\n@@ -30,6 +34,11 @@ import {\ncolorsSelector,\nstyleSelector,\n} from '../../themes/colors';\n+import {\n+ withNavContext,\n+ type NavContextType,\n+ navContextPropType,\n+} from '../../navigation/navigation-context';\ntype Props = {|\nthreadInfo: ThreadInfo,\n@@ -39,10 +48,13 @@ type Props = {|\notherUsersButNoOtherAdmins: boolean,\ncolors: Colors,\nstyles: Styles,\n+ rawThreadInfos: { [id: string]: RawThreadInfo },\n// Redux dispatch functions\ndispatchActionPromise: DispatchActionPromise,\n// async functions that hit server APIs\nleaveThread: (threadID: string) => Promise<LeaveThreadPayload>,\n+ // withNavContext\n+ navContext: ?NavContextType,\n|};\nclass ThreadSettingsLeaveThread extends React.PureComponent<Props> {\nstatic propTypes = {\n@@ -52,8 +64,10 @@ class ThreadSettingsLeaveThread extends React.PureComponent<Props> {\notherUsersButNoOtherAdmins: PropTypes.bool.isRequired,\ncolors: colorsPropType.isRequired,\nstyles: PropTypes.objectOf(PropTypes.object).isRequired,\n+ rawThreadInfos: PropTypes.objectOf(rawThreadInfoPropType).isRequired,\ndispatchActionPromise: PropTypes.func.isRequired,\nleaveThread: PropTypes.func.isRequired,\n+ navContext: navContextPropType,\n};\nrender() {\n@@ -110,8 +124,20 @@ class ThreadSettingsLeaveThread extends React.PureComponent<Props> {\n};\nasync leaveThread() {\n+ const { navContext } = this.props;\n+ invariant(navContext, 'navContext should exist in leaveThread');\n+ const threadID = this.props.threadInfo.id;\ntry {\n- return await this.props.leaveThread(this.props.threadInfo.id);\n+ const result = await this.props.leaveThread(threadID);\n+ const invalidated = identifyInvalidatedThreads(\n+ this.props.rawThreadInfos,\n+ result.threadInfos,\n+ );\n+ navContext.dispatch({\n+ type: 'CLEAR_THREADS',\n+ threadIDs: [...invalidated],\n+ });\n+ return result;\n} catch (e) {\nAlert.alert('Unknown error', 'Uhh... try again?');\nthrow e;\n@@ -153,6 +179,7 @@ export default connect(\n)(state),\ncolors: colorsSelector(state),\nstyles: stylesSelector(state),\n+ rawThreadInfos: state.threadStore.threadInfos,\n}),\n{ leaveThread },\n-)(ThreadSettingsLeaveThread);\n+)(withNavContext(ThreadSettingsLeaveThread));\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Don't treat user-driven leave/delete thread as invalidation
129,187
01.04.2020 19:17:01
14,400
9194a346f2544e44469b55ab858aef05bd8967f5
[native] Kill popChatScreensForThreadID
[ { "change_type": "MODIFY", "old_path": "native/navigation/nav-reducer.js", "new_path": "native/navigation/nav-reducer.js", "diff": "// @flow\n-import type { RawThreadInfo, LeaveThreadPayload } from 'lib/types/thread-types';\n+import type { RawThreadInfo } from 'lib/types/thread-types';\nimport type {\nNavigationState,\nNavigationRoute,\n@@ -16,21 +16,15 @@ import { useScreens } from 'react-native-screens';\nimport { infoFromURL } from 'lib/utils/url-utils';\nimport { setNewSessionActionType } from 'lib/utils/action-utils';\n-import {\n- leaveThreadActionTypes,\n- deleteThreadActionTypes,\n- newThreadActionTypes,\n-} from 'lib/actions/thread-actions';\n+import { newThreadActionTypes } from 'lib/actions/thread-actions';\nimport { threadInfoFromRawThreadInfo } from 'lib/shared/thread-utils';\nimport {\nassertNavigationRouteNotLeafNode,\n- getThreadIDFromParams,\nremoveScreensFromStack,\n} from '../utils/navigation-utils';\nimport {\nComposeThreadRouteName,\n- ThreadSettingsRouteName,\nMessageListRouteName,\nVerificationModalRouteName,\n} from './route-names';\n@@ -70,18 +64,6 @@ function reduceNavInfo(state: AppState, action: *): NavInfo {\n};\n} else if (action.type === setNewSessionActionType) {\nsessionInvalidationAlert(action.payload);\n- } else if (\n- action.type === leaveThreadActionTypes.success ||\n- action.type === deleteThreadActionTypes.success\n- ) {\n- return {\n- startDate: navInfoState.startDate,\n- endDate: navInfoState.endDate,\n- navigationState: popChatScreensForThreadID(\n- navInfoState.navigationState,\n- action.payload,\n- ),\n- };\n} else if (action.type === newThreadActionTypes.success) {\nreturn {\nstartDate: navInfoState.startDate,\n@@ -192,29 +174,6 @@ function replaceChatRoute(\n};\n}\n-function popChatScreensForThreadID(\n- state: NavigationState,\n- actionPayload: LeaveThreadPayload,\n-): NavigationState {\n- const replaceFunc = (chatRoute: NavigationStateRoute) =>\n- removeScreensFromStack(chatRoute, (route: NavigationRoute) => {\n- if (\n- (route.routeName !== MessageListRouteName &&\n- route.routeName !== ThreadSettingsRouteName) ||\n- (route.routeName === MessageListRouteName &&\n- !!actionPayload.threadInfos[actionPayload.threadID])\n- ) {\n- return 'break';\n- }\n- const threadID = getThreadIDFromParams(route.params);\n- if (threadID !== actionPayload.threadID) {\n- return 'break';\n- }\n- return 'remove';\n- });\n- return replaceChatRoute(state, replaceFunc);\n-}\n-\nfunction handleNewThread(\nstate: NavigationState,\nrawThreadInfo: RawThreadInfo,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Kill popChatScreensForThreadID
129,187
01.04.2020 19:21:23
14,400
fe74bda4316f2fe475b037e754915b4fbe5351f4
[native] Move sessionInvalidationAlert to redux-setup.js
[ { "change_type": "MODIFY", "old_path": "native/navigation/nav-reducer.js", "new_path": "native/navigation/nav-reducer.js", "diff": "@@ -7,15 +7,12 @@ import type {\nNavigationStateRoute,\n} from 'react-navigation';\nimport type { AppState } from '../redux/redux-setup';\n-import type { SetSessionPayload } from 'lib/types/session-types';\nimport type { UserInfo } from 'lib/types/user-types';\nimport type { NavInfo } from './default-state';\n-import { Alert, Platform } from 'react-native';\nimport { useScreens } from 'react-native-screens';\nimport { infoFromURL } from 'lib/utils/url-utils';\n-import { setNewSessionActionType } from 'lib/utils/action-utils';\nimport { newThreadActionTypes } from 'lib/actions/thread-actions';\nimport { threadInfoFromRawThreadInfo } from 'lib/shared/thread-utils';\n@@ -62,8 +59,6 @@ function reduceNavInfo(state: AppState, action: *): NavInfo {\nendDate: navInfoState.endDate,\nnavigationState: handleURL(navInfoState.navigationState, action.payload),\n};\n- } else if (action.type === setNewSessionActionType) {\n- sessionInvalidationAlert(action.payload);\n} else if (action.type === newThreadActionTypes.success) {\nreturn {\nstartDate: navInfoState.startDate,\n@@ -119,31 +114,6 @@ function handleURL(state: NavigationState, url: string): NavigationState {\n};\n}\n-function sessionInvalidationAlert(payload: SetSessionPayload) {\n- if (!payload.sessionChange.cookieInvalidated) {\n- return;\n- }\n- if (payload.error === 'client_version_unsupported') {\n- const app = Platform.select({\n- ios: 'Testflight',\n- android: 'Play Store',\n- });\n- Alert.alert(\n- 'App out of date',\n- \"Your app version is pretty old, and the server doesn't know how to \" +\n- `speak to it anymore. Please use the ${app} app to update!`,\n- [{ text: 'OK' }],\n- );\n- } else {\n- Alert.alert(\n- 'Session invalidated',\n- \"We're sorry, but your session was invalidated by the server. \" +\n- 'Please log in again.',\n- [{ text: 'OK' }],\n- );\n- }\n-}\n-\nfunction replaceChatRoute(\nstate: NavigationState,\nreplaceFunc: (chatRoute: NavigationStateRoute) => NavigationStateRoute,\n" }, { "change_type": "MODIFY", "old_path": "native/redux/redux-setup.js", "new_path": "native/redux/redux-setup.js", "diff": "@@ -35,6 +35,7 @@ import {\n} from '../types/camera';\nimport type { Orientations } from 'react-native-orientation-locker';\nimport type { ClientReportCreationRequest } from 'lib/types/report-types';\n+import type { SetSessionPayload } from 'lib/types/session-types';\nimport thunk from 'redux-thunk';\nimport { createStore, applyMiddleware, type Store, compose } from 'redux';\n@@ -44,6 +45,7 @@ import {\nAppState as NativeAppState,\nPlatform,\nDimensions as NativeDimensions,\n+ Alert,\n} from 'react-native';\nimport Orientation from 'react-native-orientation-locker';\n@@ -256,6 +258,7 @@ function reducer(state: AppState = defaultState, action: *) {\nconst oldState = state;\nif (action.type === setNewSessionActionType) {\n+ sessionInvalidationAlert(action.payload);\nstate = {\n...state,\ncookie: action.payload.sessionChange.cookie,\n@@ -297,6 +300,31 @@ function reducer(state: AppState = defaultState, action: *) {\nreturn validateState(oldState, state, action);\n}\n+function sessionInvalidationAlert(payload: SetSessionPayload) {\n+ if (!payload.sessionChange.cookieInvalidated) {\n+ return;\n+ }\n+ if (payload.error === 'client_version_unsupported') {\n+ const app = Platform.select({\n+ ios: 'Testflight',\n+ android: 'Play Store',\n+ });\n+ Alert.alert(\n+ 'App out of date',\n+ \"Your app version is pretty old, and the server doesn't know how to \" +\n+ `speak to it anymore. Please use the ${app} app to update!`,\n+ [{ text: 'OK' }],\n+ );\n+ } else {\n+ Alert.alert(\n+ 'Session invalidated',\n+ \"We're sorry, but your session was invalidated by the server. \" +\n+ 'Please log in again.',\n+ [{ text: 'OK' }],\n+ );\n+ }\n+}\n+\nfunction validateState(\noldState: AppState,\nstate: AppState,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Move sessionInvalidationAlert to redux-setup.js
129,187
01.04.2020 21:14:18
14,400
06a1bdeb79eb9593fa4c2d52fb55c9fa5ce32c28
[native] Handle thread creation through ChatRouter
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-router.js", "new_path": "native/chat/chat-router.js", "diff": "@@ -15,6 +15,7 @@ import {\nimport {\nChatThreadListRouteName,\nMessageListRouteName,\n+ ComposeThreadRouteName,\n} from '../navigation/route-names';\nimport {\nremoveScreensFromStack,\n@@ -33,11 +34,16 @@ type ClearThreadsAction = {|\n+type: 'CLEAR_THREADS',\n+threadIDs: $ReadOnlyArray<string>,\n|};\n+type PushNewThreadAction = {|\n+ +type: 'PUSH_NEW_THREAD',\n+ +threadInfo: ThreadInfo,\n+|};\nexport type ChatRouterNavigationAction =\n| NavigationAction\n| ClearScreensAction\n| ReplaceWithThreadAction\n- | ClearThreadsAction;\n+ | ClearThreadsAction\n+ | PushNewThreadAction;\nconst defaultConfig = Object.freeze({});\nfunction ChatRouter(\n@@ -99,6 +105,22 @@ function ChatRouter(\nreturn newState;\n}\nreturn { ...newState, isTransitioning: true };\n+ } else if (action.type === 'PUSH_NEW_THREAD') {\n+ const { threadInfo } = action;\n+ if (!lastState) {\n+ return lastState;\n+ }\n+ const clearedState = removeScreensFromStack(\n+ lastState,\n+ (route: NavigationRoute) =>\n+ route.routeName === ComposeThreadRouteName ? 'remove' : 'break',\n+ );\n+ const navigateAction = NavigationActions.navigate({\n+ routeName: MessageListRouteName,\n+ key: `${MessageListRouteName}${threadInfo.id}`,\n+ params: { threadInfo },\n+ });\n+ return stackRouter.getStateForAction(navigateAction, clearedState);\n} else {\nreturn stackRouter.getStateForAction(action, lastState);\n}\n@@ -117,6 +139,10 @@ function ChatRouter(\ntype: 'CLEAR_THREADS',\nthreadIDs,\n}),\n+ pushNewThread: (threadInfo: ThreadInfo) => ({\n+ type: 'PUSH_NEW_THREAD',\n+ threadInfo,\n+ }),\n}),\n};\n}\n" }, { "change_type": "MODIFY", "old_path": "native/chat/chat.react.js", "new_path": "native/chat/chat.react.js", "diff": "@@ -40,14 +40,15 @@ import KeyboardAvoidingView from '../keyboard/keyboard-avoiding-view.react';\nimport MessageStorePruner from './message-store-pruner.react';\nimport ThreadScreenPruner from './thread-screen-pruner.react';\n-type NavigationProp = NavigationStackProp<NavigationState> & {\n+export type ChatNavProp<State> = NavigationStackProp<State> & {\nclearScreens: (routeNames: $ReadOnlyArray<string>) => void,\nreplaceWithThread: (threadInfo: ThreadInfo) => void,\nclearThreads: (threadIDs: $ReadOnlyArray<string>) => void,\n+ pushNewThread: (threadInfo: ThreadInfo) => void,\n};\n-type Props = {| navigation: NavigationProp |};\n+type Props = {| navigation: ChatNavProp<NavigationState> |};\ntype StackViewProps = React.ElementConfig<typeof StackView> & {\n- +navigation: NavigationProp,\n+ +navigation: ChatNavProp<NavigationState>,\n};\nfunction createChatNavigator(\n@@ -76,7 +77,7 @@ function createChatNavigator(\nNavigationStackScreenOptions,\nNavigationState,\nStackNavigatorConfig,\n- NavigationProp,\n+ ChatNavProp<NavigationState>,\nStackViewProps,\n>(StackView, ChatRouter(routeConfigMap, routerConfig), navigatorConfig),\nnavigatorConfig,\n@@ -107,7 +108,7 @@ ChatNavigator.navigationOptions = {\nnavigation,\ndefaultHandler,\n}: {\n- navigation: NavigationProp,\n+ navigation: ChatNavProp<NavigationState>,\ndefaultHandler: () => void,\n}) => {\nif (!navigation.isFocused()) {\n" }, { "change_type": "MODIFY", "old_path": "native/chat/compose-thread.react.js", "new_path": "native/chat/compose-thread.react.js", "diff": "// @flow\n-import type {\n- NavigationScreenProp,\n- NavigationLeafRoute,\n-} from 'react-navigation';\n+import type { NavigationLeafRoute } from 'react-navigation';\nimport type { AppState } from '../redux/redux-setup';\nimport type { LoadingStatus } from 'lib/types/loading-types';\nimport { loadingStatusPropType } from 'lib/types/loading-types';\n@@ -19,10 +16,13 @@ import {\nimport {\ntype AccountUserInfo,\naccountUserInfoPropType,\n+ type UserInfo,\n+ userInfoPropType,\n} from 'lib/types/user-types';\nimport type { DispatchActionPromise } from 'lib/utils/action-utils';\nimport type { UserSearchResult } from 'lib/types/search-types';\nimport type { Styles } from '../types/styles';\n+import type { ChatNavProp } from './chat.react';\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\n@@ -42,7 +42,11 @@ import {\nuserSearchIndexForOtherMembersOfThread,\n} from 'lib/selectors/user-selectors';\nimport SearchIndex from 'lib/shared/search-index';\n-import { threadInChatList, userIsMember } from 'lib/shared/thread-utils';\n+import {\n+ threadInChatList,\n+ userIsMember,\n+ threadInfoFromRawThreadInfo,\n+} from 'lib/shared/thread-utils';\nimport { getUserSearchResults } from 'lib/shared/search-utils';\nimport { registerFetchKey } from 'lib/reducers/loading-reducer';\nimport { threadInfoSelector } from 'lib/selectors/thread-selectors';\n@@ -66,7 +70,7 @@ const tagInputProps = {\nreturnKeyType: 'go',\n};\n-type NavProp = NavigationScreenProp<{|\n+type NavProp = ChatNavProp<{|\n...NavigationLeafRoute,\nparams: {|\nthreadType?: ThreadType,\n@@ -105,6 +109,8 @@ type Props = {|\nthreadInfos: { [id: string]: ThreadInfo },\ncolors: Colors,\nstyles: Styles,\n+ viewerID: ?string,\n+ userInfos: { [id: string]: UserInfo },\n// Redux dispatch functions\ndispatchActionPromise: DispatchActionPromise,\n// async functions that hit server APIs\n@@ -131,6 +137,7 @@ class ComposeThread extends React.PureComponent<Props, State> {\ngoBack: PropTypes.func.isRequired,\nnavigate: PropTypes.func.isRequired,\ngetParam: PropTypes.func.isRequired,\n+ pushNewThread: PropTypes.func.isRequired,\n}).isRequired,\nparentThreadInfo: threadInfoPropType,\nloadingStatus: loadingStatusPropType.isRequired,\n@@ -139,6 +146,8 @@ class ComposeThread extends React.PureComponent<Props, State> {\nthreadInfos: PropTypes.objectOf(threadInfoPropType).isRequired,\ncolors: colorsPropType.isRequired,\nstyles: PropTypes.objectOf(PropTypes.object).isRequired,\n+ viewerID: PropTypes.string,\n+ userInfos: PropTypes.objectOf(userInfoPropType).isRequired,\ndispatchActionPromise: PropTypes.func.isRequired,\nnewThread: PropTypes.func.isRequired,\nsearchUsers: PropTypes.func.isRequired,\n@@ -383,11 +392,16 @@ class ComposeThread extends React.PureComponent<Props, State> {\n}\n};\n- dispatchNewChatThreadAction = () => {\n- this.props.dispatchActionPromise(\n- newThreadActionTypes,\n- this.newChatThreadAction(),\n+ dispatchNewChatThreadAction = async () => {\n+ const promise = this.newChatThreadAction();\n+ this.props.dispatchActionPromise(newThreadActionTypes, promise);\n+ const { newThreadInfo: rawThreadInfo } = await promise;\n+ const threadInfo = threadInfoFromRawThreadInfo(\n+ rawThreadInfo,\n+ this.props.viewerID,\n+ this.props.userInfos,\n);\n+ this.props.navigation.pushNewThread(threadInfo);\n};\nasync newChatThreadAction() {\n@@ -531,6 +545,8 @@ export default connect(\nthreadInfos: threadInfoSelector(state),\ncolors: colorsSelector(state),\nstyles: stylesSelector(state),\n+ viewerID: state.currentUserInfo && state.currentUserInfo.id,\n+ userInfos: state.userInfos,\n};\n},\n{ newThread, searchUsers },\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/nav-reducer.js", "new_path": "native/navigation/nav-reducer.js", "diff": "// @flow\n-import type { RawThreadInfo } from 'lib/types/thread-types';\n-import type {\n- NavigationState,\n- NavigationRoute,\n- NavigationStateRoute,\n-} from 'react-navigation';\n+import type { NavigationState } from 'react-navigation';\nimport type { AppState } from '../redux/redux-setup';\n-import type { UserInfo } from 'lib/types/user-types';\nimport type { NavInfo } from './default-state';\nimport { useScreens } from 'react-native-screens';\nimport { infoFromURL } from 'lib/utils/url-utils';\n-import { newThreadActionTypes } from 'lib/actions/thread-actions';\n-import { threadInfoFromRawThreadInfo } from 'lib/shared/thread-utils';\n-import {\n- assertNavigationRouteNotLeafNode,\n- removeScreensFromStack,\n-} from '../utils/navigation-utils';\n-import {\n- ComposeThreadRouteName,\n- MessageListRouteName,\n- VerificationModalRouteName,\n-} from './route-names';\n+import { VerificationModalRouteName } from './route-names';\nimport { handleURLActionType } from '../redux/action-types';\nimport RootNavigator from './root-navigator.react';\n// eslint-disable-next-line react-hooks/rules-of-hooks\nuseScreens();\n-const messageListRouteBase = Date.now();\n-let messageListRouteIndex = 0;\n-function getUniqueMessageListRouteKey() {\n- return `${messageListRouteBase}-${messageListRouteIndex++}`;\n-}\n-\nfunction reduceNavInfo(state: AppState, action: *): NavInfo {\n- let navInfoState = state.navInfo;\n// React Navigation actions\nconst navigationState = RootNavigator.router.getStateForAction(\naction,\n- navInfoState.navigationState,\n+ state.navInfo.navigationState,\n);\n- if (navigationState && navigationState !== navInfoState.navigationState) {\n+ if (navigationState && navigationState !== state.navInfo.navigationState) {\nreturn {\n- startDate: navInfoState.startDate,\n- endDate: navInfoState.endDate,\n+ startDate: state.navInfo.startDate,\n+ endDate: state.navInfo.endDate,\nnavigationState,\n};\n}\n@@ -55,23 +32,13 @@ function reduceNavInfo(state: AppState, action: *): NavInfo {\n// Deep linking\nif (action.type === handleURLActionType) {\nreturn {\n- startDate: navInfoState.startDate,\n- endDate: navInfoState.endDate,\n- navigationState: handleURL(navInfoState.navigationState, action.payload),\n- };\n- } else if (action.type === newThreadActionTypes.success) {\n- return {\n- startDate: navInfoState.startDate,\n- endDate: navInfoState.endDate,\n- navigationState: handleNewThread(\n- navInfoState.navigationState,\n- action.payload.newThreadInfo,\n- state.currentUserInfo && state.currentUserInfo.id,\n- state.userInfos,\n- ),\n+ startDate: state.navInfo.startDate,\n+ endDate: state.navInfo.endDate,\n+ navigationState: handleURL(state.navInfo.navigationState, action.payload),\n};\n}\n- return navInfoState;\n+\n+ return state.navInfo;\n}\nfunction handleURL(state: NavigationState, url: string): NavigationState {\n@@ -114,70 +81,4 @@ function handleURL(state: NavigationState, url: string): NavigationState {\n};\n}\n-function replaceChatRoute(\n- state: NavigationState,\n- replaceFunc: (chatRoute: NavigationStateRoute) => NavigationStateRoute,\n-): NavigationState {\n- const appRoute = assertNavigationRouteNotLeafNode(state.routes[0]);\n- const tabRoute = assertNavigationRouteNotLeafNode(appRoute.routes[0]);\n- const chatRoute = assertNavigationRouteNotLeafNode(tabRoute.routes[1]);\n-\n- const newChatRoute = replaceFunc(chatRoute);\n- if (newChatRoute === chatRoute) {\n- return state;\n- }\n-\n- const newTabRoutes = [...tabRoute.routes];\n- newTabRoutes[1] = newChatRoute;\n- const newTabRoute = { ...tabRoute, routes: newTabRoutes };\n-\n- const newAppRoutes = [...appRoute.routes];\n- newAppRoutes[0] = newTabRoute;\n- const newAppRoute = { ...appRoute, routes: newAppRoutes };\n-\n- const newRootRoutes = [...state.routes];\n- newRootRoutes[0] = newAppRoute;\n- return {\n- ...state,\n- routes: newRootRoutes,\n- isTransitioning: true,\n- };\n-}\n-\n-function handleNewThread(\n- state: NavigationState,\n- rawThreadInfo: RawThreadInfo,\n- viewerID: ?string,\n- userInfos: { [id: string]: UserInfo },\n-): NavigationState {\n- const threadInfo = threadInfoFromRawThreadInfo(\n- rawThreadInfo,\n- viewerID,\n- userInfos,\n- );\n- const replaceFunc = (chatRoute: NavigationStateRoute) => {\n- const newChatRoute = removeScreensFromStack(\n- chatRoute,\n- (route: NavigationRoute) =>\n- route.routeName === ComposeThreadRouteName ? 'remove' : 'break',\n- );\n- const key =\n- `${MessageListRouteName}${threadInfo.id}:` +\n- getUniqueMessageListRouteKey();\n- return {\n- ...newChatRoute,\n- routes: [\n- ...newChatRoute.routes,\n- {\n- key,\n- routeName: MessageListRouteName,\n- params: { threadInfo },\n- },\n- ],\n- index: newChatRoute.routes.length,\n- };\n- };\n- return replaceChatRoute(state, replaceFunc);\n-}\n-\nexport default reduceNavInfo;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Handle thread creation through ChatRouter
129,187
01.04.2020 22:46:01
14,400
c01b013ba23a4d2a9d28e9620a20ff17b3d63cf6
[native] Move deeplinkings support to LinkingHandler
[ { "change_type": "ADD", "old_path": null, "new_path": "native/navigation/linking-handler.react.js", "diff": "+// @flow\n+\n+import type { NavAction } from './navigation-context';\n+\n+import * as React from 'react';\n+import { Linking } from 'react-native';\n+import { NavigationActions } from 'react-navigation';\n+\n+import { infoFromURL } from 'lib/utils/url-utils';\n+\n+import { VerificationModalRouteName } from './route-names';\n+\n+type Props = {|\n+ dispatch: (action: NavAction) => boolean,\n+|};\n+const LinkingHandler = React.memo<Props>((props: Props) => {\n+ const { dispatch } = props;\n+\n+ const handleURL = (url: string) => {\n+ if (!url.startsWith('http')) {\n+ return;\n+ }\n+ const { verify } = infoFromURL(url);\n+ if (!verify) {\n+ // TODO correctly handle non-verify URLs\n+ return;\n+ }\n+ dispatch(\n+ NavigationActions.navigate({\n+ routeName: VerificationModalRouteName,\n+ key: 'VerificationModal',\n+ params: { verifyCode: verify },\n+ }),\n+ );\n+ };\n+\n+ React.useEffect(() => {\n+ (async () => {\n+ const url = await Linking.getInitialURL();\n+ if (url) {\n+ handleURL(url);\n+ }\n+ })();\n+ // eslint-disable-next-line react-hooks/exhaustive-deps\n+ }, []);\n+\n+ React.useEffect(() => {\n+ const handleURLChange = (event: { url: string }) => handleURL(event.url);\n+ Linking.addEventListener('url', handleURLChange);\n+ return () => Linking.removeEventListener('url', handleURLChange);\n+ });\n+\n+ return null;\n+});\n+LinkingHandler.displayName = 'LinkingHandler';\n+\n+export default LinkingHandler;\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/nav-reducer.js", "new_path": "native/navigation/nav-reducer.js", "diff": "// @flow\n-import type { NavigationState } from 'react-navigation';\nimport type { AppState } from '../redux/redux-setup';\nimport type { NavInfo } from './default-state';\nimport { useScreens } from 'react-native-screens';\n-import { infoFromURL } from 'lib/utils/url-utils';\n-\n-import { VerificationModalRouteName } from './route-names';\n-import { handleURLActionType } from '../redux/action-types';\nimport RootNavigator from './root-navigator.react';\n// eslint-disable-next-line react-hooks/rules-of-hooks\nuseScreens();\nfunction reduceNavInfo(state: AppState, action: *): NavInfo {\n- // React Navigation actions\nconst navigationState = RootNavigator.router.getStateForAction(\naction,\nstate.navInfo.navigationState,\n@@ -28,57 +22,7 @@ function reduceNavInfo(state: AppState, action: *): NavInfo {\nnavigationState,\n};\n}\n-\n- // Deep linking\n- if (action.type === handleURLActionType) {\n- return {\n- startDate: state.navInfo.startDate,\n- endDate: state.navInfo.endDate,\n- navigationState: handleURL(state.navInfo.navigationState, action.payload),\n- };\n- }\n-\nreturn state.navInfo;\n}\n-function handleURL(state: NavigationState, url: string): NavigationState {\n- const urlInfo = infoFromURL(url);\n- if (!urlInfo.verify) {\n- // TODO correctly handle non-verify URLs\n- return state;\n- }\n-\n- // Special-case behavior if there's already a VerificationModal\n- const currentRoute = state.routes[state.index];\n- if (currentRoute.key === 'VerificationModal') {\n- const newRoute = {\n- ...currentRoute,\n- params: {\n- verifyCode: urlInfo.verify,\n- },\n- };\n- const newRoutes = [...state.routes];\n- newRoutes[state.index] = newRoute;\n- return {\n- index: state.index,\n- routes: newRoutes,\n- };\n- }\n-\n- return {\n- index: state.index + 1,\n- routes: [\n- ...state.routes,\n- {\n- key: 'VerificationModal',\n- routeName: VerificationModalRouteName,\n- params: {\n- verifyCode: urlInfo.verify,\n- },\n- },\n- ],\n- isTransitioning: true,\n- };\n-}\n-\nexport default reduceNavInfo;\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/navigation-handler.react.js", "new_path": "native/navigation/navigation-handler.react.js", "diff": "@@ -7,13 +7,32 @@ import { useSelector } from 'react-redux';\nimport { NavContext, type NavAction } from './navigation-context';\nimport { useIsAppLoggedIn } from './nav-selectors';\n+import LinkingHandler from './linking-handler.react';\nfunction NavigationHandler() {\nconst navContext = React.useContext(NavContext);\n-\nconst reduxRehydrated = useSelector(\n(state: AppState) => !!(state._persist && state._persist.rehydrated),\n);\n+ if (!navContext || !reduxRehydrated) {\n+ return null;\n+ }\n+ const { dispatch } = navContext;\n+ return (\n+ <>\n+ <LogInHandler dispatch={dispatch} />\n+ <LinkingHandler dispatch={dispatch} />\n+ </>\n+ );\n+}\n+\n+type LogInHandlerProps = {|\n+ dispatch: (action: NavAction) => boolean,\n+|};\n+const LogInHandler = React.memo<LogInHandlerProps>(\n+ (props: LogInHandlerProps) => {\n+ const { dispatch } = props;\n+\nconst loggedIn = useSelector(\n(state: AppState) =>\n!!(\n@@ -26,28 +45,6 @@ function NavigationHandler() {\nconst navLoggedIn = useIsAppLoggedIn();\n- if (navContext && reduxRehydrated) {\n- return (\n- <LogInHandler\n- navLoggedIn={navLoggedIn}\n- loggedIn={loggedIn}\n- dispatch={navContext.dispatch}\n- />\n- );\n- }\n-\n- return null;\n-}\n-\n-type LogInHandlerProps = {|\n- navLoggedIn: boolean,\n- loggedIn: boolean,\n- dispatch: (action: NavAction) => boolean,\n-|};\n-const LogInHandler = React.memo<LogInHandlerProps>(\n- (props: LogInHandlerProps) => {\n- const { navLoggedIn, loggedIn, dispatch } = props;\n-\nconst prevLoggedInRef = React.useRef();\nReact.useEffect(() => {\nprevLoggedInRef.current = loggedIn;\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/root-router.js", "new_path": "native/navigation/root-router.js", "diff": "@@ -109,6 +109,11 @@ function RootRouter(\nreturn stackRouter.getStateForAction(action, lastState);\n}\n},\n+ getActionCreators: (route: NavigationRoute, navStateKey: ?string) => ({\n+ ...stackRouter.getActionCreators(route, navStateKey),\n+ logIn: () => ({ type: 'LOG_IN' }),\n+ logOut: () => ({ type: 'LOG_OUT' }),\n+ }),\n};\n}\n" }, { "change_type": "MODIFY", "old_path": "native/redux/action-types.js", "new_path": "native/redux/action-types.js", "diff": "import { saveMessagesActionType } from 'lib/actions/message-actions';\n-export const handleURLActionType = 'HANDLE_URL';\nexport const resetUserStateActionType = 'RESET_USER_STATE';\nexport const recordNotifPermissionAlertActionType =\n'RECORD_NOTIF_PERMISSION_ALERT';\n" }, { "change_type": "MODIFY", "old_path": "native/root.react.js", "new_path": "native/root.react.js", "diff": "@@ -13,7 +13,6 @@ import {\nPlatform,\nUIManager,\nAppState as NativeAppState,\n- Linking,\nView,\nStyleSheet,\n} from 'react-native';\n@@ -30,7 +29,6 @@ import {\n} from 'lib/reducers/foreground-reducer';\nimport RootNavigator from './navigation/root-navigator.react';\n-import { handleURLActionType } from './redux/action-types';\nimport { store, appBecameInactive } from './redux/redux-setup';\nimport ConnectedStatusBar from './connected-status-bar.react';\nimport ErrorBoundary from './error-boundary.react';\n@@ -99,21 +97,11 @@ class Root extends React.PureComponent<Props, State> {\nSplashScreen.hide();\n}\nNativeAppState.addEventListener('change', this.handleAppStateChange);\n- this.handleInitialURL();\n- Linking.addEventListener('url', this.handleURLChange);\nOrientation.lockToPortrait();\n}\n- async handleInitialURL() {\n- const url = await Linking.getInitialURL();\n- if (url) {\n- this.dispatchActionForURL(url);\n- }\n- }\n-\ncomponentWillUnmount() {\nNativeAppState.removeEventListener('change', this.handleAppStateChange);\n- Linking.removeEventListener('url', this.handleURLChange);\n}\ncomponentDidUpdate(prevProps: Props) {\n@@ -130,17 +118,6 @@ class Root extends React.PureComponent<Props, State> {\n}\n}\n- handleURLChange = (event: { url: string }) => {\n- this.dispatchActionForURL(event.url);\n- };\n-\n- dispatchActionForURL(url: string) {\n- if (!url.startsWith('http')) {\n- return;\n- }\n- this.props.dispatchActionPayload(handleURLActionType, url);\n- }\n-\nhandleAppStateChange = (nextState: ?string) => {\nif (!nextState || nextState === 'unknown') {\nreturn;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Move deeplinkings support to LinkingHandler
129,187
01.04.2020 22:53:43
14,400
ba489649b71885024320721f126b3e49c694b1f7
[native] Get rid of nav-reducer.js
[ { "change_type": "DELETE", "old_path": "native/navigation/nav-reducer.js", "new_path": null, "diff": "-// @flow\n-\n-import type { AppState } from '../redux/redux-setup';\n-import type { NavInfo } from './default-state';\n-\n-import { useScreens } from 'react-native-screens';\n-\n-import RootNavigator from './root-navigator.react';\n-\n-// eslint-disable-next-line react-hooks/rules-of-hooks\n-useScreens();\n-\n-function reduceNavInfo(state: AppState, action: *): NavInfo {\n- const navigationState = RootNavigator.router.getStateForAction(\n- action,\n- state.navInfo.navigationState,\n- );\n- if (navigationState && navigationState !== state.navInfo.navigationState) {\n- return {\n- startDate: state.navInfo.startDate,\n- endDate: state.navInfo.endDate,\n- navigationState,\n- };\n- }\n- return state.navInfo;\n-}\n-\n-export default reduceNavInfo;\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/root-navigator.react.js", "new_path": "native/navigation/root-navigator.react.js", "diff": "@@ -15,6 +15,7 @@ import {\ntype NavigationStackTransitionProps,\n} from 'react-navigation-stack';\nimport { Keyboard } from 'react-native';\n+import { useScreens } from 'react-native-screens';\nimport {\nLoggedOutModalRouteName,\n@@ -37,6 +38,9 @@ import ColorPickerModal from '../chat/settings/color-picker-modal.react';\nimport ComposeSubthreadModal from '../chat/settings/compose-subthread-modal.react';\nimport RootRouter from './root-router';\n+// eslint-disable-next-line react-hooks/rules-of-hooks\n+useScreens();\n+\ntype NavigationProp = NavigationStackProp<NavigationState> & {\nlogIn: () => void,\nlogOut: () => void,\n" }, { "change_type": "MODIFY", "old_path": "native/redux/redux-setup.js", "new_path": "native/redux/redux-setup.js", "diff": "@@ -71,7 +71,7 @@ import {\nupdateDeviceOrientationActionType,\nbackgroundActionTypes,\n} from './action-types';\n-import reduceNavInfo from '../navigation/nav-reducer';\n+import RootNavigator from '../navigation/root-navigator.react';\nimport { type NavInfo, defaultNavInfo } from '../navigation/default-state';\nimport { reduceThreadIDsToNotifIDs } from '../push/reducer';\nimport { persistConfig, setPersistor } from './persist';\n@@ -292,9 +292,18 @@ function reducer(state: AppState = defaultState, action: *) {\ndrafts: reduceDrafts(state.drafts, action),\n};\n- const navInfo = reduceNavInfo(state, action);\n- if (navInfo && navInfo !== state.navInfo) {\n- state = { ...state, navInfo };\n+ const navigationState = RootNavigator.router.getStateForAction(\n+ action,\n+ state.navInfo.navigationState,\n+ );\n+ if (navigationState && navigationState !== state.navInfo.navigationState) {\n+ state = {\n+ ...state,\n+ navInfo: {\n+ ...state.navInfo,\n+ navigationState,\n+ },\n+ };\n}\nreturn validateState(oldState, state, action);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Get rid of nav-reducer.js
129,187
02.04.2020 11:36:27
14,400
d9be4b84aca50b10a2a9e779d000e594fd751b19
[native] ThreadScreenTracker
[ { "change_type": "MODIFY", "old_path": "native/navigation/nav-selectors.js", "new_path": "native/navigation/nav-selectors.js", "diff": "@@ -200,12 +200,13 @@ const activeThreadSelector: (\nactiveThread(navigationState, threadRoutes),\n);\n+const messageListRouteNames = [MessageListRouteName];\nconst activeMessageListSelector: (\ncontext: ?NavContextType,\n) => ?string = createSelector(\n(context: ?NavContextType) => context && context.state,\n(navigationState: ?NavigationState): ?string =>\n- activeThread(navigationState, [MessageListRouteName]),\n+ activeThread(navigationState, messageListRouteNames),\n);\nfunction useActiveThread() {\n@@ -219,6 +220,17 @@ function useActiveThread() {\n}, [navContext]);\n}\n+function useActiveMessageList() {\n+ const navContext = React.useContext(NavContext);\n+ return React.useMemo(() => {\n+ if (!navContext) {\n+ return null;\n+ }\n+ const { state } = navContext;\n+ return activeThread(state, messageListRouteNames);\n+ }, [navContext]);\n+}\n+\nconst calendarTabActiveSelector = createActiveTabSelector(CalendarRouteName);\nconst threadPickerActiveSelector = createIsForegroundSelector(\nThreadPickerModalRouteName,\n@@ -274,6 +286,7 @@ export {\nactiveThreadSelector,\nactiveMessageListSelector,\nuseActiveThread,\n+ useActiveMessageList,\ncalendarActiveSelector,\nnativeCalendarQuery,\nnonThreadCalendarQuery,\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/navigation-handler.react.js", "new_path": "native/navigation/navigation-handler.react.js", "diff": "@@ -8,6 +8,7 @@ import { useSelector } from 'react-redux';\nimport { NavContext, type NavAction } from './navigation-context';\nimport { useIsAppLoggedIn } from './nav-selectors';\nimport LinkingHandler from './linking-handler.react';\n+import ThreadScreenTracker from './thread-screen-tracker.react';\nfunction NavigationHandler() {\nconst navContext = React.useContext(NavContext);\n@@ -22,6 +23,7 @@ function NavigationHandler() {\n<>\n<LogInHandler dispatch={dispatch} />\n<LinkingHandler dispatch={dispatch} />\n+ <ThreadScreenTracker />\n</>\n);\n}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/navigation/thread-screen-tracker.react.js", "diff": "+// @flow\n+\n+import * as React from 'react';\n+import { useDispatch } from 'react-redux';\n+\n+import { useActiveMessageList } from './nav-selectors';\n+import { updateThreadLastNavigatedActionType } from '../redux/action-types';\n+\n+function ThreadScreenTracker() {\n+ const activeThread = useActiveMessageList();\n+ const reduxDispatch = useDispatch();\n+\n+ React.useEffect(() => {\n+ if (activeThread) {\n+ reduxDispatch({\n+ type: updateThreadLastNavigatedActionType,\n+ payload: {\n+ threadID: activeThread,\n+ time: Date.now(),\n+ },\n+ });\n+ }\n+ }, [activeThread, reduxDispatch]);\n+\n+ return null;\n+}\n+\n+export default ThreadScreenTracker;\n" }, { "change_type": "MODIFY", "old_path": "native/redux/action-types.js", "new_path": "native/redux/action-types.js", "diff": "@@ -16,6 +16,8 @@ export const updateConnectivityActiveType = 'UPDATE_CONNECTIVITY';\nexport const updateThemeInfoActionType = 'UPDATE_THEME_INFO';\nexport const updateDeviceCameraInfoActionType = 'UPDATE_DEVICE_CAMERA_INFO';\nexport const updateDeviceOrientationActionType = 'UPDATE_DEVICE_ORIENTATION';\n+export const updateThreadLastNavigatedActionType =\n+ 'UPDATE_THREAD_LAST_NAVIGATED';\nexport const backgroundActionTypes: Set<string> = new Set([\nsaveMessagesActionType,\n" }, { "change_type": "MODIFY", "old_path": "native/redux/redux-setup.js", "new_path": "native/redux/redux-setup.js", "diff": "@@ -69,6 +69,7 @@ import {\nupdateThemeInfoActionType,\nupdateDeviceCameraInfoActionType,\nupdateDeviceOrientationActionType,\n+ updateThreadLastNavigatedActionType,\nbackgroundActionTypes,\n} from './action-types';\nimport RootNavigator from '../navigation/root-navigator.react';\n@@ -253,9 +254,29 @@ function reducer(state: AppState = defaultState, action: *) {\n...state,\ndeviceOrientation: action.payload,\n};\n+ } else if (action.type === setDeviceTokenActionTypes.started) {\n+ return {\n+ ...state,\n+ deviceToken: action.payload,\n+ };\n+ } else if (action.type === updateThreadLastNavigatedActionType) {\n+ const { threadID, time } = action.payload;\n+ if (state.messageStore.threads[threadID]) {\n+ state = {\n+ ...state,\n+ messageStore: {\n+ ...state.messageStore,\n+ threads: {\n+ ...state.messageStore.threads,\n+ [threadID]: {\n+ ...state.messageStore.threads[threadID],\n+ lastNavigatedTo: time,\n+ },\n+ },\n+ },\n+ };\n+ }\n}\n-\n- const oldState = state;\nif (action.type === setNewSessionActionType) {\nsessionInvalidationAlert(action.payload);\n@@ -263,11 +284,6 @@ function reducer(state: AppState = defaultState, action: *) {\n...state,\ncookie: action.payload.sessionChange.cookie,\n};\n- } else if (action.type === setDeviceTokenActionTypes.started) {\n- state = {\n- ...state,\n- deviceToken: action.payload,\n- };\n} else if (action.type === incrementalStateSyncActionType) {\nlet wipeDeviceToken = false;\nfor (let update of action.payload.updatesResult.newUpdates) {\n@@ -306,7 +322,7 @@ function reducer(state: AppState = defaultState, action: *) {\n};\n}\n- return validateState(oldState, state, action);\n+ return validateState(state, action);\n}\nfunction sessionInvalidationAlert(payload: SetSessionPayload) {\n@@ -334,15 +350,7 @@ function sessionInvalidationAlert(payload: SetSessionPayload) {\n}\n}\n-function validateState(\n- oldState: AppState,\n- state: AppState,\n- action: *,\n-): AppState {\n- const oldActiveThread = activeMessageListSelector({\n- state: oldState.navInfo.navigationState,\n- dispatch: () => true,\n- });\n+function validateState(state: AppState, action: *): AppState {\nconst activeThread = activeMessageListSelector({\nstate: state.navInfo.navigationState,\ndispatch: () => true,\n@@ -379,28 +387,6 @@ function validateState(\n},\n};\n}\n-\n- if (\n- activeThread &&\n- oldActiveThread !== activeThread &&\n- state.messageStore.threads[activeThread]\n- ) {\n- // Update messageStore.threads[activeThread].lastNavigatedTo\n- state = {\n- ...state,\n- messageStore: {\n- ...state.messageStore,\n- threads: {\n- ...state.messageStore.threads,\n- [activeThread]: {\n- ...state.messageStore.threads[activeThread],\n- lastNavigatedTo: Date.now(),\n- },\n- },\n- },\n- };\n- }\n-\nreturn state;\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] ThreadScreenTracker
129,187
02.04.2020 11:43:19
14,400
252444fb34da23c81b98f4ce48beb095f396bcc7
[native] Use React.memo for all navigation handler hooks
[ { "change_type": "MODIFY", "old_path": "native/navigation/navigation-handler.react.js", "new_path": "native/navigation/navigation-handler.react.js", "diff": "@@ -10,7 +10,7 @@ import { useIsAppLoggedIn } from './nav-selectors';\nimport LinkingHandler from './linking-handler.react';\nimport ThreadScreenTracker from './thread-screen-tracker.react';\n-function NavigationHandler() {\n+const NavigationHandler = React.memo<{||}>(() => {\nconst navContext = React.useContext(NavContext);\nconst reduxRehydrated = useSelector(\n(state: AppState) => !!(state._persist && state._persist.rehydrated),\n@@ -26,7 +26,8 @@ function NavigationHandler() {\n<ThreadScreenTracker />\n</>\n);\n-}\n+});\n+NavigationHandler.displayName = 'NavigationHandler';\ntype LogInHandlerProps = {|\ndispatch: (action: NavAction) => boolean,\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/thread-screen-tracker.react.js", "new_path": "native/navigation/thread-screen-tracker.react.js", "diff": "@@ -6,7 +6,7 @@ import { useDispatch } from 'react-redux';\nimport { useActiveMessageList } from './nav-selectors';\nimport { updateThreadLastNavigatedActionType } from '../redux/action-types';\n-function ThreadScreenTracker() {\n+const ThreadScreenTracker = React.memo<{||}>(() => {\nconst activeThread = useActiveMessageList();\nconst reduxDispatch = useDispatch();\n@@ -23,6 +23,7 @@ function ThreadScreenTracker() {\n}, [activeThread, reduxDispatch]);\nreturn null;\n-}\n+});\n+ThreadScreenTracker.displayName = 'ThreadScreenTracker';\nexport default ThreadScreenTracker;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Use React.memo for all navigation handler hooks
129,187
02.04.2020 14:03:48
14,400
6e9d7864bb451a2db7ebc65299aeed2e7f02fe49
[native] Use global nav context in fixUnreadActiveThread
[ { "change_type": "MODIFY", "old_path": "native/redux/redux-setup.js", "new_path": "native/redux/redux-setup.js", "diff": "@@ -83,6 +83,7 @@ import {\n} from '../utils/url-utils';\nimport reactotron from '../reactotron';\nimport reduceDrafts from '../reducers/draft-reducer';\n+import { getGlobalNavContext } from '../navigation/icky-global';\nexport type AppState = {|\nnavInfo: NavInfo,\n@@ -322,7 +323,7 @@ function reducer(state: AppState = defaultState, action: *) {\n};\n}\n- return validateState(state, action);\n+ return fixUnreadActiveThread(state, action);\n}\nfunction sessionInvalidationAlert(payload: SetSessionPayload) {\n@@ -350,11 +351,16 @@ function sessionInvalidationAlert(payload: SetSessionPayload) {\n}\n}\n-function validateState(state: AppState, action: *): AppState {\n- const activeThread = activeMessageListSelector({\n- state: state.navInfo.navigationState,\n- dispatch: () => true,\n- });\n+// Makes sure a currently focused thread is never unread. Note that we consider\n+// a backgrounded NativeAppState to actually be active if it last changed to\n+// inactive more than 10 seconds ago. This is because there is a delay when\n+// NativeAppState is updating in response to a foreground, and actions don't get\n+// processed more than 10 seconds after a backgrounding anyways. However we\n+// don't consider this for action types that can be expected to happen while the\n+// app is backgrounded.\n+function fixUnreadActiveThread(state: AppState, action: *): AppState {\n+ const navContext = getGlobalNavContext();\n+ const activeThread = activeMessageListSelector(navContext);\nif (\nactiveThread &&\n(NativeAppState.currentState === 'active' ||\n@@ -363,13 +369,6 @@ function validateState(state: AppState, action: *): AppState {\nstate.threadStore.threadInfos[activeThread] &&\nstate.threadStore.threadInfos[activeThread].currentUser.unread\n) {\n- // Makes sure a currently focused thread is never unread. Note that we\n- // consider a backgrounded NativeAppState to actually be active if it last\n- // changed to inactive more than 10 seconds ago. This is because there is a\n- // delay when NativeAppState is updating in response to a foreground, and\n- // actions don't get processed more than 10 seconds after a backgrounding\n- // anyways. However we don't consider this for action types that can be\n- // expected to happen while the app is backgrounded.\nstate = {\n...state,\nthreadStore: {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Use global nav context in fixUnreadActiveThread
129,187
02.04.2020 15:23:27
14,400
6b50aa9804b271c35425be07da626b0974b00d4b
[native] Use global NavContext for displayActionResultModal
[ { "change_type": "MODIFY", "old_path": "native/navigation/action-result-modal.js", "new_path": "native/navigation/action-result-modal.js", "diff": "// @flow\nimport { NavigationActions } from 'react-navigation';\n+import invariant from 'invariant';\n-import { dispatch } from '../redux/redux-setup';\nimport { ActionResultModalRouteName } from './route-names';\n+import { getGlobalNavContext } from './icky-global';\nfunction displayActionResultModal(message: string) {\n- dispatch({\n- // We do this for Flow\n- ...NavigationActions.navigate({\n+ const navContext = getGlobalNavContext();\n+ invariant(navContext, 'navContext should be set in displayActionResultModal');\n+ navContext.dispatch(\n+ NavigationActions.navigate({\nrouteName: ActionResultModalRouteName,\nparams: { message },\n}),\n- });\n+ );\n}\nexport { displayActionResultModal };\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Use global NavContext for displayActionResultModal
129,187
03.04.2020 12:22:56
14,400
05e0b1d0088c7b53edc09bba435a8eb27ecb34c8
[native] Add presentedFrom nav param to all modals
[ { "change_type": "MODIFY", "old_path": "native/calendar/calendar.react.js", "new_path": "native/calendar/calendar.react.js", "diff": "@@ -168,6 +168,9 @@ class Calendar extends React.PureComponent<Props, State> {\nstatic propTypes = {\nnavigation: PropTypes.shape({\nnavigate: PropTypes.func.isRequired,\n+ state: PropTypes.shape({\n+ key: PropTypes.string.isRequired,\n+ }),\n}).isRequired,\nlistData: PropTypes.arrayOf(\nPropTypes.oneOfType([\n@@ -705,6 +708,7 @@ class Calendar extends React.PureComponent<Props, State> {\nonAdd = (dayString: string) => {\nthis.props.navigation.navigate(ThreadPickerModalRouteName, {\n+ presentedFrom: this.props.navigation.state.key,\ndateString: dayString,\n});\n};\n" }, { "change_type": "MODIFY", "old_path": "native/calendar/thread-picker-modal.react.js", "new_path": "native/calendar/thread-picker-modal.react.js", "diff": "@@ -31,6 +31,7 @@ const Modal = createModal(ThreadPickerModalRouteName);\ntype NavProp = NavigationScreenProp<{|\n...NavigationLeafRoute,\nparams: {|\n+ presentedFrom: string,\ndateString: string,\n|},\n|}>;\n" }, { "change_type": "MODIFY", "old_path": "native/chat/chat-input-bar.react.js", "new_path": "native/chat/chat-input-bar.react.js", "diff": "@@ -499,7 +499,10 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nthis.dismissKeyboard();\nthis.props.navigation.navigate({\nrouteName: CameraModalRouteName,\n- params: { threadID: this.props.threadInfo.id },\n+ params: {\n+ presentedFrom: this.props.navigation.state.key,\n+ threadID: this.props.threadInfo.id,\n+ },\n});\n};\n" }, { "change_type": "MODIFY", "old_path": "native/chat/multimedia-message-multimedia.react.js", "new_path": "native/chat/multimedia-message-multimedia.react.js", "diff": "@@ -194,7 +194,12 @@ class MultimediaMessageMultimedia extends React.PureComponent<Props, State> {\nconst coordinates = { x: pageX, y: pageY, width, height };\nthis.props.navigation.navigate({\nrouteName: MultimediaModalRouteName,\n- params: { mediaInfo, initialCoordinates: coordinates, verticalBounds },\n+ params: {\n+ presentedFrom: this.props.navigation.state.key,\n+ mediaInfo,\n+ initialCoordinates: coordinates,\n+ verticalBounds,\n+ },\n});\nthis.setState({ hidden: true });\n});\n@@ -262,6 +267,7 @@ class MultimediaMessageMultimedia extends React.PureComponent<Props, State> {\nthis.props.navigation.navigate({\nrouteName: MultimediaTooltipModalRouteName,\nparams: {\n+ presentedFrom: this.props.navigation.state.key,\nmediaInfo,\nitem,\ninitialCoordinates: coordinates,\n" }, { "change_type": "MODIFY", "old_path": "native/chat/settings/add-users-modal.react.js", "new_path": "native/chat/settings/add-users-modal.react.js", "diff": "@@ -61,6 +61,7 @@ const Modal = createModal(AddUsersModalRouteName);\ntype NavProp = NavigationScreenProp<{|\n...NavigationLeafRoute,\nparams: {|\n+ presentedFrom: string,\nthreadInfo: ThreadInfo,\n|},\n|}>;\n" }, { "change_type": "MODIFY", "old_path": "native/chat/settings/color-picker-modal.react.js", "new_path": "native/chat/settings/color-picker-modal.react.js", "diff": "@@ -27,7 +27,7 @@ import {\n} from 'lib/actions/thread-actions';\nimport { createModal } from '../../components/modal.react';\n-import { AddUsersModalRouteName } from '../../navigation/route-names';\n+import { ColorPickerModalRouteName } from '../../navigation/route-names';\nimport ColorPicker from '../../components/color-picker.react';\nimport {\ntype Colors,\n@@ -37,10 +37,11 @@ import {\n} from '../../themes/colors';\nimport { dimensionsSelector } from '../../selectors/dimension-selectors';\n-const Modal = createModal(AddUsersModalRouteName);\n+const Modal = createModal(ColorPickerModalRouteName);\ntype NavProp = NavigationScreenProp<{|\n...NavigationLeafRoute,\nparams: {|\n+ presentedFrom: string,\ncolor: string,\nthreadInfo: ThreadInfo,\nsetColor: (color: string) => void,\n" }, { "change_type": "MODIFY", "old_path": "native/chat/settings/compose-subthread-modal.react.js", "new_path": "native/chat/settings/compose-subthread-modal.react.js", "diff": "@@ -38,6 +38,7 @@ const Modal = createModal(ComposeSubthreadModalRouteName);\ntype NavProp = NavigationScreenProp<{|\n...NavigationLeafRoute,\nparams: {|\n+ presentedFrom: string,\nthreadInfo: ThreadInfo,\n|},\n|}>;\n" }, { "change_type": "MODIFY", "old_path": "native/chat/settings/thread-settings-color.react.js", "new_path": "native/chat/settings/thread-settings-color.react.js", "diff": "@@ -31,6 +31,7 @@ type Props = {|\nsetColorEditValue: (color: string) => void,\ncanChangeSettings: boolean,\nnavigate: Navigate,\n+ threadSettingsRouteKey: string,\n// Redux state\nloadingStatus: LoadingStatus,\ncolors: Colors,\n@@ -43,6 +44,7 @@ class ThreadSettingsColor extends React.PureComponent<Props> {\nsetColorEditValue: PropTypes.func.isRequired,\ncanChangeSettings: PropTypes.bool.isRequired,\nnavigate: PropTypes.func.isRequired,\n+ threadSettingsRouteKey: PropTypes.string.isRequired,\nloadingStatus: loadingStatusPropType.isRequired,\ncolors: colorsPropType.isRequired,\nstyles: PropTypes.objectOf(PropTypes.object).isRequired,\n@@ -85,6 +87,7 @@ class ThreadSettingsColor extends React.PureComponent<Props> {\nthis.props.navigate({\nrouteName: ColorPickerModalRouteName,\nparams: {\n+ presentedFrom: this.props.threadSettingsRouteKey,\ncolor: this.props.colorEditValue,\nthreadInfo: this.props.threadInfo,\nsetColor: this.props.setColorEditValue,\n" }, { "change_type": "MODIFY", "old_path": "native/chat/settings/thread-settings-member.react.js", "new_path": "native/chat/settings/thread-settings-member.react.js", "diff": "@@ -64,6 +64,7 @@ type Props = {|\nnavigate: Navigate,\nlastListItem: boolean,\nverticalBounds: ?VerticalBounds,\n+ threadSettingsRouteKey: string,\n// Redux state\nremoveUserLoadingStatus: LoadingStatus,\nchangeRoleLoadingStatus: LoadingStatus,\n@@ -82,6 +83,7 @@ class ThreadSettingsMember extends React.PureComponent<Props> {\nnavigate: PropTypes.func.isRequired,\nlastListItem: PropTypes.bool.isRequired,\nverticalBounds: verticalBoundsPropType,\n+ threadSettingsRouteKey: PropTypes.string.isRequired,\nremoveUserLoadingStatus: loadingStatusPropType.isRequired,\nchangeRoleLoadingStatus: loadingStatusPropType.isRequired,\ncolors: colorsPropType.isRequired,\n@@ -241,6 +243,7 @@ class ThreadSettingsMember extends React.PureComponent<Props> {\nthis.props.navigate({\nrouteName: ThreadSettingsMemberTooltipModalRouteName,\nparams: {\n+ presentedFrom: this.props.threadSettingsRouteKey,\ninitialCoordinates: coordinates,\nverticalBounds,\nvisibleEntryIDs: this.visibleEntryIDs(),\n" }, { "change_type": "MODIFY", "old_path": "native/chat/settings/thread-settings.react.js", "new_path": "native/chat/settings/thread-settings.react.js", "diff": "@@ -117,6 +117,7 @@ type ChatSettingsItem =\ncolorEditValue: string,\ncanChangeSettings: boolean,\nnavigate: Navigate,\n+ threadSettingsRouteKey: string,\n|}\n| {|\nitemType: 'description',\n@@ -167,6 +168,7 @@ type ChatSettingsItem =\nnavigate: Navigate,\nlastListItem: boolean,\nverticalBounds: ?VerticalBounds,\n+ threadSettingsRouteKey: string,\n|}\n| {|\nitemType: 'addMember',\n@@ -348,6 +350,7 @@ class ThreadSettings extends React.PureComponent<Props, State> {\ncolorEditValue: this.state.colorEditValue,\ncanChangeSettings,\nnavigate: this.props.navigation.navigate,\n+ threadSettingsRouteKey: this.props.navigation.state.key,\n});\nlistData.push({\nitemType: 'footer',\n@@ -502,6 +505,7 @@ class ThreadSettings extends React.PureComponent<Props, State> {\nnavigate: this.props.navigation.navigate,\nlastListItem: false,\nverticalBounds,\n+ threadSettingsRouteKey: this.props.navigation.state.key,\n}));\nlet memberItems;\nif (seeMoreMembers) {\n@@ -651,6 +655,7 @@ class ThreadSettings extends React.PureComponent<Props, State> {\nsetColorEditValue={this.setColorEditValue}\ncanChangeSettings={item.canChangeSettings}\nnavigate={item.navigate}\n+ threadSettingsRouteKey={item.threadSettingsRouteKey}\n/>\n);\n} else if (item.itemType === 'description') {\n@@ -698,6 +703,7 @@ class ThreadSettings extends React.PureComponent<Props, State> {\nnavigate={item.navigate}\nlastListItem={item.lastListItem}\nverticalBounds={item.verticalBounds}\n+ threadSettingsRouteKey={item.threadSettingsRouteKey}\n/>\n);\n} else if (item.itemType === 'addMember') {\n@@ -743,13 +749,17 @@ class ThreadSettings extends React.PureComponent<Props, State> {\nonPressComposeSubthread = () => {\nconst threadInfo = ThreadSettings.getThreadInfo(this.props);\nthis.props.navigation.navigate(ComposeSubthreadModalRouteName, {\n+ presentedFrom: this.props.navigation.state.key,\nthreadInfo,\n});\n};\nonPressAddMember = () => {\nconst threadInfo = ThreadSettings.getThreadInfo(this.props);\n- this.props.navigation.navigate(AddUsersModalRouteName, { threadInfo });\n+ this.props.navigation.navigate(AddUsersModalRouteName, {\n+ presentedFrom: this.props.navigation.state.key,\n+ threadInfo,\n+ });\n};\nonPressSeeMoreMembers = () => {\n" }, { "change_type": "MODIFY", "old_path": "native/chat/text-message.react.js", "new_path": "native/chat/text-message.react.js", "diff": "@@ -172,6 +172,7 @@ class TextMessage extends React.PureComponent<Props> {\nthis.props.navigation.navigate({\nrouteName: TextMessageTooltipModalRouteName,\nparams: {\n+ presentedFrom: this.props.navigation.state.key,\ninitialCoordinates: coordinates,\nverticalBounds,\nlocation,\n" }, { "change_type": "MODIFY", "old_path": "native/media/camera-modal.react.js", "new_path": "native/media/camera-modal.react.js", "diff": "@@ -225,6 +225,7 @@ function runIndicatorAnimation(\ntype NavProp = NavigationStackProp<{|\n...NavigationLeafRoute,\nparams: {|\n+ presentedFrom: string,\nthreadID: string,\n|},\n|}>;\n" }, { "change_type": "MODIFY", "old_path": "native/media/multimedia-modal.react.js", "new_path": "native/media/multimedia-modal.react.js", "diff": "@@ -177,6 +177,7 @@ function runDecay(\ntype NavProp = NavigationStackProp<{|\n...NavigationLeafRoute,\nparams: {|\n+ presentedFrom: string,\nmediaInfo: MediaInfo,\ninitialCoordinates: LayoutCoordinates,\nverticalBounds: VerticalBounds,\n" }, { "change_type": "MODIFY", "old_path": "native/more/custom-server-modal.react.js", "new_path": "native/more/custom-server-modal.react.js", "diff": "@@ -22,9 +22,15 @@ import { setCustomServer } from '../utils/url-utils';\nimport { styleSelector } from '../themes/colors';\nconst Modal = createModal(CustomServerModalRouteName);\n+type NavProp = NavigationScreenProp<{|\n+ ...NavigationLeafRoute,\n+ params: {|\n+ presentedFrom: string,\n+ |},\n+|}>;\ntype Props = {|\n- navigation: NavigationScreenProp<NavigationLeafRoute>,\n+ navigation: NavProp,\n// Redux state\nurlPrefix: string,\ncustomServer: ?string,\n" }, { "change_type": "MODIFY", "old_path": "native/more/dev-tools.react.js", "new_path": "native/more/dev-tools.react.js", "diff": "@@ -47,6 +47,9 @@ class DevTools extends React.PureComponent<Props> {\nstatic propTypes = {\nnavigation: PropTypes.shape({\nnavigate: PropTypes.func.isRequired,\n+ state: PropTypes.shape({\n+ key: PropTypes.string.isRequired,\n+ }),\n}).isRequired,\nurlPrefix: PropTypes.string.isRequired,\ncustomServer: PropTypes.string,\n@@ -178,7 +181,9 @@ class DevTools extends React.PureComponent<Props> {\n};\nonSelectCustomServer = () => {\n- this.props.navigation.navigate(CustomServerModalRouteName);\n+ this.props.navigation.navigate(CustomServerModalRouteName, {\n+ presentedFrom: this.props.navigation.state.key,\n+ });\n};\n}\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/tooltip.react.js", "new_path": "native/navigation/tooltip.react.js", "diff": "@@ -58,6 +58,7 @@ type NavProp<CustomProps> = NavigationStackProp<{|\n...NavigationLeafRoute,\nparams: {\n...$Exact<CustomProps>,\n+ presentedFrom: string,\ninitialCoordinates: LayoutCoordinates,\nverticalBounds: VerticalBounds,\nlocation?: 'above' | 'below',\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Add presentedFrom nav param to all modals
129,187
03.04.2020 11:38:56
14,400
bd8cbc2f5fc3529435dc3f75802082a14b7651ed
[native] Set isTransitioning correctly on custom routers
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-router.js", "new_path": "native/chat/chat-router.js", "diff": "@@ -62,17 +62,18 @@ function ChatRouter(\nif (!lastState) {\nreturn lastState;\n}\n- const lastActiveKey = lastState.routes[lastState.index].key;\nconst newState = removeScreensFromStack(\nlastState,\n(route: NavigationRoute) =>\nrouteNames.includes(route.routeName) ? 'remove' : 'keep',\n);\n- const newActiveKey = newState.routes[newState.index].key;\n- if (lastActiveKey === newActiveKey) {\n- return newState;\n- }\n- return { ...newState, isTransitioning: true };\n+ const isTransitioning =\n+ lastState.routes[lastState.index].key !==\n+ newState.routes[newState.index].key;\n+ return {\n+ ...newState,\n+ isTransitioning,\n+ };\n} else if (action.type === 'REPLACE_WITH_THREAD') {\nconst { threadInfo } = action;\nif (!lastState) {\n@@ -88,23 +89,37 @@ function ChatRouter(\nkey: `${MessageListRouteName}${threadInfo.id}`,\nparams: { threadInfo },\n});\n- return stackRouter.getStateForAction(navigateAction, clearedState);\n+ const newState = stackRouter.getStateForAction(\n+ navigateAction,\n+ clearedState,\n+ );\n+ if (!newState) {\n+ return newState;\n+ }\n+ const isTransitioning =\n+ lastState.routes[lastState.index].key !==\n+ newState.routes[newState.index].key;\n+ return {\n+ ...newState,\n+ isTransitioning,\n+ };\n} else if (action.type === 'CLEAR_THREADS') {\nconst threadIDs = new Set(action.threadIDs);\nif (!lastState) {\nreturn lastState;\n}\n- const lastActiveKey = lastState.routes[lastState.index].key;\nconst newState = removeScreensFromStack(\nlastState,\n(route: NavigationRoute) =>\nthreadIDs.has(getThreadIDFromRoute(route)) ? 'remove' : 'keep',\n);\n- const newActiveKey = newState.routes[newState.index].key;\n- if (lastActiveKey === newActiveKey) {\n- return newState;\n- }\n- return { ...newState, isTransitioning: true };\n+ const isTransitioning =\n+ lastState.routes[lastState.index].key !==\n+ newState.routes[newState.index].key;\n+ return {\n+ ...newState,\n+ isTransitioning,\n+ };\n} else if (action.type === 'PUSH_NEW_THREAD') {\nconst { threadInfo } = action;\nif (!lastState) {\n@@ -120,7 +135,20 @@ function ChatRouter(\nkey: `${MessageListRouteName}${threadInfo.id}`,\nparams: { threadInfo },\n});\n- return stackRouter.getStateForAction(navigateAction, clearedState);\n+ const newState = stackRouter.getStateForAction(\n+ navigateAction,\n+ clearedState,\n+ );\n+ if (!newState) {\n+ return newState;\n+ }\n+ const isTransitioning =\n+ lastState.routes[lastState.index].key !==\n+ newState.routes[newState.index].key;\n+ return {\n+ ...newState,\n+ isTransitioning,\n+ };\n} else {\nreturn stackRouter.getStateForAction(action, lastState);\n}\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/root-router.js", "new_path": "native/navigation/root-router.js", "diff": "@@ -52,9 +52,12 @@ function RootRouter(\nif (newState === lastState) {\nreturn lastState;\n}\n+ const isTransitioning =\n+ lastState.routes[lastState.index].key !==\n+ newState.routes[newState.index].key;\nreturn {\n...newState,\n- isTransitioning: true,\n+ isTransitioning,\n};\n} else if (action.type === 'LOG_OUT') {\nif (!lastState) {\n@@ -63,7 +66,6 @@ function RootRouter(\nlet newState = { ...lastState };\nnewState.routes[0] = defaultNavInfo.navigationState.routes[0];\n- const initialKey = newState.routes[newState.index].key;\nlet loggedOutModalFound = false;\nnewState = removeScreensFromStack(\nnewState,\n@@ -79,8 +81,6 @@ function RootRouter(\n},\n);\n- let isTransitioning =\n- newState.routes[newState.index].key === initialKey;\nif (!loggedOutModalFound) {\nconst [appRoute, ...restRoutes] = newState.routes;\nnewState = {\n@@ -92,19 +92,15 @@ function RootRouter(\n...restRoutes,\n],\n};\n- if (newState.index === 1) {\n- isTransitioning = true;\n- }\n}\n- if (isTransitioning) {\n- newState = {\n+ const isTransitioning =\n+ lastState.routes[lastState.index].key !==\n+ newState.routes[newState.index].key;\n+ return {\n...newState,\nisTransitioning,\n};\n- }\n-\n- return newState;\n} else {\nreturn stackRouter.getStateForAction(action, lastState);\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Set isTransitioning correctly on custom routers
129,187
03.04.2020 12:27:03
14,400
908f44b5aa2b4b03ca7d47e180e8ab38743e391b
[native] Specify preserveFocus on actions that clear chat screens
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-router.js", "new_path": "native/chat/chat-router.js", "diff": "@@ -25,6 +25,7 @@ import {\ntype ClearScreensAction = {|\n+type: 'CLEAR_SCREENS',\n+routeNames: $ReadOnlyArray<string>,\n+ +preserveFocus?: boolean,\n|};\ntype ReplaceWithThreadAction = {|\n+type: 'REPLACE_WITH_THREAD',\n@@ -33,6 +34,7 @@ type ReplaceWithThreadAction = {|\ntype ClearThreadsAction = {|\n+type: 'CLEAR_THREADS',\n+threadIDs: $ReadOnlyArray<string>,\n+ +preserveFocus?: boolean,\n|};\ntype PushNewThreadAction = {|\n+type: 'PUSH_NEW_THREAD',\n@@ -155,17 +157,25 @@ function ChatRouter(\n},\ngetActionCreators: (route: NavigationRoute, navStateKey: ?string) => ({\n...stackRouter.getActionCreators(route, navStateKey),\n- clearScreens: (routeNames: $ReadOnlyArray<string>) => ({\n+ clearScreens: (\n+ routeNames: $ReadOnlyArray<string>,\n+ preserveFocus: boolean,\n+ ) => ({\ntype: 'CLEAR_SCREENS',\nrouteNames,\n+ preserveFocus,\n}),\nreplaceWithThread: (threadInfo: ThreadInfo) => ({\ntype: 'REPLACE_WITH_THREAD',\nthreadInfo,\n}),\n- clearThreads: (threadIDs: $ReadOnlyArray<string>) => ({\n+ clearThreads: (\n+ threadIDs: $ReadOnlyArray<string>,\n+ preserveFocus: boolean,\n+ ) => ({\ntype: 'CLEAR_THREADS',\nthreadIDs,\n+ preserveFocus,\n}),\npushNewThread: (threadInfo: ThreadInfo) => ({\ntype: 'PUSH_NEW_THREAD',\n" }, { "change_type": "MODIFY", "old_path": "native/chat/chat.react.js", "new_path": "native/chat/chat.react.js", "diff": "@@ -41,9 +41,15 @@ import MessageStorePruner from './message-store-pruner.react';\nimport ThreadScreenPruner from './thread-screen-pruner.react';\nexport type ChatNavProp<State> = NavigationStackProp<State> & {\n- clearScreens: (routeNames: $ReadOnlyArray<string>) => void,\n+ clearScreens: (\n+ routeNames: $ReadOnlyArray<string>,\n+ preserveFocus: boolean,\n+ ) => void,\nreplaceWithThread: (threadInfo: ThreadInfo) => void,\n- clearThreads: (threadIDs: $ReadOnlyArray<string>) => void,\n+ clearThreads: (\n+ threadIDs: $ReadOnlyArray<string>,\n+ preserveFocus: boolean,\n+ ) => void,\npushNewThread: (threadInfo: ThreadInfo) => void,\n};\ntype Props = {| navigation: ChatNavProp<NavigationState> |};\n@@ -132,7 +138,7 @@ function WrappedChatNavigator(props: Props) {\nconst chatInputState = React.useContext(ChatInputStateContext);\nconst clearScreens = React.useCallback(\n- () => navigation.clearScreens([ComposeThreadRouteName]),\n+ () => navigation.clearScreens([ComposeThreadRouteName], true),\n[navigation],\n);\n" }, { "change_type": "MODIFY", "old_path": "native/chat/thread-screen-pruner.react.js", "new_path": "native/chat/thread-screen-pruner.react.js", "diff": "@@ -13,7 +13,7 @@ import {\n} from '../utils/navigation-utils';\nimport { useActiveThread } from '../navigation/nav-selectors';\n-function ThreadScreenPruner() {\n+const ThreadScreenPruner = React.memo<{||}>(() => {\nconst rawThreadInfos = useSelector(\n(state: AppState) => state.threadStore.threadInfos,\n);\n@@ -70,10 +70,12 @@ function ThreadScreenPruner() {\nnavContext.dispatch({\ntype: 'CLEAR_THREADS',\nthreadIDs: pruneThreadIDs,\n+ preserveFocus: true,\n});\n}, [pruneThreadIDs, navContext, activeThreadID]);\nreturn null;\n-}\n+});\n+ThreadScreenPruner.displayName = 'ThreadScreenPruner';\nexport default ThreadScreenPruner;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Specify preserveFocus on actions that clear chat screens
129,187
03.04.2020 12:28:53
14,400
96ee45a1cb9797713c5dd850aa41cf25d45183b0
[native] Dismiss modals when their presenting screens are removed
[ { "change_type": "ADD", "old_path": null, "new_path": "native/navigation/modal-pruner.react.js", "diff": "+// @flow\n+\n+import type { NavContextType } from './navigation-context';\n+import type { NavigationState, NavigationRoute } from 'react-navigation';\n+\n+import * as React from 'react';\n+import invariant from 'invariant';\n+\n+import { AppRouteName } from './route-names';\n+\n+type DependencyInfo = {|\n+ status: 'missing' | 'resolved' | 'unresolved',\n+ presenter: ?string,\n+ presenting: string[],\n+ parentRouteName: ?string,\n+|};\n+function collectDependencyInfo(\n+ route: NavigationState | NavigationRoute,\n+ dependencyMap?: Map<string, DependencyInfo> = new Map(),\n+ parentRouteName?: ?string,\n+): Map<string, DependencyInfo> {\n+ if (route.key && typeof route.key === 'string') {\n+ const key = route.key;\n+ const presenter =\n+ route.params && route.params.presentedFrom\n+ ? route.params.presentedFrom\n+ : null;\n+ invariant(\n+ presenter === null || typeof presenter === 'string',\n+ 'presentedFrom should be a string',\n+ );\n+ let status = 'resolved';\n+ if (presenter) {\n+ const presenterInfo = dependencyMap.get(presenter);\n+ if (!presenterInfo) {\n+ status = 'unresolved';\n+ dependencyMap.set(presenter, {\n+ status: 'missing',\n+ presenter: undefined,\n+ presenting: [key],\n+ parentRouteName: undefined,\n+ });\n+ } else if (presenterInfo) {\n+ status = presenterInfo.status;\n+ presenterInfo.presenting.push(key);\n+ }\n+ }\n+ const existingInfo = dependencyMap.get(key);\n+ const presenting = existingInfo ? existingInfo.presenting : [];\n+ dependencyMap.set(key, {\n+ status,\n+ presenter,\n+ presenting,\n+ parentRouteName,\n+ });\n+ if (status === 'resolved') {\n+ const toResolve = [...presenting];\n+ while (toResolve.length > 0) {\n+ const presentee = toResolve.pop();\n+ const dependencyInfo = dependencyMap.get(presentee);\n+ invariant(dependencyInfo, 'could not find presentee');\n+ dependencyInfo.status = 'resolved';\n+ toResolve.push(...dependencyInfo.presenting);\n+ }\n+ }\n+ }\n+ const routeName =\n+ route.routeName && typeof route.routeName === 'string'\n+ ? route.routeName\n+ : undefined;\n+ if (route.routes) {\n+ route.routes.forEach(child =>\n+ collectDependencyInfo(child, dependencyMap, routeName),\n+ );\n+ }\n+ return dependencyMap;\n+}\n+\n+type Props = {|\n+ navContext: NavContextType,\n+|};\n+function ModalPruner(props: Props) {\n+ const { state, dispatch } = props.navContext;\n+\n+ const [pruneRootModals, pruneOverlayModals] = React.useMemo(() => {\n+ const dependencyMap = collectDependencyInfo(state);\n+ const rootModals = [],\n+ overlayModals = [];\n+ for (let [key, info] of dependencyMap) {\n+ if (info.status !== 'unresolved') {\n+ continue;\n+ }\n+ if (!info.parentRouteName) {\n+ rootModals.push(key);\n+ } else if (info.parentRouteName === AppRouteName) {\n+ overlayModals.push(key);\n+ }\n+ }\n+ return [rootModals, overlayModals];\n+ }, [state]);\n+\n+ React.useEffect(() => {\n+ if (pruneRootModals.length > 0) {\n+ dispatch({\n+ type: 'CLEAR_ROOT_MODALS',\n+ keys: pruneRootModals,\n+ preserveFocus: true,\n+ });\n+ }\n+ if (pruneOverlayModals.length > 0) {\n+ dispatch({\n+ type: 'CLEAR_OVERLAY_MODALS',\n+ keys: pruneOverlayModals,\n+ preserveFocus: true,\n+ });\n+ }\n+ }, [dispatch, pruneRootModals, pruneOverlayModals]);\n+\n+ return null;\n+}\n+\n+export default ModalPruner;\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/navigation-context.js", "new_path": "native/navigation/navigation-context.js", "diff": "import type { NavigationState, NavigationAction } from 'react-navigation';\nimport type { RootRouterNavigationAction } from './root-router';\nimport type { ChatRouterNavigationAction } from '../chat/chat-router';\n+import type { OverlayRouterNavigationAction } from './overlay-router';\nimport * as React from 'react';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\n@@ -11,7 +12,8 @@ import PropTypes from 'prop-types';\nexport type NavAction =\n| NavigationAction\n| RootRouterNavigationAction\n- | ChatRouterNavigationAction;\n+ | ChatRouterNavigationAction\n+ | OverlayRouterNavigationAction;\nexport type NavContextType = {|\nstate: NavigationState,\ndispatch: (action: NavAction) => boolean,\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/navigation-handler.react.js", "new_path": "native/navigation/navigation-handler.react.js", "diff": "@@ -9,6 +9,7 @@ import { NavContext, type NavAction } from './navigation-context';\nimport { useIsAppLoggedIn } from './nav-selectors';\nimport LinkingHandler from './linking-handler.react';\nimport ThreadScreenTracker from './thread-screen-tracker.react';\n+import ModalPruner from './modal-pruner.react';\nconst NavigationHandler = React.memo<{||}>(() => {\nconst navContext = React.useContext(NavContext);\n@@ -24,6 +25,7 @@ const NavigationHandler = React.memo<{||}>(() => {\n<LogInHandler dispatch={dispatch} />\n<LinkingHandler dispatch={dispatch} />\n<ThreadScreenTracker />\n+ <ModalPruner navContext={navContext} />\n</>\n);\n});\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/overlay-navigator.react.js", "new_path": "native/navigation/overlay-navigator.react.js", "diff": "@@ -18,11 +18,13 @@ import {\nAnimated as BaseAnimated,\nEasing as BaseEasing,\n} from 'react-native';\n-import { StackRouter, createNavigator, StackActions } from 'react-navigation';\n+import { createNavigator, StackActions } from 'react-navigation';\nimport { Transitioner } from 'react-navigation-stack';\nimport Animated, { Easing } from 'react-native-reanimated';\nimport PropTypes from 'prop-types';\n+import OverlayRouter from './overlay-router';\n+\nconst OverlayPositionContext: React.Context<Animated.Value> = React.createContext(\nnull,\n);\n@@ -53,7 +55,7 @@ function createOverlayNavigator(\nOverlayNavigatorProps,\n>(\nOverlayNavigator,\n- StackRouter(routeConfigMap, stackRouterConfig),\n+ OverlayRouter(routeConfigMap, stackRouterConfig),\nstackConfig,\n);\n}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/navigation/overlay-router.js", "diff": "+// @flow\n+\n+import {\n+ StackRouter,\n+ type NavigationAction,\n+ type NavigationState,\n+ type NavigationRoute,\n+ type NavigationRouteConfigMap,\n+ type NavigationStackRouterConfig,\n+} from 'react-navigation';\n+\n+import { removeScreensFromStack } from '../utils/navigation-utils';\n+\n+type ClearOverlayModalsAction = {|\n+ +type: 'CLEAR_OVERLAY_MODALS',\n+ +keys: $ReadOnlyArray<string>,\n+ +preserveFocus?: boolean,\n+|};\n+export type OverlayRouterNavigationAction =\n+ | NavigationAction\n+ | ClearOverlayModalsAction;\n+\n+const defaultConfig = Object.freeze({});\n+function OverlayRouter(\n+ routeConfigMap: NavigationRouteConfigMap,\n+ stackConfig?: NavigationStackRouterConfig = defaultConfig,\n+) {\n+ const stackRouter = StackRouter(routeConfigMap, stackConfig);\n+ return {\n+ ...stackRouter,\n+ getStateForAction: (\n+ action: OverlayRouterNavigationAction,\n+ lastState: ?NavigationState,\n+ ) => {\n+ if (action.type === 'CLEAR_OVERLAY_MODALS') {\n+ const { keys } = action;\n+ if (!lastState) {\n+ return lastState;\n+ }\n+ const newState = removeScreensFromStack(\n+ lastState,\n+ (route: NavigationRoute) =>\n+ keys.includes(route.key) ? 'remove' : 'keep',\n+ );\n+ if (newState === lastState) {\n+ return lastState;\n+ }\n+ const isTransitioning =\n+ lastState.routes[lastState.index].key !==\n+ newState.routes[newState.index].key;\n+ return {\n+ ...newState,\n+ isTransitioning,\n+ };\n+ } else {\n+ return stackRouter.getStateForAction(action, lastState);\n+ }\n+ },\n+ getActionCreators: (route: NavigationRoute, navStateKey: ?string) => ({\n+ ...stackRouter.getActionCreators(route, navStateKey),\n+ clearOverlayModals: (\n+ keys: $ReadOnlyArray<string>,\n+ preserveFocus: boolean,\n+ ) => ({\n+ type: 'CLEAR_OVERLAY_MODALS',\n+ keys,\n+ preserveFocus,\n+ }),\n+ }),\n+ };\n+}\n+\n+export default OverlayRouter;\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/root-router.js", "new_path": "native/navigation/root-router.js", "diff": "@@ -23,10 +23,16 @@ type LogInAction = {|\ntype LogOutAction = {|\n+type: 'LOG_OUT',\n|};\n+type ClearRootModalsAction = {|\n+ +type: 'CLEAR_ROOT_MODALS',\n+ +keys: $ReadOnlyArray<string>,\n+ +preserveFocus?: boolean,\n+|};\nexport type RootRouterNavigationAction =\n| NavigationAction\n| LogInAction\n- | LogOutAction;\n+ | LogOutAction\n+ | ClearRootModalsAction;\nconst defaultConfig = Object.freeze({});\nfunction RootRouter(\n@@ -101,6 +107,26 @@ function RootRouter(\n...newState,\nisTransitioning,\n};\n+ } else if (action.type === 'CLEAR_ROOT_MODALS') {\n+ const { keys } = action;\n+ if (!lastState) {\n+ return lastState;\n+ }\n+ const newState = removeScreensFromStack(\n+ lastState,\n+ (route: NavigationRoute) =>\n+ keys.includes(route.key) ? 'remove' : 'keep',\n+ );\n+ if (newState === lastState) {\n+ return lastState;\n+ }\n+ const isTransitioning =\n+ lastState.routes[lastState.index].key ===\n+ newState.routes[newState.index].key;\n+ return {\n+ ...newState,\n+ isTransitioning,\n+ };\n} else {\nreturn stackRouter.getStateForAction(action, lastState);\n}\n@@ -109,6 +135,14 @@ function RootRouter(\n...stackRouter.getActionCreators(route, navStateKey),\nlogIn: () => ({ type: 'LOG_IN' }),\nlogOut: () => ({ type: 'LOG_OUT' }),\n+ clearRootModals: (\n+ keys: $ReadOnlyArray<string>,\n+ preserveFocus: boolean,\n+ ) => ({\n+ type: 'CLEAR_ROOT_MODALS',\n+ keys,\n+ preserveFocus,\n+ }),\n}),\n};\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Dismiss modals when their presenting screens are removed
129,187
03.04.2020 15:59:43
14,400
d96bab06043ab694ec21aad04e10d516082566f1
Allow ActionLogger to handle non-Redux actions
[ { "change_type": "MODIFY", "old_path": "lib/reducers/entry-reducer.js", "new_path": "lib/reducers/entry-reducer.js", "diff": "@@ -73,7 +73,7 @@ import {\n} from '../shared/entry-utils';\nimport { threadInFilterList } from '../shared/thread-utils';\nimport { getConfig } from '../utils/config';\n-import { reduxLogger } from '../utils/redux-logger';\n+import { actionLogger } from '../utils/action-logger';\nimport { values } from '../utils/objects';\nimport { sanitizeAction } from '../utils/sanitization';\n@@ -738,7 +738,7 @@ function findInconsistencies(\ncalendarQuery,\npollResult: oldResult,\npushResult: newResult,\n- lastActions: reduxLogger.interestingActionSummaries,\n+ lastActions: actionLogger.interestingActionSummaries,\ntime: Date.now(),\n},\n];\n" }, { "change_type": "MODIFY", "old_path": "lib/reducers/thread-reducer.js", "new_path": "lib/reducers/thread-reducer.js", "diff": "@@ -44,7 +44,7 @@ import {\n} from '../actions/thread-actions';\nimport { saveMessagesActionType } from '../actions/message-actions';\nimport { getConfig } from '../utils/config';\n-import { reduxLogger } from '../utils/redux-logger';\n+import { actionLogger } from '../utils/action-logger';\nimport { sanitizeAction } from '../utils/sanitization';\nfunction reduceThreadUpdates(\n@@ -128,7 +128,7 @@ function findInconsistencies(\naction: sanitizeAction(action),\npollResult: oldResult,\npushResult: newResult,\n- lastActions: reduxLogger.interestingActionSummaries,\n+ lastActions: actionLogger.interestingActionSummaries,\ntime: Date.now(),\n},\n];\n" }, { "change_type": "MODIFY", "old_path": "lib/socket/socket.react.js", "new_path": "lib/socket/socket.react.js", "diff": "@@ -72,7 +72,7 @@ import CalendarQueryHandler from './calendar-query-handler.react';\nimport ReportHandler from './report-handler.react';\nimport { updateActivityActionTypes } from '../actions/activity-actions';\nimport { unsupervisedBackgroundActionType } from '../reducers/foreground-reducer';\n-import { reduxLogger } from '../utils/redux-logger';\n+import { actionLogger } from '../utils/action-logger';\ntype Props = {|\ndetectUnsupervisedBackgroundRef?: (\n@@ -676,8 +676,8 @@ class Socket extends React.PureComponent<Props, State> {\nthis.props.connection.status !== 'connected' ||\n!this.messageLastReceived ||\nthis.messageLastReceived + serverRequestSocketTimeout >= Date.now() ||\n- (reduxLogger.mostRecentActionTime &&\n- reduxLogger.mostRecentActionTime + 3000 < Date.now())\n+ (actionLogger.mostRecentActionTime &&\n+ actionLogger.mostRecentActionTime + 3000 < Date.now())\n) {\nreturn false;\n}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "lib/utils/action-logger.js", "diff": "+// @flow\n+\n+import { rehydrateActionType } from '../types/redux-types';\n+import type { ActionSummary } from '../types/report-types';\n+\n+import inspect from 'util-inspect';\n+\n+import { saveDraftActionType } from '../actions/miscellaneous-action-types';\n+import { sanitizeAction } from './sanitization';\n+\n+const uninterestingActionTypes = new Set([\n+ saveDraftActionType,\n+ 'Navigation/COMPLETE_TRANSITION',\n+]);\n+const maxActionSummaryLength = 500;\n+\n+class ActionLogger {\n+ static n = 30;\n+ lastNActions = [];\n+ lastNStates = [];\n+ currentReduxState = undefined;\n+ currentOtherStates = {};\n+\n+ get preloadedState(): Object {\n+ return this.lastNStates[0].state;\n+ }\n+\n+ get actions(): Object[] {\n+ return this.lastNActions.map(({ action }) => action);\n+ }\n+\n+ get interestingActionSummaries(): ActionSummary[] {\n+ return this.lastNActions\n+ .filter(({ action }) => !uninterestingActionTypes.has(action.type))\n+ .map(({ action, time }) => ({\n+ type: action.type,\n+ time,\n+ summary: ActionLogger.getSummaryForAction(action),\n+ }));\n+ }\n+\n+ static getSummaryForAction(action: Object): string {\n+ const sanitized = sanitizeAction(action);\n+ let summary,\n+ length,\n+ depth = 3;\n+ do {\n+ summary = inspect(sanitized, { depth });\n+ length = summary.length;\n+ depth--;\n+ } while (length > maxActionSummaryLength && depth > 0);\n+ return summary;\n+ }\n+\n+ prepareForAction() {\n+ if (\n+ this.lastNActions.length > 0 &&\n+ this.lastNActions[this.lastNActions.length - 1].action.type ===\n+ rehydrateActionType\n+ ) {\n+ // redux-persist can't handle replaying REHYDRATE\n+ // https://github.com/rt2zz/redux-persist/issues/743\n+ this.lastNActions = [];\n+ this.lastNStates = [];\n+ }\n+ if (this.lastNActions.length === ActionLogger.n) {\n+ this.lastNActions.shift();\n+ this.lastNStates.shift();\n+ }\n+ }\n+\n+ addReduxAction(action: Object, beforeState: Object, afterState: Object) {\n+ this.prepareForAction();\n+\n+ if (this.currentReduxState === undefined) {\n+ for (let i = 0; i < this.lastNStates.length; i++) {\n+ this.lastNStates[i] = {\n+ ...this.lastNStates[i],\n+ state: {\n+ ...this.lastNStates[i].state,\n+ ...beforeState,\n+ },\n+ };\n+ }\n+ }\n+ this.currentReduxState = afterState;\n+\n+ const state = { ...beforeState };\n+ for (let stateKey in this.currentOtherStates) {\n+ state[stateKey] = this.currentOtherStates[stateKey];\n+ }\n+\n+ const time = Date.now();\n+ this.lastNActions.push({ action, time });\n+ this.lastNStates.push({ state, time });\n+ }\n+\n+ addOtherAction(\n+ key: string,\n+ action: Object,\n+ beforeState: Object,\n+ afterState: Object,\n+ ) {\n+ this.prepareForAction();\n+\n+ const currentState = this.currentOtherStates[key];\n+ if (currentState === undefined) {\n+ for (let i = 0; i < this.lastNStates.length; i++) {\n+ this.lastNStates[i] = {\n+ ...this.lastNStates[i],\n+ state: {\n+ ...this.lastNStates[i].state,\n+ [key]: beforeState,\n+ },\n+ };\n+ }\n+ }\n+ this.currentOtherStates[key] = afterState;\n+\n+ const state = {\n+ ...this.currentState,\n+ [key]: beforeState,\n+ };\n+\n+ const time = Date.now();\n+ this.lastNActions.push({ action, time });\n+ this.lastNStates.push({ state, time });\n+ }\n+\n+ get mostRecentActionTime(): ?number {\n+ if (this.lastNActions.length === 0) {\n+ return null;\n+ }\n+ return this.lastNActions[this.lastNActions.length - 1].time;\n+ }\n+\n+ get currentState(): Object {\n+ const state = this.currentReduxState ? { ...this.currentReduxState } : {};\n+ for (let stateKey in this.currentOtherStates) {\n+ state[stateKey] = this.currentOtherStates[stateKey];\n+ }\n+ return state;\n+ }\n+}\n+\n+const actionLogger = new ActionLogger();\n+\n+const reduxLoggerMiddleware = (store: *) => (next: *) => (action: *) => {\n+ const beforeState = store.getState();\n+ const result = next(action);\n+ const afterState = store.getState();\n+ actionLogger.addReduxAction(action, beforeState, afterState);\n+ return result;\n+};\n+\n+export { actionLogger, reduxLoggerMiddleware };\n" }, { "change_type": "DELETE", "old_path": "lib/utils/redux-logger.js", "new_path": null, "diff": "-// @flow\n-\n-import {\n- type AppState,\n- type BaseAction,\n- rehydrateActionType,\n-} from '../types/redux-types';\n-import type { ActionSummary } from '../types/report-types';\n-\n-import inspect from 'util-inspect';\n-\n-import { saveDraftActionType } from '../actions/miscellaneous-action-types';\n-import { sanitizeAction } from './sanitization';\n-\n-const uninterestingActionTypes = new Set([\n- saveDraftActionType,\n- 'Navigation/COMPLETE_TRANSITION',\n-]);\n-const maxActionSummaryLength = 500;\n-\n-class ReduxLogger {\n- static n = 30;\n- lastNActions = [];\n- lastNStates = [];\n-\n- get preloadedState(): AppState {\n- return this.lastNStates[0].state;\n- }\n-\n- get actions(): BaseAction[] {\n- return this.lastNActions.map(({ action }) => action);\n- }\n-\n- get interestingActionSummaries(): ActionSummary[] {\n- return this.lastNActions\n- .filter(({ action }) => !uninterestingActionTypes.has(action.type))\n- .map(({ action, time }) => ({\n- type: action.type,\n- time,\n- summary: ReduxLogger.getSummaryForAction(action),\n- }));\n- }\n-\n- static getSummaryForAction(action: BaseAction): string {\n- const sanitized = sanitizeAction(action);\n- let summary,\n- length,\n- depth = 3;\n- do {\n- summary = inspect(sanitized, { depth });\n- length = summary.length;\n- depth--;\n- } while (length > maxActionSummaryLength && depth > 0);\n- return summary;\n- }\n-\n- addAction(action: BaseAction, state: AppState) {\n- const time = Date.now();\n- const actionWithTime = { action, time };\n- const stateWithTime = { state, time };\n- if (\n- this.lastNActions.length > 0 &&\n- this.lastNActions[this.lastNActions.length - 1].action.type ===\n- rehydrateActionType\n- ) {\n- // redux-persist can't handle replaying REHYDRATE\n- // https://github.com/rt2zz/redux-persist/issues/743\n- this.lastNActions = [];\n- this.lastNStates = [];\n- }\n- if (this.lastNActions.length === ReduxLogger.n) {\n- this.lastNActions.shift();\n- this.lastNStates.shift();\n- }\n- this.lastNActions.push(actionWithTime);\n- this.lastNStates.push(stateWithTime);\n- }\n-\n- get mostRecentActionTime(): ?number {\n- if (this.lastNActions.length === 0) {\n- return null;\n- }\n- return this.lastNActions[this.lastNActions.length - 1].time;\n- }\n-}\n-\n-const reduxLogger = new ReduxLogger();\n-\n-const reduxLoggerMiddleware = (store: *) => (next: *) => (action: *) => {\n- // We want the state before the action\n- const state = store.getState();\n- reduxLogger.addAction(action, state);\n- return next(action);\n-};\n-\n-export { reduxLogger, reduxLoggerMiddleware };\n" }, { "change_type": "MODIFY", "old_path": "native/crash.react.js", "new_path": "native/crash.react.js", "diff": "@@ -33,13 +33,12 @@ import invariant from 'invariant';\nimport { connect } from 'lib/utils/redux-utils';\nimport { sendReportActionTypes, sendReport } from 'lib/actions/report-actions';\nimport sleep from 'lib/utils/sleep';\n-import { reduxLogger } from 'lib/utils/redux-logger';\n+import { actionLogger } from 'lib/utils/action-logger';\nimport { logOutActionTypes, logOut } from 'lib/actions/user-actions';\nimport { sanitizeAction, sanitizeState } from 'lib/utils/sanitization';\nimport { preRequestUserStateSelector } from 'lib/selectors/account-selectors';\nimport Button from './components/button.react';\n-import { store } from './redux/redux-setup';\nimport { persistConfig, codeVersion, getPersistor } from './redux/persist';\nconst errorTitles = ['Oh no!!', 'Womp womp womp...'];\n@@ -156,9 +155,9 @@ class Crash extends React.PureComponent<Props, State> {\nstack: data.error.stack,\ncomponentStack: data.info && data.info.componentStack,\n})),\n- preloadedState: sanitizeState(reduxLogger.preloadedState),\n- currentState: sanitizeState(store.getState()),\n- actions: reduxLogger.actions.map(sanitizeAction),\n+ preloadedState: sanitizeState(actionLogger.preloadedState),\n+ currentState: sanitizeState(actionLogger.currentState),\n+ actions: actionLogger.actions.map(sanitizeAction),\n});\nthis.setState({\nerrorReportID: result.id,\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/root-router.js", "new_path": "native/navigation/root-router.js", "diff": "@@ -9,6 +9,8 @@ import {\ntype NavigationStackRouterConfig,\n} from 'react-navigation';\n+import { actionLogger } from 'lib/utils/action-logger';\n+\nimport { removeScreensFromStack } from '../utils/navigation-utils';\nimport {\naccountModals,\n@@ -40,9 +42,7 @@ function RootRouter(\nstackConfig?: NavigationStackRouterConfig = defaultConfig,\n) {\nconst stackRouter = StackRouter(routeConfigMap, stackConfig);\n- return {\n- ...stackRouter,\n- getStateForAction: (\n+ const getStateForAction = (\naction: RootRouterNavigationAction,\nlastState: ?NavigationState,\n) => {\n@@ -73,19 +73,15 @@ function RootRouter(\nnewState.routes[0] = defaultNavInfo.navigationState.routes[0];\nlet loggedOutModalFound = false;\n- newState = removeScreensFromStack(\n- newState,\n- (route: NavigationRoute) => {\n+ newState = removeScreensFromStack(newState, (route: NavigationRoute) => {\nconst { routeName } = route;\nif (routeName === LoggedOutModalRouteName) {\nloggedOutModalFound = true;\n}\n- return routeName === AppRouteName ||\n- accountModals.includes(routeName)\n+ return routeName === AppRouteName || accountModals.includes(routeName)\n? 'keep'\n: 'remove';\n- },\n- );\n+ });\nif (!loggedOutModalFound) {\nconst [appRoute, ...restRoutes] = newState.routes;\n@@ -121,7 +117,7 @@ function RootRouter(\nreturn lastState;\n}\nconst isTransitioning =\n- lastState.routes[lastState.index].key ===\n+ lastState.routes[lastState.index].key !==\nnewState.routes[newState.index].key;\nreturn {\n...newState,\n@@ -130,6 +126,16 @@ function RootRouter(\n} else {\nreturn stackRouter.getStateForAction(action, lastState);\n}\n+ };\n+ return {\n+ ...stackRouter,\n+ getStateForAction: (\n+ action: RootRouterNavigationAction,\n+ lastState: ?NavigationState,\n+ ) => {\n+ const newState = getStateForAction(action, lastState);\n+ actionLogger.addOtherAction('navState', action, lastState, newState);\n+ return newState;\n},\ngetActionCreators: (route: NavigationRoute, navStateKey: ?string) => ({\n...stackRouter.getActionCreators(route, navStateKey),\n" }, { "change_type": "MODIFY", "old_path": "native/redux/redux-setup.js", "new_path": "native/redux/redux-setup.js", "diff": "@@ -50,7 +50,7 @@ import {\nimport Orientation from 'react-native-orientation-locker';\nimport baseReducer from 'lib/reducers/master-reducer';\n-import { reduxLoggerMiddleware } from 'lib/utils/redux-logger';\n+import { reduxLoggerMiddleware } from 'lib/utils/action-logger';\nimport { invalidSessionDowngrade } from 'lib/shared/account-utils';\nimport {\nlogOutActionTypes,\n" }, { "change_type": "MODIFY", "old_path": "web/root.js", "new_path": "web/root.js", "diff": "@@ -8,7 +8,7 @@ import { createStore, applyMiddleware, type Store } from 'redux';\nimport thunk from 'redux-thunk';\nimport { composeWithDevTools } from 'redux-devtools-extension/logOnlyInProduction';\n-import { reduxLoggerMiddleware } from 'lib/utils/redux-logger';\n+import { reduxLoggerMiddleware } from 'lib/utils/action-logger';\nimport { reducer } from './redux-setup';\nimport HotRoot from './hot';\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Allow ActionLogger to handle non-Redux actions
129,187
03.04.2020 16:59:08
14,400
43219bcaedbbc16842003a5998586d34070259f2
[native] Remove Redux integration for React Navigation
[ { "change_type": "MODIFY", "old_path": "native/navigation/default-state.js", "new_path": "native/navigation/default-state.js", "diff": "@@ -16,12 +16,9 @@ import {\nCalendarRouteName,\n} from './route-names';\n-export type NavInfo = {|\n- ...$Exact<BaseNavInfo>,\n- navigationState: NavigationState,\n-|};\n+export type NavInfo = $Exact<BaseNavInfo>;\n-const defaultNavigationState = {\n+const defaultNavigationState: NavigationState = {\nindex: 1,\nroutes: [\n{\n@@ -60,7 +57,6 @@ const defaultNavigationState = {\nconst defaultNavInfo: NavInfo = {\nstartDate: fifteenDaysEarlier().valueOf(),\nendDate: fifteenDaysLater().valueOf(),\n- navigationState: defaultNavigationState,\n};\n-export { defaultNavInfo };\n+export { defaultNavigationState, defaultNavInfo };\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/root-router.js", "new_path": "native/navigation/root-router.js", "diff": "@@ -9,15 +9,13 @@ import {\ntype NavigationStackRouterConfig,\n} from 'react-navigation';\n-import { actionLogger } from 'lib/utils/action-logger';\n-\nimport { removeScreensFromStack } from '../utils/navigation-utils';\nimport {\naccountModals,\nLoggedOutModalRouteName,\nAppRouteName,\n} from './route-names';\n-import { defaultNavInfo } from './default-state';\n+import { defaultNavigationState } from './default-state';\ntype LogInAction = {|\n+type: 'LOG_IN',\n@@ -42,7 +40,9 @@ function RootRouter(\nstackConfig?: NavigationStackRouterConfig = defaultConfig,\n) {\nconst stackRouter = StackRouter(routeConfigMap, stackConfig);\n- const getStateForAction = (\n+ return {\n+ ...stackRouter,\n+ getStateForAction: (\naction: RootRouterNavigationAction,\nlastState: ?NavigationState,\n) => {\n@@ -70,18 +70,22 @@ function RootRouter(\nreturn lastState;\n}\nlet newState = { ...lastState };\n- newState.routes[0] = defaultNavInfo.navigationState.routes[0];\n+ newState.routes[0] = defaultNavigationState.routes[0];\nlet loggedOutModalFound = false;\n- newState = removeScreensFromStack(newState, (route: NavigationRoute) => {\n+ newState = removeScreensFromStack(\n+ newState,\n+ (route: NavigationRoute) => {\nconst { routeName } = route;\nif (routeName === LoggedOutModalRouteName) {\nloggedOutModalFound = true;\n}\n- return routeName === AppRouteName || accountModals.includes(routeName)\n+ return routeName === AppRouteName ||\n+ accountModals.includes(routeName)\n? 'keep'\n: 'remove';\n- });\n+ },\n+ );\nif (!loggedOutModalFound) {\nconst [appRoute, ...restRoutes] = newState.routes;\n@@ -126,16 +130,6 @@ function RootRouter(\n} else {\nreturn stackRouter.getStateForAction(action, lastState);\n}\n- };\n- return {\n- ...stackRouter,\n- getStateForAction: (\n- action: RootRouterNavigationAction,\n- lastState: ?NavigationState,\n- ) => {\n- const newState = getStateForAction(action, lastState);\n- actionLogger.addOtherAction('navState', action, lastState, newState);\n- return newState;\n},\ngetActionCreators: (route: NavigationRoute, navStateKey: ?string) => ({\n...stackRouter.getActionCreators(route, navStateKey),\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"react-native-vector-icons\": \"^6.6.0\",\n\"react-native-video\": \"^5.0.2\",\n\"react-navigation\": \"^4.0.6\",\n- \"react-navigation-redux-helpers\": \"^4.0.0\",\n\"react-navigation-stack\": \"^1.10.2\",\n\"react-navigation-tabs\": \"^2.5.4\",\n\"react-redux\": \"^7.1.1\",\n" }, { "change_type": "MODIFY", "old_path": "native/redux/persist.js", "new_path": "native/redux/persist.js", "diff": "@@ -152,10 +152,19 @@ const migrations = {\n},\nqueuedReports: [],\n}),\n- [16]: state => ({\n+ [16]: state => {\n+ const result = {\n...state,\nmessageSentFromRoute: undefined,\n- }),\n+ };\n+ if (state.navInfo) {\n+ result.navInfo = {\n+ ...state.navInfo,\n+ navigationState: undefined,\n+ };\n+ }\n+ return result;\n+ },\n};\nconst persistConfig = {\n@@ -163,7 +172,7 @@ const persistConfig = {\nstorage: AsyncStorage,\nblacklist,\ndebug: __DEV__,\n- version: 15,\n+ version: 16,\nmigrate: createMigrate(migrations, { debug: __DEV__ }),\ntimeout: __DEV__ ? 0 : undefined,\n};\n" }, { "change_type": "MODIFY", "old_path": "native/redux/redux-setup.js", "new_path": "native/redux/redux-setup.js", "diff": "@@ -40,7 +40,6 @@ import type { SetSessionPayload } from 'lib/types/session-types';\nimport thunk from 'redux-thunk';\nimport { createStore, applyMiddleware, type Store, compose } from 'redux';\nimport { persistStore, persistReducer } from 'redux-persist';\n-import { createReactNavigationReduxMiddleware } from 'react-navigation-redux-helpers';\nimport {\nAppState as NativeAppState,\nPlatform,\n@@ -72,7 +71,6 @@ import {\nupdateThreadLastNavigatedActionType,\nbackgroundActionTypes,\n} from './action-types';\n-import RootNavigator from '../navigation/root-navigator.react';\nimport { type NavInfo, defaultNavInfo } from '../navigation/default-state';\nimport { reduceThreadIDsToNotifIDs } from '../push/reducer';\nimport { persistConfig, setPersistor } from './persist';\n@@ -309,20 +307,6 @@ function reducer(state: AppState = defaultState, action: *) {\ndrafts: reduceDrafts(state.drafts, action),\n};\n- const navigationState = RootNavigator.router.getStateForAction(\n- action,\n- state.navInfo.navigationState,\n- );\n- if (navigationState && navigationState !== state.navInfo.navigationState) {\n- state = {\n- ...state,\n- navInfo: {\n- ...state.navInfo,\n- navigationState,\n- },\n- };\n- }\n-\nreturn fixUnreadActiveThread(state, action);\n}\n@@ -394,13 +378,7 @@ function appBecameInactive() {\nappLastBecameInactive = Date.now();\n}\n-const middleware = applyMiddleware(\n- thunk,\n- createReactNavigationReduxMiddleware(\n- (state: AppState) => state.navInfo.navigationState,\n- ),\n- reduxLoggerMiddleware,\n-);\n+const middleware = applyMiddleware(thunk, reduxLoggerMiddleware);\nconst composeFunc = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\n? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\n: compose;\n" }, { "change_type": "MODIFY", "old_path": "native/root.react.js", "new_path": "native/root.react.js", "diff": "// @flow\n-import type { NavigationState } from 'react-navigation';\nimport { type GlobalTheme, globalThemePropType } from './types/themes';\n-import type { Dispatch } from 'lib/types/redux-types';\nimport type { AppState } from './redux/redux-setup';\nimport type { DispatchActionPayload } from 'lib/utils/action-utils';\nimport type { NavAction } from './navigation/navigation-context';\n@@ -16,17 +14,23 @@ import {\nView,\nStyleSheet,\n} from 'react-native';\n-import { createReduxContainer } from 'react-navigation-redux-helpers';\nimport PropTypes from 'prop-types';\nimport SplashScreen from 'react-native-splash-screen';\nimport Orientation from 'react-native-orientation-locker';\nimport { PersistGate } from 'redux-persist/integration/react';\n+import {\n+ type SupportedThemes,\n+ type NavigationState,\n+ createAppContainer,\n+ NavigationActions,\n+} from 'react-navigation';\nimport { connect } from 'lib/utils/redux-utils';\nimport {\nbackgroundActionType,\nforegroundActionType,\n} from 'lib/reducers/foreground-reducer';\n+import { actionLogger } from 'lib/utils/action-logger';\nimport RootNavigator from './navigation/root-navigator.react';\nimport { store, appBecameInactive } from './redux/redux-setup';\n@@ -46,22 +50,33 @@ import {\nimport { setGlobalNavContext } from './navigation/icky-global';\nimport { RootContext, type RootContextType } from './root-context';\nimport NavigationHandler from './navigation/navigation-handler.react';\n+import { defaultNavigationState } from './navigation/default-state';\nif (Platform.OS === 'android') {\nUIManager.setLayoutAnimationEnabledExperimental &&\nUIManager.setLayoutAnimationEnabledExperimental(true);\n}\n-const ReduxifiedRootNavigator = createReduxContainer(RootNavigator);\n-\n-type NativeDispatch = Dispatch & ((action: NavAction) => boolean);\n+type NavContainer = React.AbstractComponent<\n+ {|\n+ theme?: SupportedThemes | 'no-preference',\n+ loadNavigationState?: () => Promise<NavigationState>,\n+ onNavigationStateChange?: (\n+ prevState: NavigationState,\n+ state: NavigationState,\n+ action: NavAction,\n+ ) => void,\n+ |},\n+ {\n+ dispatch: (action: NavAction) => boolean,\n+ },\n+>;\n+const NavAppContainer: NavContainer = (createAppContainer(RootNavigator): any);\ntype Props = {\n// Redux state\n- navigationState: NavigationState,\nactiveTheme: ?GlobalTheme,\n// Redux dispatch functions\n- dispatch: NativeDispatch,\ndispatchActionPayload: DispatchActionPayload,\n};\ntype State = {|\n@@ -70,25 +85,16 @@ type State = {|\n|};\nclass Root extends React.PureComponent<Props, State> {\nstatic propTypes = {\n- navigationState: PropTypes.object.isRequired,\nactiveTheme: globalThemePropType,\n- dispatch: PropTypes.func.isRequired,\ndispatchActionPayload: PropTypes.func.isRequired,\n};\n- currentState: ?string = NativeAppState.currentState;\n-\n- constructor(props: Props) {\n- super(props);\n- const navContext = {\n- state: props.navigationState,\n- dispatch: props.dispatch,\n- };\n- this.state = {\n- navContext,\n+ state = {\n+ navContext: null,\nrootContext: null,\n};\n- setGlobalNavContext(navContext);\n- }\n+ currentState: ?string = NativeAppState.currentState;\n+ navDispatch: ?(action: NavAction) => boolean;\n+ navState: ?NavigationState;\ncomponentDidMount() {\nif (Platform.OS === 'android') {\n@@ -104,20 +110,6 @@ class Root extends React.PureComponent<Props, State> {\nNativeAppState.removeEventListener('change', this.handleAppStateChange);\n}\n- componentDidUpdate(prevProps: Props) {\n- if (\n- this.props.navigationState !== prevProps.navigationState ||\n- this.props.dispatch !== prevProps.dispatch\n- ) {\n- const navContext = {\n- state: this.props.navigationState,\n- dispatch: this.props.dispatch,\n- };\n- this.setState({ navContext });\n- setGlobalNavContext(navContext);\n- }\n- }\n-\nhandleAppStateChange = (nextState: ?string) => {\nif (!nextState || nextState === 'unknown') {\nreturn;\n@@ -155,10 +147,11 @@ class Root extends React.PureComponent<Props, State> {\n<RootContext.Provider value={this.state.rootContext}>\n<ConnectedStatusBar />\n<PersistGate persistor={getPersistor()}>{gated}</PersistGate>\n- <ReduxifiedRootNavigator\n- state={this.props.navigationState}\n- dispatch={this.props.dispatch}\n+ <NavAppContainer\ntheme={reactNavigationTheme}\n+ loadNavigationState={this.loadNavigationState}\n+ onNavigationStateChange={this.onNavigationStateChange}\n+ ref={this.appContainerRef}\n/>\n<NavigationHandler />\n</RootContext.Provider>\n@@ -175,6 +168,48 @@ class Root extends React.PureComponent<Props, State> {\n: null;\nthis.setState({ rootContext });\n};\n+\n+ loadNavigationState = async () => {\n+ this.navState = defaultNavigationState;\n+ this.setNavContext();\n+ actionLogger.addOtherAction(\n+ 'navState',\n+ NavigationActions.init(),\n+ null,\n+ this.navState,\n+ );\n+ return defaultNavigationState;\n+ };\n+\n+ onNavigationStateChange = (\n+ prevState: NavigationState,\n+ state: NavigationState,\n+ action: NavAction,\n+ ) => {\n+ this.navState = state;\n+ actionLogger.addOtherAction('navState', action, prevState, state);\n+ this.setNavContext();\n+ };\n+\n+ appContainerRef = (appContainer: ?React.ElementRef<NavContainer>) => {\n+ if (!appContainer) {\n+ return;\n+ }\n+ this.navDispatch = appContainer.dispatch;\n+ this.setNavContext();\n+ };\n+\n+ setNavContext() {\n+ if (!this.navState || !this.navDispatch) {\n+ return;\n+ }\n+ const navContext = {\n+ state: this.navState,\n+ dispatch: this.navDispatch,\n+ };\n+ this.setState({ navContext });\n+ setGlobalNavContext(navContext);\n+ }\n}\nconst styles = StyleSheet.create({\n@@ -185,7 +220,6 @@ const styles = StyleSheet.create({\nconst ConnectedRoot = connect(\n(state: AppState) => ({\n- navigationState: state.navInfo.navigationState,\nactiveTheme: state.globalThemeInfo.activeTheme,\n}),\nnull,\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "@@ -11683,13 +11683,6 @@ react-native@0.60.6:\nstacktrace-parser \"^0.1.3\"\nwhatwg-fetch \"^3.0.0\"\n-react-navigation-redux-helpers@^4.0.0:\n- version \"4.0.1\"\n- resolved \"https://registry.yarnpkg.com/react-navigation-redux-helpers/-/react-navigation-redux-helpers-4.0.1.tgz#a2da4e403114ddf6438071bba6c2e81dd9ffa269\"\n- integrity sha512-hzReLzBbfVQGyh+FUQvWXhaK8vg2kwcIPM8vztQ21+8VL5JvijCBVRbXox22EfYTKh+AWHNiY8TCQtHbXlqNsA==\n- dependencies:\n- invariant \"^2.2.2\"\n-\nreact-navigation-stack@^1.10.2:\nversion \"1.10.2\"\nresolved \"https://registry.yarnpkg.com/react-navigation-stack/-/react-navigation-stack-1.10.2.tgz#86521ec876ce030b54073b89d31d3a1d82e6675b\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Remove Redux integration for React Navigation
129,187
03.04.2020 18:05:12
14,400
1067b6fac9f9a9b98d5f45d389a76df4bfb0f5bb
[server] Use most recent navState in preloadedState for importable error report download
[ { "change_type": "MODIFY", "old_path": "server/src/fetchers/report-fetchers.js", "new_path": "server/src/fetchers/report-fetchers.js", "diff": "// @flow\nimport type { Viewer } from '../session/viewer';\n-import type {\n- FetchErrorReportInfosResponse,\n- FetchErrorReportInfosRequest,\n- ReduxToolsImport,\n+import {\n+ type FetchErrorReportInfosResponse,\n+ type FetchErrorReportInfosRequest,\n+ type ReduxToolsImport,\n+ reportTypes,\n} from 'lib/types/report-types';\nimport { ServerError } from 'lib/utils/errors';\n@@ -72,7 +73,7 @@ async function fetchReduxToolsImport(\nconst query = SQL`\nSELECT user, report, creation_time\nFROM reports\n- WHERE id = ${id}\n+ WHERE id = ${id} AND type = ${reportTypes.ERROR}\n`;\nconst [result] = await dbQuery(query);\nif (result.length === 0) {\n@@ -83,6 +84,10 @@ async function fetchReduxToolsImport(\nconst _persist = row.report.preloadedState._persist\n? row.report.preloadedState._persist\n: {};\n+ const navState =\n+ row.report.currentState && row.report.currentState.navState\n+ ? row.report.currentState.navState\n+ : undefined;\nreturn {\npreloadedState: {\n...row.report.preloadedState,\n@@ -91,6 +96,7 @@ async function fetchReduxToolsImport(\n// Setting this to false disables redux-persist\nrehydrated: false,\n},\n+ navState,\nfrozen: true,\n},\npayload: row.report.actions,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Use most recent navState in preloadedState for importable error report download
129,187
03.04.2020 18:08:27
14,400
f4d249f89cee808a1029e2f9036cddd0ec84bb8d
[native] NavFromReduxHandler
[ { "change_type": "ADD", "old_path": null, "new_path": "native/navigation/nav-from-redux-handler.react.js", "diff": "+// @flow\n+\n+import * as React from 'react';\n+import { useSelector } from 'react-redux';\n+\n+import { NavContext } from './navigation-context';\n+\n+const NavFromReduxHandler = React.memo<{||}>(() => {\n+ const navContext = React.useContext(NavContext);\n+\n+ const navStateInRedux = useSelector(state => state.navState);\n+\n+ const dispatch = React.useMemo(() => {\n+ if (!navContext) {\n+ return null;\n+ }\n+ return navContext.dispatch;\n+ }, [navContext]);\n+\n+ React.useEffect(() => {\n+ if (!dispatch) {\n+ return;\n+ }\n+ if (navStateInRedux) {\n+ dispatch({\n+ type: 'SET_NAV_STATE',\n+ state: navStateInRedux,\n+ });\n+ }\n+ }, [dispatch, navStateInRedux]);\n+\n+ return null;\n+});\n+NavFromReduxHandler.displayName = 'NavFromReduxHandler';\n+\n+export default NavFromReduxHandler;\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/navigation-handler.react.js", "new_path": "native/navigation/navigation-handler.react.js", "diff": "@@ -10,15 +10,22 @@ import { useIsAppLoggedIn } from './nav-selectors';\nimport LinkingHandler from './linking-handler.react';\nimport ThreadScreenTracker from './thread-screen-tracker.react';\nimport ModalPruner from './modal-pruner.react';\n+import NavFromReduxHandler from './nav-from-redux-handler.react';\nconst NavigationHandler = React.memo<{||}>(() => {\nconst navContext = React.useContext(NavContext);\nconst reduxRehydrated = useSelector(\n(state: AppState) => !!(state._persist && state._persist.rehydrated),\n);\n+\nif (!navContext || !reduxRehydrated) {\n+ if (__DEV__) {\n+ return <NavFromReduxHandler />;\n+ } else {\nreturn null;\n}\n+ }\n+\nconst { dispatch } = navContext;\nreturn (\n<>\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/root-navigator.react.js", "new_path": "native/navigation/root-navigator.react.js", "diff": "@@ -44,6 +44,11 @@ useScreens();\ntype NavigationProp = NavigationStackProp<NavigationState> & {\nlogIn: () => void,\nlogOut: () => void,\n+ clearRootModals: (\n+ keys: $ReadOnlyArray<string>,\n+ preserveFocus: boolean,\n+ ) => void,\n+ setNavState: (state: NavigationState) => void,\n};\ntype StackViewProps = React.ElementConfig<typeof StackView> & {\n+navigation: NavigationProp,\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/root-router.js", "new_path": "native/navigation/root-router.js", "diff": "@@ -28,11 +28,16 @@ type ClearRootModalsAction = {|\n+keys: $ReadOnlyArray<string>,\n+preserveFocus?: boolean,\n|};\n+type SetNavStateAction = {|\n+ +type: 'SET_NAV_STATE',\n+ +state: NavigationState,\n+|};\nexport type RootRouterNavigationAction =\n| NavigationAction\n| LogInAction\n| LogOutAction\n- | ClearRootModalsAction;\n+ | ClearRootModalsAction\n+ | SetNavStateAction;\nconst defaultConfig = Object.freeze({});\nfunction RootRouter(\n@@ -127,6 +132,8 @@ function RootRouter(\n...newState,\nisTransitioning,\n};\n+ } else if (action.type === 'SET_NAV_STATE') {\n+ return action.state;\n} else {\nreturn stackRouter.getStateForAction(action, lastState);\n}\n@@ -143,6 +150,10 @@ function RootRouter(\nkeys,\npreserveFocus,\n}),\n+ setNavState: (state: NavigationState) => ({\n+ type: 'SET_NAV_STATE',\n+ state,\n+ }),\n}),\n};\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] NavFromReduxHandler
129,187
03.04.2020 22:32:25
14,400
b3de89d46b940807f3683b914c1e20fb580d019b
[native] native/navigation/action-types.js
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-router.js", "new_path": "native/chat/chat-router.js", "diff": "@@ -21,6 +21,12 @@ import {\nremoveScreensFromStack,\ngetThreadIDFromRoute,\n} from '../utils/navigation-utils';\n+import {\n+ clearScreensActionType,\n+ replaceWithThreadActionType,\n+ clearThreadsActionType,\n+ pushNewThreadActionType,\n+} from '../navigation/action-types';\ntype ClearScreensAction = {|\n+type: 'CLEAR_SCREENS',\n@@ -59,7 +65,7 @@ function ChatRouter(\naction: ChatRouterNavigationAction,\nlastState: ?NavigationState,\n) => {\n- if (action.type === 'CLEAR_SCREENS') {\n+ if (action.type === clearScreensActionType) {\nconst { routeNames } = action;\nif (!lastState) {\nreturn lastState;\n@@ -76,7 +82,7 @@ function ChatRouter(\n...newState,\nisTransitioning,\n};\n- } else if (action.type === 'REPLACE_WITH_THREAD') {\n+ } else if (action.type === replaceWithThreadActionType) {\nconst { threadInfo } = action;\nif (!lastState) {\nreturn lastState;\n@@ -105,7 +111,7 @@ function ChatRouter(\n...newState,\nisTransitioning,\n};\n- } else if (action.type === 'CLEAR_THREADS') {\n+ } else if (action.type === clearThreadsActionType) {\nconst threadIDs = new Set(action.threadIDs);\nif (!lastState) {\nreturn lastState;\n@@ -122,7 +128,7 @@ function ChatRouter(\n...newState,\nisTransitioning,\n};\n- } else if (action.type === 'PUSH_NEW_THREAD') {\n+ } else if (action.type === pushNewThreadActionType) {\nconst { threadInfo } = action;\nif (!lastState) {\nreturn lastState;\n@@ -161,24 +167,24 @@ function ChatRouter(\nrouteNames: $ReadOnlyArray<string>,\npreserveFocus: boolean,\n) => ({\n- type: 'CLEAR_SCREENS',\n+ type: clearScreensActionType,\nrouteNames,\npreserveFocus,\n}),\nreplaceWithThread: (threadInfo: ThreadInfo) => ({\n- type: 'REPLACE_WITH_THREAD',\n+ type: replaceWithThreadActionType,\nthreadInfo,\n}),\nclearThreads: (\nthreadIDs: $ReadOnlyArray<string>,\npreserveFocus: boolean,\n) => ({\n- type: 'CLEAR_THREADS',\n+ type: clearThreadsActionType,\nthreadIDs,\npreserveFocus,\n}),\npushNewThread: (threadInfo: ThreadInfo) => ({\n- type: 'PUSH_NEW_THREAD',\n+ type: pushNewThreadActionType,\nthreadInfo,\n}),\n}),\n" }, { "change_type": "MODIFY", "old_path": "native/chat/settings/delete-thread.react.js", "new_path": "native/chat/settings/delete-thread.react.js", "diff": "@@ -50,6 +50,7 @@ import {\ntype NavContextType,\nnavContextPropType,\n} from '../../navigation/navigation-context';\n+import { clearThreadsActionType } from '../../navigation/action-types';\ntype NavProp = {\nstate: { params: { threadInfo: ThreadInfo } },\n@@ -249,7 +250,7 @@ class DeleteThread extends React.PureComponent<Props, State> {\nresult.threadInfos,\n);\nnavContext.dispatch({\n- type: 'CLEAR_THREADS',\n+ type: clearThreadsActionType,\nthreadIDs: [...invalidated],\n});\nreturn result;\n" }, { "change_type": "MODIFY", "old_path": "native/chat/settings/thread-settings-leave-thread.react.js", "new_path": "native/chat/settings/thread-settings-leave-thread.react.js", "diff": "@@ -39,6 +39,7 @@ import {\ntype NavContextType,\nnavContextPropType,\n} from '../../navigation/navigation-context';\n+import { clearThreadsActionType } from '../../navigation/action-types';\ntype Props = {|\nthreadInfo: ThreadInfo,\n@@ -134,7 +135,7 @@ class ThreadSettingsLeaveThread extends React.PureComponent<Props> {\nresult.threadInfos,\n);\nnavContext.dispatch({\n- type: 'CLEAR_THREADS',\n+ type: clearThreadsActionType,\nthreadIDs: [...invalidated],\n});\nreturn result;\n" }, { "change_type": "MODIFY", "old_path": "native/chat/thread-screen-pruner.react.js", "new_path": "native/chat/thread-screen-pruner.react.js", "diff": "@@ -12,6 +12,7 @@ import {\ngetThreadIDFromRoute,\n} from '../utils/navigation-utils';\nimport { useActiveThread } from '../navigation/nav-selectors';\n+import { clearThreadsActionType } from '../navigation/action-types';\nconst ThreadScreenPruner = React.memo<{||}>(() => {\nconst rawThreadInfos = useSelector(\n@@ -68,7 +69,7 @@ const ThreadScreenPruner = React.memo<{||}>(() => {\n);\n}\nnavContext.dispatch({\n- type: 'CLEAR_THREADS',\n+ type: clearThreadsActionType,\nthreadIDs: pruneThreadIDs,\npreserveFocus: true,\n});\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/navigation/action-types.js", "diff": "+// @flow\n+\n+// RootRouter\n+export const logInActionType = 'LOG_IN';\n+export const logOutActionType = 'LOG_OUT';\n+export const clearRootModalsActionType = 'CLEAR_ROOT_MODALS';\n+export const setNavStateActionType = 'SET_NAV_STATE';\n+\n+// OverlayRouter\n+export const clearOverlayModalsActionType = 'CLEAR_OVERLAY_MODALS';\n+\n+// ChatRouter\n+export const clearScreensActionType = 'CLEAR_SCREENS';\n+export const replaceWithThreadActionType = 'REPLACE_WITH_THREAD';\n+export const clearThreadsActionType = 'CLEAR_THREADS';\n+export const pushNewThreadActionType = 'PUSH_NEW_THREAD';\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/modal-pruner.react.js", "new_path": "native/navigation/modal-pruner.react.js", "diff": "@@ -7,6 +7,10 @@ import * as React from 'react';\nimport invariant from 'invariant';\nimport { AppRouteName } from './route-names';\n+import {\n+ clearRootModalsActionType,\n+ clearOverlayModalsActionType,\n+} from './action-types';\ntype DependencyInfo = {|\nstatus: 'missing' | 'resolved' | 'unresolved',\n@@ -102,14 +106,14 @@ function ModalPruner(props: Props) {\nReact.useEffect(() => {\nif (pruneRootModals.length > 0) {\ndispatch({\n- type: 'CLEAR_ROOT_MODALS',\n+ type: (clearRootModalsActionType: 'CLEAR_ROOT_MODALS'),\nkeys: pruneRootModals,\npreserveFocus: true,\n});\n}\nif (pruneOverlayModals.length > 0) {\ndispatch({\n- type: 'CLEAR_OVERLAY_MODALS',\n+ type: (clearOverlayModalsActionType: 'CLEAR_OVERLAY_MODALS'),\nkeys: pruneOverlayModals,\npreserveFocus: true,\n});\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/nav-from-redux-handler.react.js", "new_path": "native/navigation/nav-from-redux-handler.react.js", "diff": "@@ -4,6 +4,7 @@ import * as React from 'react';\nimport { useSelector } from 'react-redux';\nimport { NavContext } from './navigation-context';\n+import { setNavStateActionType } from './action-types';\nconst NavFromReduxHandler = React.memo<{||}>(() => {\nconst navContext = React.useContext(NavContext);\n@@ -23,7 +24,7 @@ const NavFromReduxHandler = React.memo<{||}>(() => {\n}\nif (navStateInRedux) {\ndispatch({\n- type: 'SET_NAV_STATE',\n+ type: setNavStateActionType,\nstate: navStateInRedux,\n});\n}\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/navigation-handler.react.js", "new_path": "native/navigation/navigation-handler.react.js", "diff": "@@ -11,6 +11,7 @@ import LinkingHandler from './linking-handler.react';\nimport ThreadScreenTracker from './thread-screen-tracker.react';\nimport ModalPruner from './modal-pruner.react';\nimport NavFromReduxHandler from './nav-from-redux-handler.react';\n+import { logInActionType, logOutActionType } from './action-types';\nconst NavigationHandler = React.memo<{||}>(() => {\nconst navContext = React.useContext(NavContext);\n@@ -68,9 +69,9 @@ const LogInHandler = React.memo<LogInHandlerProps>(\nreturn;\n}\nif (loggedIn && !navLoggedIn) {\n- dispatch({ type: 'LOG_IN' });\n+ dispatch({ type: (logInActionType: 'LOG_IN') });\n} else if (!loggedIn && navLoggedIn) {\n- dispatch({ type: 'LOG_OUT' });\n+ dispatch({ type: (logOutActionType: 'LOG_OUT') });\n}\n}, [navLoggedIn, prevLoggedIn, loggedIn, dispatch]);\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/overlay-router.js", "new_path": "native/navigation/overlay-router.js", "diff": "@@ -10,6 +10,7 @@ import {\n} from 'react-navigation';\nimport { removeScreensFromStack } from '../utils/navigation-utils';\n+import { clearOverlayModalsActionType } from './action-types';\ntype ClearOverlayModalsAction = {|\n+type: 'CLEAR_OVERLAY_MODALS',\n@@ -32,7 +33,7 @@ function OverlayRouter(\naction: OverlayRouterNavigationAction,\nlastState: ?NavigationState,\n) => {\n- if (action.type === 'CLEAR_OVERLAY_MODALS') {\n+ if (action.type === clearOverlayModalsActionType) {\nconst { keys } = action;\nif (!lastState) {\nreturn lastState;\n@@ -62,7 +63,7 @@ function OverlayRouter(\nkeys: $ReadOnlyArray<string>,\npreserveFocus: boolean,\n) => ({\n- type: 'CLEAR_OVERLAY_MODALS',\n+ type: clearOverlayModalsActionType,\nkeys,\npreserveFocus,\n}),\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/root-router.js", "new_path": "native/navigation/root-router.js", "diff": "@@ -16,6 +16,12 @@ import {\nAppRouteName,\n} from './route-names';\nimport { defaultNavigationState } from './default-state';\n+import {\n+ logInActionType,\n+ logOutActionType,\n+ clearRootModalsActionType,\n+ setNavStateActionType,\n+} from './action-types';\ntype LogInAction = {|\n+type: 'LOG_IN',\n@@ -51,7 +57,7 @@ function RootRouter(\naction: RootRouterNavigationAction,\nlastState: ?NavigationState,\n) => {\n- if (action.type === 'LOG_IN') {\n+ if (action.type === logInActionType) {\nif (!lastState) {\nreturn lastState;\n}\n@@ -70,7 +76,7 @@ function RootRouter(\n...newState,\nisTransitioning,\n};\n- } else if (action.type === 'LOG_OUT') {\n+ } else if (action.type === logOutActionType) {\nif (!lastState) {\nreturn lastState;\n}\n@@ -112,7 +118,7 @@ function RootRouter(\n...newState,\nisTransitioning,\n};\n- } else if (action.type === 'CLEAR_ROOT_MODALS') {\n+ } else if (action.type === clearRootModalsActionType) {\nconst { keys } = action;\nif (!lastState) {\nreturn lastState;\n@@ -132,7 +138,7 @@ function RootRouter(\n...newState,\nisTransitioning,\n};\n- } else if (action.type === 'SET_NAV_STATE') {\n+ } else if (action.type === setNavStateActionType) {\nreturn action.state;\n} else {\nreturn stackRouter.getStateForAction(action, lastState);\n@@ -140,18 +146,18 @@ function RootRouter(\n},\ngetActionCreators: (route: NavigationRoute, navStateKey: ?string) => ({\n...stackRouter.getActionCreators(route, navStateKey),\n- logIn: () => ({ type: 'LOG_IN' }),\n- logOut: () => ({ type: 'LOG_OUT' }),\n+ logIn: () => ({ type: logInActionType }),\n+ logOut: () => ({ type: logOutActionType }),\nclearRootModals: (\nkeys: $ReadOnlyArray<string>,\npreserveFocus: boolean,\n) => ({\n- type: 'CLEAR_ROOT_MODALS',\n+ type: clearRootModalsActionType,\nkeys,\npreserveFocus,\n}),\nsetNavState: (state: NavigationState) => ({\n- type: 'SET_NAV_STATE',\n+ type: setNavStateActionType,\nstate,\n}),\n}),\n" }, { "change_type": "MODIFY", "old_path": "native/push/push-handler.react.js", "new_path": "native/push/push-handler.react.js", "diff": "@@ -78,6 +78,7 @@ import {\nrootContextPropType,\n} from '../root-context';\nimport { ChatRouteName, MessageListRouteName } from '../navigation/route-names';\n+import { replaceWithThreadActionType } from '../navigation/action-types';\nYellowBox.ignoreWarnings([\n'Require cycle: ../node_modules/react-native-firebase',\n@@ -454,7 +455,7 @@ class PushHandler extends React.PureComponent<Props, State> {\nnavigateToThread(threadInfo: ThreadInfo, clearChatRoutes: boolean) {\nif (clearChatRoutes) {\nconst replaceAction: NavigationNavigateAction = ({\n- type: 'REPLACE_WITH_THREAD',\n+ type: replaceWithThreadActionType,\nthreadInfo,\n}: any);\nthis.props.navigation.navigate({\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] native/navigation/action-types.js
129,187
03.04.2020 23:02:11
14,400
60eb3a39f20df07ab40a469663df27386b4e777c
Custom Redux dev tools integration for native
[ { "change_type": "MODIFY", "old_path": "lib/utils/action-logger.js", "new_path": "lib/utils/action-logger.js", "diff": "@@ -14,12 +14,15 @@ const uninterestingActionTypes = new Set([\n]);\nconst maxActionSummaryLength = 500;\n+type Subscriber = (action: Object, state: Object) => void;\n+\nclass ActionLogger {\nstatic n = 30;\nlastNActions = [];\nlastNStates = [];\ncurrentReduxState = undefined;\ncurrentOtherStates = {};\n+ subscribers: Subscriber[] = [];\nget preloadedState(): Object {\nreturn this.lastNStates[0].state;\n@@ -93,6 +96,8 @@ class ActionLogger {\nconst time = Date.now();\nthis.lastNActions.push({ action, time });\nthis.lastNStates.push({ state, time });\n+\n+ this.triggerSubscribers(action);\n}\naddOtherAction(\n@@ -125,6 +130,8 @@ class ActionLogger {\nconst time = Date.now();\nthis.lastNActions.push({ action, time });\nthis.lastNStates.push({ state, time });\n+\n+ this.triggerSubscribers(action);\n}\nget mostRecentActionTime(): ?number {\n@@ -141,6 +148,24 @@ class ActionLogger {\n}\nreturn state;\n}\n+\n+ subscribe(subscriber: Subscriber) {\n+ this.subscribers.push(subscriber);\n+ }\n+\n+ unsubscribe(subscriber: Subscriber) {\n+ this.subscribers = this.subscribers.filter(\n+ candidate => candidate !== subscriber,\n+ );\n+ }\n+\n+ triggerSubscribers(action: Object) {\n+ if (uninterestingActionTypes.has(action.type)) {\n+ return;\n+ }\n+ const state = this.currentState;\n+ this.subscribers.forEach(subscriber => subscriber(action, state));\n+ }\n}\nconst actionLogger = new ActionLogger();\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/navigation-handler.react.js", "new_path": "native/navigation/navigation-handler.react.js", "diff": "@@ -12,6 +12,7 @@ import ThreadScreenTracker from './thread-screen-tracker.react';\nimport ModalPruner from './modal-pruner.react';\nimport NavFromReduxHandler from './nav-from-redux-handler.react';\nimport { logInActionType, logOutActionType } from './action-types';\n+import DevTools from '../redux/dev-tools.react';\nconst NavigationHandler = React.memo<{||}>(() => {\nconst navContext = React.useContext(NavContext);\n@@ -19,9 +20,16 @@ const NavigationHandler = React.memo<{||}>(() => {\n(state: AppState) => !!(state._persist && state._persist.rehydrated),\n);\n+ const devTools = __DEV__ ? <DevTools key=\"devTools\" /> : null;\n+\nif (!navContext || !reduxRehydrated) {\nif (__DEV__) {\n- return <NavFromReduxHandler />;\n+ return (\n+ <>\n+ <NavFromReduxHandler />\n+ {devTools}\n+ </>\n+ );\n} else {\nreturn null;\n}\n@@ -34,6 +42,7 @@ const NavigationHandler = React.memo<{||}>(() => {\n<LinkingHandler dispatch={dispatch} />\n<ThreadScreenTracker />\n<ModalPruner navContext={navContext} />\n+ {devTools}\n</>\n);\n});\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/root-router.js", "new_path": "native/navigation/root-router.js", "diff": "@@ -37,6 +37,7 @@ type ClearRootModalsAction = {|\ntype SetNavStateAction = {|\n+type: 'SET_NAV_STATE',\n+state: NavigationState,\n+ +hideFromMonitor?: boolean,\n|};\nexport type RootRouterNavigationAction =\n| NavigationAction\n@@ -156,9 +157,13 @@ function RootRouter(\nkeys,\npreserveFocus,\n}),\n- setNavState: (state: NavigationState) => ({\n+ setNavState: (\n+ state: NavigationState,\n+ hideFromMonitor?: boolean = false,\n+ ) => ({\ntype: setNavStateActionType,\nstate,\n+ hideFromMonitor,\n}),\n}),\n};\n" }, { "change_type": "MODIFY", "old_path": "native/redux/action-types.js", "new_path": "native/redux/action-types.js", "diff": "@@ -18,6 +18,7 @@ export const updateDeviceCameraInfoActionType = 'UPDATE_DEVICE_CAMERA_INFO';\nexport const updateDeviceOrientationActionType = 'UPDATE_DEVICE_ORIENTATION';\nexport const updateThreadLastNavigatedActionType =\n'UPDATE_THREAD_LAST_NAVIGATED';\n+export const setReduxStateActionType = 'SET_REDUX_STATE';\nexport const backgroundActionTypes: Set<string> = new Set([\nsaveMessagesActionType,\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/redux/dev-tools.react.js", "diff": "+// @flow\n+\n+import * as React from 'react';\n+import { useSelector, useDispatch } from 'react-redux';\n+\n+import { actionLogger } from 'lib/utils/action-logger';\n+\n+import { NavContext } from '../navigation/navigation-context';\n+import { setReduxStateActionType } from './action-types';\n+import { setNavStateActionType } from '../navigation/action-types';\n+\n+const DevTools = React.memo<{||}>(() => {\n+ const devToolsRef = React.useRef();\n+ if (\n+ global.__REDUX_DEVTOOLS_EXTENSION__ &&\n+ devToolsRef.current === undefined\n+ ) {\n+ devToolsRef.current = global.__REDUX_DEVTOOLS_EXTENSION__.connect({\n+ name: 'SquadCal',\n+ features: {\n+ pause: false,\n+ lock: false,\n+ persist: false,\n+ export: false,\n+ import: false,\n+ jump: true,\n+ skip: false,\n+ reorder: false,\n+ dispatch: false,\n+ test: false,\n+ },\n+ });\n+ }\n+ const devTools = devToolsRef.current;\n+\n+ const navContext = React.useContext(NavContext);\n+ const initialReduxState = useSelector(state => state);\n+\n+ React.useEffect(() => {\n+ if (devTools && navContext) {\n+ devTools.init({ ...initialReduxState, navState: navContext.state });\n+ }\n+ // eslint-disable-next-line react-hooks/exhaustive-deps\n+ }, [devTools, !navContext]);\n+\n+ const postActionToMonitor = React.useCallback(\n+ (action: Object, state: Object) => {\n+ if (!devTools) {\n+ return;\n+ } else if (\n+ (action.type === setNavStateActionType ||\n+ action.type === setReduxStateActionType) &&\n+ action.hideFromMonitor\n+ ) {\n+ // Triggered by handleActionFromMonitor below when somebody is stepping\n+ // through actions in the SquadCal monitor in Redux dev tools\n+ return;\n+ } else if (action.type === setNavStateActionType) {\n+ // Triggered by NavFromReduxHandler when somebody imports state into the\n+ // Redux monitor in Redux dev tools\n+ devTools.init(state);\n+ } else {\n+ devTools.send(action, state);\n+ }\n+ },\n+ [devTools],\n+ );\n+\n+ React.useEffect(() => {\n+ actionLogger.subscribe(postActionToMonitor);\n+ return () => actionLogger.unsubscribe(postActionToMonitor);\n+ }, [postActionToMonitor]);\n+\n+ const reduxDispatch = useDispatch();\n+ const navDispatch = React.useMemo(\n+ () => (navContext ? navContext.dispatch : null),\n+ [navContext],\n+ );\n+\n+ const setInternalState = React.useCallback(\n+ state => {\n+ const { navState, ...reduxState } = state;\n+ if (navDispatch) {\n+ navDispatch({\n+ type: setNavStateActionType,\n+ state: navState,\n+ hideFromMonitor: true,\n+ });\n+ } else {\n+ console.log('could not set state in ReactNav');\n+ }\n+ reduxDispatch({\n+ type: setReduxStateActionType,\n+ state: reduxState,\n+ hideFromMonitor: true,\n+ });\n+ },\n+ [reduxDispatch, navDispatch],\n+ );\n+\n+ const handleActionFromMonitor = React.useCallback(\n+ monitorAction => {\n+ if (!devTools) {\n+ return;\n+ }\n+ if (monitorAction.type === 'DISPATCH') {\n+ const state = JSON.parse(monitorAction.state);\n+ setInternalState(state);\n+ } else if (monitorAction.type === 'IMPORT') {\n+ console.log('you should import using the Redux monitor!');\n+ }\n+ },\n+ [devTools, setInternalState],\n+ );\n+\n+ React.useEffect(() => {\n+ if (!devTools) {\n+ return;\n+ }\n+ const unsubscribe = devTools.subscribe(handleActionFromMonitor);\n+ return unsubscribe;\n+ }, [devTools, handleActionFromMonitor]);\n+\n+ return null;\n+});\n+\n+export default DevTools;\n" }, { "change_type": "MODIFY", "old_path": "native/redux/redux-setup.js", "new_path": "native/redux/redux-setup.js", "diff": "@@ -70,6 +70,7 @@ import {\nupdateDeviceOrientationActionType,\nupdateThreadLastNavigatedActionType,\nbackgroundActionTypes,\n+ setReduxStateActionType,\n} from './action-types';\nimport { type NavInfo, defaultNavInfo } from '../navigation/default-state';\nimport { reduceThreadIDsToNotifIDs } from '../push/reducer';\n@@ -161,6 +162,9 @@ const defaultState = ({\n}: AppState);\nfunction reducer(state: AppState = defaultState, action: *) {\n+ if (action.type === setReduxStateActionType) {\n+ return action.state;\n+ }\nif (\n(action.type === setNewSessionActionType &&\ninvalidSessionDowngrade(\n@@ -380,7 +384,7 @@ function appBecameInactive() {\nconst middleware = applyMiddleware(thunk, reduxLoggerMiddleware);\nconst composeFunc = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\n- ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\n+ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({ name: 'Redux' })\n: compose;\nlet enhancers;\nif (reactotron) {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Custom Redux dev tools integration for native
129,187
04.04.2020 14:23:35
14,400
218dab84f54c926dffd4cff223cb1ce7b5f1e502
[native] Don't set NavContext until ReactNav initializes
[ { "change_type": "MODIFY", "old_path": "native/calendar/calendar.react.js", "new_path": "native/calendar/calendar.react.js", "diff": "@@ -1172,7 +1172,7 @@ export default connectNav((context: ?NavContextType) => ({\nactiveTabSelector(context) || activeThreadPickerSelector(context),\nthreadPickerOpen:\nactiveThreadPickerSelector(context) ||\n- (context && !!context.state.isTransitioning),\n+ !!(context && context.state.isTransitioning),\n}))(\nconnect(\n(state: AppState) => ({\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/app-navigator.react.js", "new_path": "native/navigation/app-navigator.react.js", "diff": "@@ -41,6 +41,7 @@ import { getPersistor } from '../redux/persist';\nimport { NavContext } from './navigation-context';\nimport { useIsAppLoggedIn } from './nav-selectors';\nimport { assertNavigationRouteNotLeafNode } from '../utils/navigation-utils';\n+import { RootContext } from '../root-context';\nconst TabNavigator = createBottomTabNavigator(\n{\n@@ -72,6 +73,13 @@ type Props = {|\nnavigation: NavigationStackProp<NavigationStateRoute>,\n|};\nfunction WrappedAppNavigator(props: Props) {\n+ const rootContext = React.useContext(RootContext);\n+ const setNavStateInitialized =\n+ rootContext && rootContext.setNavStateInitialized;\n+ React.useEffect(() => {\n+ setNavStateInitialized && setNavStateInitialized();\n+ }, [setNavStateInitialized]);\n+\nconst { navigation } = props;\nconst isForeground = useIsAppLoggedIn();\nconst backButtonHandler = isForeground ? (\n" }, { "change_type": "MODIFY", "old_path": "native/push/push-handler.react.js", "new_path": "native/push/push-handler.react.js", "diff": "@@ -524,10 +524,17 @@ class PushHandler extends React.PureComponent<Props, State> {\nnotification.finish(NotificationsIOS.FetchResult.NewData);\n};\n- iosNotificationOpened = notification => {\n- if (this.props.rootContext) {\n+ onPushNotifBootsApp() {\n+ if (\n+ this.props.rootContext &&\n+ this.props.rootContext.detectUnsupervisedBackground\n+ ) {\nthis.props.rootContext.detectUnsupervisedBackground(false);\n}\n+ }\n+\n+ iosNotificationOpened = notification => {\n+ this.onPushNotifBootsApp();\nconst threadID = notification.getData().threadID;\nif (!threadID) {\nconsole.log('Notification with missing threadID received!');\n@@ -565,17 +572,13 @@ class PushHandler extends React.PureComponent<Props, State> {\n}\nandroidNotificationOpened = async (notificationOpen: NotificationOpen) => {\n- if (this.props.rootContext) {\n- this.props.rootContext.detectUnsupervisedBackground(false);\n- }\n+ this.onPushNotifBootsApp();\nconst { threadID } = notificationOpen.notification.data;\nthis.onPressNotificationForThread(threadID, true);\n};\nandroidMessageReceived = async (message: RemoteMessage) => {\n- if (this.props.rootContext) {\n- this.props.rootContext.detectUnsupervisedBackground(false);\n- }\n+ this.onPushNotifBootsApp();\nhandleAndroidMessage(\nmessage,\nthis.props.updatesCurrentAsOf,\n" }, { "change_type": "MODIFY", "old_path": "native/root-context.js", "new_path": "native/root-context.js", "diff": "@@ -5,7 +5,8 @@ import hoistNonReactStatics from 'hoist-non-react-statics';\nimport PropTypes from 'prop-types';\nexport type RootContextType = {|\n- detectUnsupervisedBackground: (alreadyClosed: boolean) => boolean,\n+ detectUnsupervisedBackground?: ?(alreadyClosed: boolean) => boolean,\n+ setNavStateInitialized: () => void,\n|};\nconst RootContext = React.createContext<?RootContextType>(null);\n" }, { "change_type": "MODIFY", "old_path": "native/root.react.js", "new_path": "native/root.react.js", "diff": "@@ -81,20 +81,27 @@ type Props = {\n};\ntype State = {|\nnavContext: ?NavContextType,\n- rootContext: ?RootContextType,\n+ rootContext: RootContextType,\n|};\nclass Root extends React.PureComponent<Props, State> {\nstatic propTypes = {\nactiveTheme: globalThemePropType,\ndispatchActionPayload: PropTypes.func.isRequired,\n};\n- state = {\n- navContext: null,\n- rootContext: null,\n- };\n- currentState: ?string = NativeAppState.currentState;\n+\n+ currentAppState: ?string = NativeAppState.currentState;\n+\nnavDispatch: ?(action: NavAction) => boolean;\nnavState: ?NavigationState;\n+ navStateInitialized = false;\n+\n+ constructor(props: Props) {\n+ super(props);\n+ this.state = {\n+ navContext: null,\n+ rootContext: { setNavStateInitialized: this.setNavStateInitialized },\n+ };\n+ }\ncomponentDidMount() {\nif (Platform.OS === 'android') {\n@@ -114,8 +121,8 @@ class Root extends React.PureComponent<Props, State> {\nif (!nextState || nextState === 'unknown') {\nreturn;\n}\n- const lastState = this.currentState;\n- this.currentState = nextState;\n+ const lastState = this.currentAppState;\n+ this.currentAppState = nextState;\nif (lastState === 'background' && nextState === 'active') {\nthis.props.dispatchActionPayload(foregroundActionType, null);\n} else if (lastState !== 'background' && nextState === 'background') {\n@@ -163,10 +170,12 @@ class Root extends React.PureComponent<Props, State> {\ndetectUnsupervisedBackgroundRef = (\ndetectUnsupervisedBackground: ?(alreadyClosed: boolean) => boolean,\n) => {\n- const rootContext = detectUnsupervisedBackground\n- ? { detectUnsupervisedBackground }\n- : null;\n- this.setState({ rootContext });\n+ this.setState(prevState => ({\n+ rootContext: {\n+ ...prevState.rootContext,\n+ detectUnsupervisedBackground,\n+ },\n+ }));\n};\nloadNavigationState = async () => {\n@@ -187,8 +196,8 @@ class Root extends React.PureComponent<Props, State> {\naction: NavAction,\n) => {\nthis.navState = state;\n- actionLogger.addOtherAction('navState', action, prevState, state);\nthis.setNavContext();\n+ actionLogger.addOtherAction('navState', action, prevState, state);\n};\nappContainerRef = (appContainer: ?React.ElementRef<NavContainer>) => {\n@@ -200,7 +209,7 @@ class Root extends React.PureComponent<Props, State> {\n};\nsetNavContext() {\n- if (!this.navState || !this.navDispatch) {\n+ if (!this.navState || !this.navDispatch || !this.navStateInitialized) {\nreturn;\n}\nconst navContext = {\n@@ -210,6 +219,11 @@ class Root extends React.PureComponent<Props, State> {\nthis.setState({ navContext });\nsetGlobalNavContext(navContext);\n}\n+\n+ setNavStateInitialized = () => {\n+ this.navStateInitialized = true;\n+ this.setNavContext();\n+ };\n}\nconst styles = StyleSheet.create({\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Don't set NavContext until ReactNav initializes
129,187
04.04.2020 15:07:07
14,400
d56dd34b21831d859a29c24ba8d5a8d172b4fe72
[native] Always showPrompt in LoggedOutModal
[ { "change_type": "MODIFY", "old_path": "native/account/logged-out-modal.react.js", "new_path": "native/account/logged-out-modal.react.js", "diff": "@@ -210,7 +210,7 @@ class LoggedOutModal extends React.PureComponent<Props, State> {\ncomponentDidMount() {\nthis.mounted = true;\nif (this.props.rehydrateConcluded) {\n- this.onInitialAppLoad(true);\n+ this.onInitialAppLoad();\n}\nif (this.props.isForeground) {\nthis.onForeground();\n@@ -226,7 +226,8 @@ class LoggedOutModal extends React.PureComponent<Props, State> {\ncomponentDidUpdate(prevProps: Props) {\nif (!prevProps.rehydrateConcluded && this.props.rehydrateConcluded) {\n- this.onInitialAppLoad(false);\n+ this.showPrompt();\n+ this.onInitialAppLoad();\n}\nif (!prevProps.isForeground && this.props.isForeground) {\nthis.onForeground();\n@@ -255,7 +256,7 @@ class LoggedOutModal extends React.PureComponent<Props, State> {\n// This gets triggered when an app is killed and restarted\n// Not when it is returned from being backgrounded\n- async onInitialAppLoad(startedWithPrompt: boolean) {\n+ async onInitialAppLoad() {\nif (!initialAppLoad) {\nreturn;\n}\n@@ -290,10 +291,6 @@ class LoggedOutModal extends React.PureComponent<Props, State> {\nif (loggedIn || hasUserCookie) {\nthis.props.dispatchActionPayload(resetUserStateActionType, null);\n}\n-\n- if (!startedWithPrompt) {\n- this.showPrompt();\n- }\n}\nshowPrompt = () => {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Always showPrompt in LoggedOutModal
129,187
04.04.2020 15:13:37
14,400
3dc8a8a98d980d0ef9190cd6730ad143bd19b18d
[native] Use default ReactNav back-button handling logic for Android Move gating logic to `RootRouter`
[ { "change_type": "MODIFY", "old_path": "native/account/verification-modal.react.js", "new_path": "native/account/verification-modal.react.js", "diff": "@@ -21,7 +21,6 @@ import {\nText,\nView,\nStyleSheet,\n- BackHandler,\nActivityIndicator,\nAnimated,\nPlatform,\n@@ -64,7 +63,11 @@ import {\ntype VerificationModalMode = 'simple-text' | 'reset-password';\ntype Props = {\nnavigation: {\n- state: { params: { verifyCode: string } },\n+ state: { key: string, params: { verifyCode: string } },\n+ clearRootModals: (\n+ keys: $ReadOnlyArray<string>,\n+ preserveFocus: boolean,\n+ ) => void,\n} & NavigationScreenProp<NavigationLeafRoute>,\n// Navigation state\nisForeground: boolean,\n@@ -91,11 +94,13 @@ class VerificationModal extends React.PureComponent<Props, State> {\nstatic propTypes = {\nnavigation: PropTypes.shape({\nstate: PropTypes.shape({\n+ key: PropTypes.string.isRequired,\nparams: PropTypes.shape({\nverifyCode: PropTypes.string.isRequired,\n}).isRequired,\n}).isRequired,\ngoBack: PropTypes.func.isRequired,\n+ clearRootModals: PropTypes.func.isRequired,\n}).isRequired,\nisForeground: PropTypes.bool.isRequired,\ndimensions: dimensionsPropType.isRequired,\n@@ -153,7 +158,7 @@ class VerificationModal extends React.PureComponent<Props, State> {\nthis.state.verifyField === verifyField.EMAIL &&\nprevState.verifyField !== verifyField.EMAIL\n) {\n- sleep(1500).then(this.hardwareBack);\n+ sleep(1500).then(this.dismiss);\n}\nconst prevCode = prevProps.navigation.state.params.verifyCode;\n@@ -185,7 +190,6 @@ class VerificationModal extends React.PureComponent<Props, State> {\nonForeground() {\nthis.keyboardShowListener = addKeyboardShowListener(this.keyboardShow);\nthis.keyboardHideListener = addKeyboardDismissListener(this.keyboardHide);\n- BackHandler.addEventListener('hardwareBackPress', this.hardwareBack);\n}\nonBackground() {\n@@ -197,12 +201,13 @@ class VerificationModal extends React.PureComponent<Props, State> {\nremoveKeyboardListener(this.keyboardHideListener);\nthis.keyboardHideListener = null;\n}\n- BackHandler.removeEventListener('hardwareBackPress', this.hardwareBack);\n}\n- hardwareBack = () => {\n- this.props.navigation.goBack();\n- return true;\n+ dismiss = () => {\n+ this.props.navigation.clearRootModals(\n+ [this.props.navigation.state.key],\n+ false,\n+ );\n};\nonResetPasswordSuccess = async () => {\n@@ -369,7 +374,7 @@ class VerificationModal extends React.PureComponent<Props, State> {\n);\nconst closeButton = (\n<TouchableHighlight\n- onPress={this.hardwareBack}\n+ onPress={this.dismiss}\nstyle={styles.closeButton}\nunderlayColor=\"#A0A0A0DD\"\n>\n" }, { "change_type": "MODIFY", "old_path": "native/calendar/thread-picker-modal.react.js", "new_path": "native/calendar/thread-picker-modal.react.js", "diff": "@@ -23,11 +23,9 @@ import { threadSearchIndex } from 'lib/selectors/nav-selectors';\nimport SearchIndex from 'lib/shared/search-index';\nimport { connect } from 'lib/utils/redux-utils';\n-import { createModal } from '../components/modal.react';\n+import Modal from '../components/modal.react';\nimport ThreadList from '../components/thread-list.react';\n-import { ThreadPickerModalRouteName } from '../navigation/route-names';\n-const Modal = createModal(ThreadPickerModalRouteName);\ntype NavProp = NavigationScreenProp<{|\n...NavigationLeafRoute,\nparams: {|\n" }, { "change_type": "MODIFY", "old_path": "native/chat/settings/add-users-modal.react.js", "new_path": "native/chat/settings/add-users-modal.react.js", "diff": "@@ -47,8 +47,7 @@ import { threadInfoSelector } from 'lib/selectors/thread-selectors';\nimport UserList from '../../components/user-list.react';\nimport TagInput from '../../components/tag-input.react';\nimport Button from '../../components/button.react';\n-import { createModal } from '../../components/modal.react';\n-import { AddUsersModalRouteName } from '../../navigation/route-names';\n+import Modal from '../../components/modal.react';\nimport { styleSelector } from '../../themes/colors';\nconst tagInputProps = {\n@@ -57,7 +56,6 @@ const tagInputProps = {\nreturnKeyType: 'go',\n};\n-const Modal = createModal(AddUsersModalRouteName);\ntype NavProp = NavigationScreenProp<{|\n...NavigationLeafRoute,\nparams: {|\n" }, { "change_type": "MODIFY", "old_path": "native/chat/settings/color-picker-modal.react.js", "new_path": "native/chat/settings/color-picker-modal.react.js", "diff": "@@ -26,8 +26,7 @@ import {\nchangeThreadSettings,\n} from 'lib/actions/thread-actions';\n-import { createModal } from '../../components/modal.react';\n-import { ColorPickerModalRouteName } from '../../navigation/route-names';\n+import Modal from '../../components/modal.react';\nimport ColorPicker from '../../components/color-picker.react';\nimport {\ntype Colors,\n@@ -37,7 +36,6 @@ import {\n} from '../../themes/colors';\nimport { dimensionsSelector } from '../../selectors/dimension-selectors';\n-const Modal = createModal(ColorPickerModalRouteName);\ntype NavProp = NavigationScreenProp<{|\n...NavigationLeafRoute,\nparams: {|\n" }, { "change_type": "MODIFY", "old_path": "native/chat/settings/compose-subthread-modal.react.js", "new_path": "native/chat/settings/compose-subthread-modal.react.js", "diff": "@@ -22,11 +22,8 @@ import { threadTypeDescriptions } from 'lib/shared/thread-utils';\nimport { connect } from 'lib/utils/redux-utils';\nimport Button from '../../components/button.react';\n-import {\n- ComposeSubthreadModalRouteName,\n- ComposeThreadRouteName,\n-} from '../../navigation/route-names';\n-import { createModal } from '../../components/modal.react';\n+import { ComposeThreadRouteName } from '../../navigation/route-names';\n+import Modal from '../../components/modal.react';\nimport {\ntype Colors,\ncolorsPropType,\n@@ -34,7 +31,6 @@ import {\nstyleSelector,\n} from '../../themes/colors';\n-const Modal = createModal(ComposeSubthreadModalRouteName);\ntype NavProp = NavigationScreenProp<{|\n...NavigationLeafRoute,\nparams: {|\n" }, { "change_type": "MODIFY", "old_path": "native/components/modal.react.js", "new_path": "native/components/modal.react.js", "diff": "@@ -8,22 +8,12 @@ import type { AppState } from '../redux/redux-setup';\nimport type { ViewStyle, Styles } from '../types/styles';\nimport * as React from 'react';\n-import {\n- View,\n- TouchableWithoutFeedback,\n- BackHandler,\n- ViewPropTypes,\n-} from 'react-native';\n+import { View, TouchableWithoutFeedback, ViewPropTypes } from 'react-native';\nimport PropTypes from 'prop-types';\nimport { connect } from 'lib/utils/redux-utils';\nimport KeyboardAvoidingView from '../keyboard/keyboard-avoiding-view.react';\n-import { createIsForegroundSelector } from '../navigation/nav-selectors';\nimport { styleSelector } from '../themes/colors';\n-import {\n- connectNav,\n- type NavContextType,\n-} from '../navigation/navigation-context';\ntype Props = $ReadOnly<{|\nnavigation: NavigationScreenProp<NavigationLeafRoute>,\n@@ -31,7 +21,6 @@ type Props = $ReadOnly<{|\ncontainerStyle?: ViewStyle,\nmodalStyle?: ViewStyle,\n// Redux state\n- isForeground: boolean,\nstyles: Styles,\n|}>;\nclass Modal extends React.PureComponent<Props> {\n@@ -40,45 +29,11 @@ class Modal extends React.PureComponent<Props> {\nnavigation: PropTypes.shape({\ngoBack: PropTypes.func.isRequired,\n}).isRequired,\n- isForeground: PropTypes.bool.isRequired,\nstyles: PropTypes.objectOf(PropTypes.object).isRequired,\ncontainerStyle: ViewPropTypes.style,\nmodalStyle: ViewPropTypes.style,\n};\n- componentDidMount() {\n- if (this.props.isForeground) {\n- this.onForeground();\n- }\n- }\n-\n- componentWillUnmount() {\n- if (this.props.isForeground) {\n- this.onBackground();\n- }\n- }\n-\n- componentDidUpdate(prevProps: Props) {\n- if (this.props.isForeground && !prevProps.isForeground) {\n- this.onForeground();\n- } else if (!this.props.isForeground && prevProps.isForeground) {\n- this.onBackground();\n- }\n- }\n-\n- onForeground() {\n- BackHandler.addEventListener('hardwareBackPress', this.hardwareBack);\n- }\n-\n- onBackground() {\n- BackHandler.removeEventListener('hardwareBackPress', this.hardwareBack);\n- }\n-\n- hardwareBack = () => {\n- this.close();\n- return true;\n- };\n-\nclose = () => {\nthis.props.navigation.goBack();\n};\n@@ -127,15 +82,6 @@ const styles = {\n};\nconst stylesSelector = styleSelector(styles);\n-function createModal(routeName: string) {\n- const isForegroundSelector = createIsForegroundSelector(routeName);\n- return connect((state: AppState) => ({\n+export default connect((state: AppState) => ({\nstyles: stylesSelector(state),\n- }))(\n- connectNav((context: ?NavContextType) => ({\n- isForeground: isForegroundSelector(context),\n- }))(Modal),\n- );\n-}\n-\n-export { createModal };\n+}))(Modal);\n" }, { "change_type": "MODIFY", "old_path": "native/more/custom-server-modal.react.js", "new_path": "native/more/custom-server-modal.react.js", "diff": "@@ -16,12 +16,10 @@ import { connect } from 'lib/utils/redux-utils';\nimport { setURLPrefix } from 'lib/utils/url-utils';\nimport Button from '../components/button.react';\n-import { createModal } from '../components/modal.react';\n-import { CustomServerModalRouteName } from '../navigation/route-names';\n+import Modal from '../components/modal.react';\nimport { setCustomServer } from '../utils/url-utils';\nimport { styleSelector } from '../themes/colors';\n-const Modal = createModal(CustomServerModalRouteName);\ntype NavProp = NavigationScreenProp<{|\n...NavigationLeafRoute,\nparams: {|\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/app-navigator.react.js", "new_path": "native/navigation/app-navigator.react.js", "diff": "@@ -7,7 +7,6 @@ import * as React from 'react';\nimport { createBottomTabNavigator } from 'react-navigation-tabs';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport { PersistGate } from 'redux-persist/integration/react';\n-import { BackHandler } from 'react-native';\nimport {\nCalendarRouteName,\n@@ -20,7 +19,6 @@ import {\nTextMessageTooltipModalRouteName,\nThreadSettingsMemberTooltipModalRouteName,\nCameraModalRouteName,\n- AppRouteName,\n} from './route-names';\nimport Calendar from '../calendar/calendar.react';\nimport Chat from '../chat/chat.react';\n@@ -38,9 +36,6 @@ import OverlayableScrollViewStateContainer from './overlayable-scroll-view-state\nimport KeyboardStateContainer from '../keyboard/keyboard-state-container.react';\nimport PushHandler from '../push/push-handler.react';\nimport { getPersistor } from '../redux/persist';\n-import { NavContext } from './navigation-context';\n-import { useIsAppLoggedIn } from './nav-selectors';\n-import { assertNavigationRouteNotLeafNode } from '../utils/navigation-utils';\nimport { RootContext } from '../root-context';\nconst TabNavigator = createBottomTabNavigator(\n@@ -81,10 +76,6 @@ function WrappedAppNavigator(props: Props) {\n}, [setNavStateInitialized]);\nconst { navigation } = props;\n- const isForeground = useIsAppLoggedIn();\n- const backButtonHandler = isForeground ? (\n- <BackButtonHandler navigation={navigation} />\n- ) : null;\nreturn (\n<ChatInputStateContainer>\n<OverlayableScrollViewStateContainer>\n@@ -93,7 +84,6 @@ function WrappedAppNavigator(props: Props) {\n<PersistGate persistor={getPersistor()}>\n<PushHandler navigation={navigation} />\n</PersistGate>\n- {backButtonHandler}\n</KeyboardStateContainer>\n</OverlayableScrollViewStateContainer>\n</ChatInputStateContainer>\n@@ -101,49 +91,4 @@ function WrappedAppNavigator(props: Props) {\n}\nhoistNonReactStatics(WrappedAppNavigator, AppNavigator);\n-function BackButtonHandler(props: Props) {\n- const { navigation } = props;\n- const appCanRespondToBackButton = useAppCanRespondToBackButton();\n- const hardwareBack = React.useCallback(() => {\n- if (!appCanRespondToBackButton) {\n- return false;\n- }\n- navigation.goBack(null);\n- return true;\n- }, [appCanRespondToBackButton, navigation]);\n- React.useEffect(() => {\n- BackHandler.addEventListener('hardwareBackPress', hardwareBack);\n- return () => {\n- BackHandler.removeEventListener('hardwareBackPress', hardwareBack);\n- };\n- }, [hardwareBack]);\n- return null;\n-}\n-\n-function useAppCanRespondToBackButton() {\n- const navContext = React.useContext(NavContext);\n- return React.useMemo(() => {\n- if (!navContext) {\n- return false;\n- }\n- const { state } = navContext;\n- const currentRootSubroute = state.routes[state.index];\n- if (currentRootSubroute.routeName !== AppRouteName) {\n- return false;\n- }\n- const appRoute = assertNavigationRouteNotLeafNode(currentRootSubroute);\n- const currentAppSubroute = appRoute.routes[appRoute.index];\n- if (currentAppSubroute.routeName !== TabNavigatorRouteName) {\n- return true;\n- }\n- const tabRoute = assertNavigationRouteNotLeafNode(currentAppSubroute);\n- const currentTabSubroute = tabRoute.routes[tabRoute.index];\n- return (\n- currentTabSubroute.index !== null &&\n- currentTabSubroute.index !== undefined &&\n- currentTabSubroute.index > 0\n- );\n- }, [navContext]);\n-}\n-\nexport default WrappedAppNavigator;\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/root-router.js", "new_path": "native/navigation/root-router.js", "diff": "@@ -142,7 +142,22 @@ function RootRouter(\n} else if (action.type === setNavStateActionType) {\nreturn action.state;\n} else {\n- return stackRouter.getStateForAction(action, lastState);\n+ if (!lastState) {\n+ return lastState;\n+ }\n+ const lastRouteName = lastState.routes[lastState.index].routeName;\n+ const newState = stackRouter.getStateForAction(action, lastState);\n+ if (!newState) {\n+ return newState;\n+ }\n+ const newRouteName = newState.routes[newState.index].routeName;\n+ if (\n+ accountModals.includes(lastRouteName) &&\n+ lastRouteName !== newRouteName\n+ ) {\n+ return lastState;\n+ }\n+ return newState;\n}\n},\ngetActionCreators: (route: NavigationRoute, navStateKey: ?string) => ({\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Use default ReactNav back-button handling logic for Android Move gating logic to `RootRouter`
129,187
04.04.2020 15:18:43
14,400
7274e4e7c1267ceebe1d433ae32e6f6ba028b94f
[native] More SplashScreen.hide call to AppNavigator Don't do it until ReactNav is loaded
[ { "change_type": "MODIFY", "old_path": "native/navigation/app-navigator.react.js", "new_path": "native/navigation/app-navigator.react.js", "diff": "@@ -7,6 +7,8 @@ import * as React from 'react';\nimport { createBottomTabNavigator } from 'react-navigation-tabs';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport { PersistGate } from 'redux-persist/integration/react';\n+import SplashScreen from 'react-native-splash-screen';\n+import { Platform } from 'react-native';\nimport {\nCalendarRouteName,\n@@ -75,6 +77,14 @@ function WrappedAppNavigator(props: Props) {\nsetNavStateInitialized && setNavStateInitialized();\n}, [setNavStateInitialized]);\n+ React.useEffect(() => {\n+ if (Platform.OS === 'android') {\n+ setTimeout(SplashScreen.hide, 350);\n+ } else {\n+ SplashScreen.hide();\n+ }\n+ }, []);\n+\nconst { navigation } = props;\nreturn (\n<ChatInputStateContainer>\n" }, { "change_type": "MODIFY", "old_path": "native/root.react.js", "new_path": "native/root.react.js", "diff": "@@ -15,7 +15,6 @@ import {\nStyleSheet,\n} from 'react-native';\nimport PropTypes from 'prop-types';\n-import SplashScreen from 'react-native-splash-screen';\nimport Orientation from 'react-native-orientation-locker';\nimport { PersistGate } from 'redux-persist/integration/react';\nimport {\n@@ -104,11 +103,6 @@ class Root extends React.PureComponent<Props, State> {\n}\ncomponentDidMount() {\n- if (Platform.OS === 'android') {\n- setTimeout(SplashScreen.hide, 350);\n- } else {\n- SplashScreen.hide();\n- }\nNativeAppState.addEventListener('change', this.handleAppStateChange);\nOrientation.lockToPortrait();\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] More SplashScreen.hide call to AppNavigator Don't do it until ReactNav is loaded
129,187
04.04.2020 16:49:44
14,400
cb31ad8b0bee01cdaa2ef4c5c08407799fc28eac
[native] Persist nav state in dev environment
[ { "change_type": "MODIFY", "old_path": "native/root.react.js", "new_path": "native/root.react.js", "diff": "@@ -23,6 +23,7 @@ import {\ncreateAppContainer,\nNavigationActions,\n} from 'react-navigation';\n+import AsyncStorage from '@react-native-community/async-storage';\nimport { connect } from 'lib/utils/redux-utils';\nimport {\n@@ -65,6 +66,7 @@ type NavContainer = React.AbstractComponent<\nstate: NavigationState,\naction: NavAction,\n) => void,\n+ persistNavigationState?: (state: NavigationState) => Promise<void>,\n|},\n{\ndispatch: (action: NavAction) => boolean,\n@@ -72,6 +74,8 @@ type NavContainer = React.AbstractComponent<\n>;\nconst NavAppContainer: NavContainer = (createAppContainer(RootNavigator): any);\n+const navStateAsyncStorageKey = 'navState';\n+\ntype Props = {\n// Redux state\nactiveTheme: ?GlobalTheme,\n@@ -142,6 +146,9 @@ class Root extends React.PureComponent<Props, State> {\n<OrientationHandler />\n</>\n);\n+ const persistNavigationState = __DEV__\n+ ? this.persistNavigationState\n+ : undefined;\nreturn (\n<View style={styles.app}>\n<NavContext.Provider value={this.state.navContext}>\n@@ -152,6 +159,7 @@ class Root extends React.PureComponent<Props, State> {\ntheme={reactNavigationTheme}\nloadNavigationState={this.loadNavigationState}\nonNavigationStateChange={this.onNavigationStateChange}\n+ persistNavigationState={persistNavigationState}\nref={this.appContainerRef}\n/>\n<NavigationHandler />\n@@ -173,15 +181,31 @@ class Root extends React.PureComponent<Props, State> {\n};\nloadNavigationState = async () => {\n- this.navState = defaultNavigationState;\n+ let navState;\n+ if (__DEV__) {\n+ const navStateString = await AsyncStorage.getItem(\n+ navStateAsyncStorageKey,\n+ );\n+ if (navStateString) {\n+ try {\n+ navState = JSON.parse(navStateString);\n+ } catch (e) {\n+ console.log('JSON.parse threw while trying to dehydrate navState', e);\n+ }\n+ }\n+ }\n+ if (!navState) {\n+ navState = defaultNavigationState;\n+ }\n+ this.navState = navState;\nthis.setNavContext();\nactionLogger.addOtherAction(\n'navState',\nNavigationActions.init(),\nnull,\n- this.navState,\n+ navState,\n);\n- return defaultNavigationState;\n+ return navState;\n};\nonNavigationStateChange = (\n@@ -218,6 +242,17 @@ class Root extends React.PureComponent<Props, State> {\nthis.navStateInitialized = true;\nthis.setNavContext();\n};\n+\n+ persistNavigationState = async (state: NavigationState) => {\n+ try {\n+ await AsyncStorage.setItem(\n+ navStateAsyncStorageKey,\n+ JSON.stringify(state),\n+ );\n+ } catch (e) {\n+ console.log('AsyncStorage threw while trying to persist navState', e);\n+ }\n+ };\n}\nconst styles = StyleSheet.create({\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Persist nav state in dev environment
129,187
04.04.2020 18:17:48
14,400
82777d4c4dfbdc1dc3067a1a89f6ebffd2e698ef
Wait until dataLoaded to log in
[ { "change_type": "ADD", "old_path": null, "new_path": "lib/reducers/data-loaded-reducer.js", "diff": "+// @flow\n+\n+import type { BaseAction } from '../types/redux-types';\n+import {\n+ logOutActionTypes,\n+ deleteAccountActionTypes,\n+ logInActionTypes,\n+ registerActionTypes,\n+ resetPasswordActionTypes,\n+} from '../actions/user-actions';\n+import { setNewSessionActionType } from '../utils/action-utils';\n+\n+export default function reduceDataLoaded(state: boolean, action: BaseAction) {\n+ if (\n+ action.type === logInActionTypes.success ||\n+ action.type === resetPasswordActionTypes.success ||\n+ action.type === registerActionTypes.success\n+ ) {\n+ return true;\n+ } else if (\n+ action.type === setNewSessionActionType &&\n+ action.payload.sessionChange.currentUserInfo &&\n+ action.payload.sessionChange.currentUserInfo.anonymous\n+ ) {\n+ return false;\n+ } else if (\n+ action.type === logOutActionTypes.success ||\n+ action.type === deleteAccountActionTypes.success\n+ ) {\n+ return false;\n+ }\n+ return state;\n+}\n" }, { "change_type": "MODIFY", "old_path": "lib/reducers/master-reducer.js", "new_path": "lib/reducers/master-reducer.js", "diff": "@@ -20,6 +20,7 @@ import reduceConnectionInfo from './connection-reducer';\nimport reduceForeground from './foreground-reducer';\nimport reduceNextLocalID from './local-id-reducer';\nimport reduceQueuedReports from './report-reducer';\n+import reduceDataLoaded from './data-loaded-reducer';\nexport default function baseReducer<N: BaseNavInfo, T: BaseAppState<N>>(\nstate: T,\n@@ -80,5 +81,6 @@ export default function baseReducer<N: BaseNavInfo, T: BaseAppState<N>>(\nforeground: reduceForeground(state.foreground, action),\nnextLocalID: reduceNextLocalID(state.nextLocalID, action),\nqueuedReports: reduceQueuedReports(state.queuedReports, action),\n+ dataLoaded: reduceDataLoaded(state.dataLoaded, action),\n};\n}\n" }, { "change_type": "MODIFY", "old_path": "lib/selectors/user-selectors.js", "new_path": "lib/selectors/user-selectors.js", "diff": "@@ -155,9 +155,17 @@ const userSearchIndexForOtherMembersOfThread: (\nbaseUserSearchIndexForOtherMembersOfThread,\n);\n+const isLoggedIn = (state: BaseAppState<*>) =>\n+ !!(\n+ state.currentUserInfo &&\n+ !state.currentUserInfo.anonymous &&\n+ state.dataLoaded\n+ );\n+\nexport {\nuserIDsToRelativeUserInfos,\nrelativeMemberInfoSelectorForMembersOfThread,\nuserInfoSelectorForOtherMembersOfThread,\nuserSearchIndexForOtherMembersOfThread,\n+ isLoggedIn,\n};\n" }, { "change_type": "MODIFY", "old_path": "lib/types/redux-types.js", "new_path": "lib/types/redux-types.js", "diff": "@@ -85,6 +85,7 @@ export type BaseAppState<NavInfo: BaseNavInfo> = {\nforeground: boolean,\nnextLocalID: number,\nqueuedReports: $ReadOnlyArray<ClientReportCreationRequest>,\n+ dataLoaded: boolean,\n};\n// Web JS runtime doesn't have access to the cookie for security reasons.\n" }, { "change_type": "MODIFY", "old_path": "native/account/logged-out-modal.react.js", "new_path": "native/account/logged-out-modal.react.js", "diff": "@@ -37,6 +37,7 @@ import {\nappStartReduxLoggedInButInvalidCookie,\n} from 'lib/actions/user-actions';\nimport { connect } from 'lib/utils/redux-utils';\n+import { isLoggedIn } from 'lib/selectors/user-selectors';\nimport {\ndimensionsSelector,\n@@ -767,11 +768,7 @@ export default connectNav((context: ?NavContextType) => ({\n),\ncookie: state.cookie,\nurlPrefix: state.urlPrefix,\n- loggedIn: !!(\n- state.currentUserInfo &&\n- !state.currentUserInfo.anonymous &&\n- true\n- ),\n+ loggedIn: isLoggedIn(state),\ndimensions: dimensionsSelector(state),\ncontentVerticalOffset: contentVerticalOffsetSelector(state),\nsplashStyle: splashStyleSelector(state),\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/navigation-handler.react.js", "new_path": "native/navigation/navigation-handler.react.js", "diff": "@@ -5,6 +5,8 @@ import type { AppState } from '../redux/redux-setup';\nimport * as React from 'react';\nimport { useSelector } from 'react-redux';\n+import { isLoggedIn } from 'lib/selectors/user-selectors';\n+\nimport { NavContext, type NavAction } from './navigation-context';\nimport { useIsAppLoggedIn } from './nav-selectors';\nimport LinkingHandler from './linking-handler.react';\n@@ -55,15 +57,11 @@ const LogInHandler = React.memo<LogInHandlerProps>(\n(props: LogInHandlerProps) => {\nconst { dispatch } = props;\n- const loggedIn = useSelector(\n- (state: AppState) =>\n- !!(\n- state.currentUserInfo &&\n- !state.currentUserInfo.anonymous &&\n- state.cookie &&\n- state.cookie.startsWith('user=')\n- ),\n+ const hasCurrentUserInfo = useSelector(isLoggedIn);\n+ const hasUserCookie = useSelector(\n+ (state: AppState) => !!(state.cookie && state.cookie.startsWith('user=')),\n);\n+ const loggedIn = hasCurrentUserInfo && hasUserCookie;\nconst navLoggedIn = useIsAppLoggedIn();\n" }, { "change_type": "MODIFY", "old_path": "native/push/push-handler.react.js", "new_path": "native/push/push-handler.react.js", "diff": "@@ -50,6 +50,7 @@ import {\nsetDeviceToken,\n} from 'lib/actions/device-actions';\nimport { mergePrefixIntoBody } from 'lib/shared/notif-utils';\n+import { isLoggedIn } from 'lib/selectors/user-selectors';\nimport {\nrecordNotifPermissionAlertActionType,\n@@ -619,11 +620,7 @@ export default connectNav((context: ?NavContextType) => ({\nconnection: state.connection,\nupdatesCurrentAsOf: state.updatesCurrentAsOf,\nactiveTheme: state.globalThemeInfo.activeTheme,\n- loggedIn: !!(\n- state.currentUserInfo &&\n- !state.currentUserInfo.anonymous &&\n- true\n- ),\n+ loggedIn: isLoggedIn(state),\n}),\n{ setDeviceToken },\n)(withRootContext(PushHandler)),\n" }, { "change_type": "MODIFY", "old_path": "native/redux/persist.js", "new_path": "native/redux/persist.js", "diff": "@@ -156,6 +156,7 @@ const migrations = {\nconst result = {\n...state,\nmessageSentFromRoute: undefined,\n+ dataLoaded: !!state.currentUserInfo && !state.currentUserInfo.anonymous,\n};\nif (state.navInfo) {\nresult.navInfo = {\n" }, { "change_type": "MODIFY", "old_path": "native/redux/redux-setup.js", "new_path": "native/redux/redux-setup.js", "diff": "@@ -97,6 +97,7 @@ export type AppState = {|\ncalendarFilters: $ReadOnlyArray<CalendarFilter>,\ncookie: ?string,\ndeviceToken: ?string,\n+ dataLoaded: boolean,\nurlPrefix: string,\ncustomServer: ?string,\nthreadIDsToNotifIDs: { [threadID: string]: string[] },\n@@ -143,6 +144,7 @@ const defaultState = ({\ncalendarFilters: defaultCalendarFilters,\ncookie: null,\ndeviceToken: null,\n+ dataLoaded: false,\nurlPrefix: defaultURLPrefix(),\ncustomServer: natServer,\nthreadIDsToNotifIDs: {},\n" }, { "change_type": "MODIFY", "old_path": "native/selectors/calendar-selectors.js", "new_path": "native/selectors/calendar-selectors.js", "diff": "@@ -11,6 +11,7 @@ import {\nthreadInfoSelector,\n} from 'lib/selectors/thread-selectors';\nimport { dateString } from 'lib/utils/date-utils';\n+import { isLoggedIn } from 'lib/selectors/user-selectors';\nexport type SectionHeaderItem = {|\nitemType: 'header',\n@@ -35,8 +36,7 @@ export type CalendarItem =\n|};\nconst calendarListData: (state: AppState) => ?(CalendarItem[]) = createSelector(\n- (state: AppState) =>\n- !!(state.currentUserInfo && !state.currentUserInfo.anonymous && true),\n+ isLoggedIn,\ncurrentDaysToEntries,\nthreadInfoSelector,\n(\n" }, { "change_type": "MODIFY", "old_path": "server/src/responders/website-responders.js", "new_path": "server/src/responders/website-responders.js", "diff": "@@ -290,6 +290,7 @@ async function websiteResponder(\nuserAgent: viewer.userAgent,\ncookie: undefined,\ndeviceToken: undefined,\n+ dataLoaded: viewer.loggedIn,\n};\nconst state = await promiseAll(statePromises);\n" }, { "change_type": "MODIFY", "old_path": "web/app.react.js", "new_path": "web/app.react.js", "diff": "@@ -38,6 +38,7 @@ import {\nbackgroundActionType,\nforegroundActionType,\n} from 'lib/reducers/foreground-reducer';\n+import { isLoggedIn } from 'lib/selectors/user-selectors';\nimport { canonicalURLFromReduxState, navInfoFromURL } from './url-utils';\nimport css from './style.css';\n@@ -352,11 +353,7 @@ export default connect(\nfetchEntriesLoadingStatusSelector(state),\nupdateCalendarQueryLoadingStatusSelector(state),\n),\n- loggedIn: !!(\n- state.currentUserInfo &&\n- !state.currentUserInfo.anonymous &&\n- true\n- ),\n+ loggedIn: isLoggedIn(state),\nmostRecentReadThread: mostRecentReadThreadSelector(state),\nactiveThreadCurrentlyUnread:\n!activeChatThreadID ||\n" }, { "change_type": "MODIFY", "old_path": "web/redux-setup.js", "new_path": "web/redux-setup.js", "diff": "@@ -67,6 +67,7 @@ export type AppState = {|\nqueuedReports: $ReadOnlyArray<ClientReportCreationRequest>,\ntimeZone: ?string,\nuserAgent: ?string,\n+ dataLoaded: boolean,\n|};\nexport const updateNavInfoActionType = 'UPDATE_NAV_INFO';\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Wait until dataLoaded to log in
129,187
04.04.2020 19:16:54
14,400
61360a1dfb87a9539ffb692a2e82ae5695a265e3
[native] Immediately clear thread screens when leaving or deleting a thread
[ { "change_type": "MODIFY", "old_path": "native/chat/settings/delete-thread.react.js", "new_path": "native/chat/settings/delete-thread.react.js", "diff": "@@ -237,9 +237,13 @@ class DeleteThread extends React.PureComponent<Props, State> {\n};\nasync deleteThread() {\n+ const threadInfo = DeleteThread.getThreadInfo(this.props);\nconst { navContext } = this.props;\ninvariant(navContext, 'navContext should exist in deleteThread');\n- const threadInfo = DeleteThread.getThreadInfo(this.props);\n+ navContext.dispatch({\n+ type: clearThreadsActionType,\n+ threadIDs: [threadInfo.id],\n+ });\ntry {\nconst result = await this.props.deleteThread(\nthreadInfo.id,\n" }, { "change_type": "MODIFY", "old_path": "native/chat/settings/thread-settings-leave-thread.react.js", "new_path": "native/chat/settings/thread-settings-leave-thread.react.js", "diff": "@@ -125,9 +125,13 @@ class ThreadSettingsLeaveThread extends React.PureComponent<Props> {\n};\nasync leaveThread() {\n+ const threadID = this.props.threadInfo.id;\nconst { navContext } = this.props;\ninvariant(navContext, 'navContext should exist in leaveThread');\n- const threadID = this.props.threadInfo.id;\n+ navContext.dispatch({\n+ type: clearThreadsActionType,\n+ threadIDs: [threadID],\n+ });\ntry {\nconst result = await this.props.leaveThread(threadID);\nconst invalidated = identifyInvalidatedThreads(\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Immediately clear thread screens when leaving or deleting a thread
129,187
05.04.2020 11:01:03
14,400
194013c06454dd8fbe07e7b3f19df3311a616c3c
[native] Fix up ChatInputBar height resizing
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-input-bar.react.js", "new_path": "native/chat/chat-input-bar.react.js", "diff": "@@ -99,7 +99,6 @@ type Props = {|\n|};\ntype State = {|\ntext: string,\n- height: number,\nbuttonsExpanded: boolean,\n|};\nclass ChatInputBar extends React.PureComponent<Props, State> {\n@@ -128,7 +127,6 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nsuper(props);\nthis.state = {\ntext: props.draft,\n- height: 0,\nbuttonsExpanded: true,\n};\nthis.expandoButtonsOpacity = new Animated.Value(1);\n@@ -203,10 +201,6 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nTextInputKeyboardMangerIOS.setKeyboardHeight(textInput, keyboardHeight);\n}\n- get textInputStyle() {\n- return { height: Math.max(this.state.height, 30) };\n- }\n-\nget expandoButtonsStyle() {\nreturn {\n...this.props.styles.expandoButtons,\n@@ -346,8 +340,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nplaceholder=\"Send a message...\"\nplaceholderTextColor={this.props.colors.listInputButton}\nmultiline={true}\n- onContentSizeChange={this.onContentSizeChange}\n- style={[this.props.styles.textInput, this.textInputStyle]}\n+ style={this.props.styles.textInput}\nref={this.textInputRef}\n/>\n</View>\n@@ -418,13 +411,6 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n});\n}, 400);\n- onContentSizeChange = event => {\n- let height = event.nativeEvent.contentSize.height;\n- // iOS doesn't include the margin on this callback\n- height = Platform.OS === 'ios' ? height + 10 : height;\n- this.setState({ height });\n- };\n-\nonSend = () => {\nconst text = this.state.text.trim();\nif (!text) {\n@@ -537,6 +523,7 @@ const styles = {\nborderRadius: 10,\nfontSize: 16,\ncolor: 'listForegroundLabel',\n+ maxHeight: 250,\n},\nbottomAligned: {\nalignSelf: 'flex-end',\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Fix up ChatInputBar height resizing
129,187
05.04.2020 15:30:32
14,400
9725058a1ebf6c392c3b67e33a020a38e2fad017
[native] Fix VerificationModal navigation
[ { "change_type": "MODIFY", "old_path": "native/account/verification-modal.react.js", "new_path": "native/account/verification-modal.react.js", "diff": "@@ -239,6 +239,8 @@ class VerificationModal extends React.PureComponent<Props, State> {\n// Wait a couple seconds before letting the SUCCESS action propagate and\n// clear VerificationModal\nawait sleep(1750);\n+\n+ this.dismiss();\n};\nasync handleVerificationCodeAction() {\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/root-router.js", "new_path": "native/navigation/root-router.js", "diff": "@@ -153,7 +153,7 @@ function RootRouter(\nconst newRouteName = newState.routes[newState.index].routeName;\nif (\naccountModals.includes(lastRouteName) &&\n- lastRouteName !== newRouteName\n+ !accountModals.includes(newRouteName)\n) {\nreturn lastState;\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Fix VerificationModal navigation
129,187
06.04.2020 12:00:07
14,400
979691cb424b0f2a570c0de436b2ff69493cc899
[native] codeVersion -> 45
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -131,8 +131,8 @@ android {\napplicationId \"org.squadcal\"\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 44\n- versionName \"0.0.44\"\n+ versionCode 45\n+ versionName \"0.0.45\"\nmissingDimensionStrategy 'react-native-camera', 'general'\nmultiDexEnabled true\n}\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal/Info.debug.plist", "new_path": "native/ios/SquadCal/Info.debug.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.44</string>\n+ <string>0.0.45</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>44</string>\n+ <string>45</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal/Info.release.plist", "new_path": "native/ios/SquadCal/Info.release.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.44</string>\n+ <string>0.0.45</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>44</string>\n+ <string>45</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/redux/persist.js", "new_path": "native/redux/persist.js", "diff": "@@ -178,7 +178,7 @@ const persistConfig = {\ntimeout: __DEV__ ? 0 : undefined,\n};\n-const codeVersion = 44;\n+const codeVersion = 45;\n// This local exists to avoid a circular dependency where redux-setup needs to\n// import all the navigation and screen stuff, but some of those screens want to\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] codeVersion -> 45
129,187
06.04.2020 14:07:29
14,400
5d4ab8a923a7b654e18f63c35c7125ee040a961b
[server] Fix partial HTML broken by Prettier
[ { "change_type": "MODIFY", "old_path": "server/src/responders/website-responders.js", "new_path": "server/src/responders/website-responders.js", "diff": "@@ -223,6 +223,7 @@ async function websiteResponder(\nconst { jsURL, fontsURL, cssInclude } = await assetInfoPromise;\n+ // prettier-ignore\nres.write(html`\n<!DOCTYPE html>\n<html lang=\"en\">\n@@ -257,9 +258,7 @@ async function websiteResponder(\n<meta name=\"theme-color\" content=\"#b91d47\" />\n</head>\n<body>\n- <div id=\"react-root\"></div>\n- </body>\n- </html>\n+ <div id=\"react-root\">\n`);\nconst statePromises = {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Fix partial HTML broken by Prettier
129,187
06.04.2020 20:02:48
14,400
adc778c681ff4cc0b16a322b037cf71d66893b8a
[lib] Extend server socket timeout from 15s to 2min
[ { "change_type": "MODIFY", "old_path": "lib/shared/timeouts.js", "new_path": "lib/shared/timeouts.js", "diff": "@@ -23,6 +23,6 @@ export const clientRequestSocketTimeout = 5000; // in milliseconds\nexport const fetchJSONTimeout = 10000; // in milliseconds\n// The server expects to get a request at least every three seconds from the\n-// client. If it doesn't get a request within a fifteen second window, it will\n-// close the connection.\n-export const serverRequestSocketTimeout = 15000; // in milliseconds\n+// client. If it doesn't get a request within a two minute window, it will close\n+// the connection.\n+export const serverRequestSocketTimeout = 120000; // in milliseconds\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Extend server socket timeout from 15s to 2min
129,187
06.04.2020 20:15:39
14,400
e3b781c5c7a4e3b415517ab7bf127fbff20b37e9
[native] Use assets-library:// scheme on iOS
[ { "change_type": "MODIFY", "old_path": "native/media/media-gallery-keyboard.react.js", "new_path": "native/media/media-gallery-keyboard.react.js", "diff": "@@ -249,9 +249,10 @@ class MediaGalleryKeyboard extends React.PureComponent<Props, State> {\nplayableDuration !== null &&\nplayableDuration !== undefined) ||\n(Platform.OS === 'ios' && node.type === 'video');\n- const uri = isVideo\n- ? MediaGalleryKeyboard.compatibleURI(node.image.uri, filename)\n- : node.image.uri;\n+ const uri = MediaGalleryKeyboard.compatibleURI(\n+ node.image.uri,\n+ filename,\n+ );\nif (existingURIs.has(uri)) {\nif (first) {\n" }, { "change_type": "MODIFY", "old_path": "native/utils/media-utils.js", "new_path": "native/utils/media-utils.js", "diff": "@@ -366,9 +366,16 @@ function getCompatibleMediaURI(uri: string, ext: string): string {\nreturn uri;\n}\n// While the ph:// scheme is a Facebook hack used by FBMediaKit, the\n- // assets-library:// scheme is a legacy Apple identifier. Certain components\n- // and libraries (namely react-native-video) don't know how to handle the\n- // ph:// scheme yet, so we have to map to the legacy assets-library:// scheme\n+ // assets-library:// scheme is a legacy Apple identifier. We map to the former\n+ // because:\n+ // (1) Some libraries (namely react-native-video) don't know how to handle the\n+ // ph:// scheme yet\n+ // (2) In RN0.60, uploading ph:// JPEGs leads to recompression and often\n+ // increases file size! It has the nice side effect of rotating image data\n+ // based on EXIF orientation, but this isn't worth it for us\n+ // https://github.com/facebook/react-native/issues/27099#issuecomment-602016225\n+ // https://github.com/expo/expo/issues/3177\n+ // https://github.com/react-native-community/react-native-video/issues/1572\nreturn (\n`assets-library://asset/asset.${ext}` +\n`?id=${photoKitLocalIdentifier}&ext=${ext}`\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Use assets-library:// scheme on iOS
129,187
06.04.2020 22:06:08
14,400
4b55f1cb8b3e306a17656acc11e72fdc928e5f12
[lib] Allow custom UploadBlob function
[ { "change_type": "MODIFY", "old_path": "lib/actions/upload-actions.js", "new_path": "lib/actions/upload-actions.js", "diff": "import type { FetchJSON } from '../utils/fetch-json';\nimport type { UploadMultimediaResult } from '../types/media-types';\n+import type { UploadBlob } from '../utils/upload-blob';\n+\n+export type MultimediaUploadCallbacks = $Shape<{|\n+ onProgress: (percent: number) => void,\n+ abortHandler: (abort: () => void) => void,\n+ uploadBlob: UploadBlob,\n+|}>;\nasync function uploadMultimedia(\nfetchJSON: FetchJSON,\nmultimedia: Object,\n- onProgress: (percent: number) => void,\n- abortHandler?: (abort: () => void) => void,\n+ callbacks?: MultimediaUploadCallbacks,\n): Promise<UploadMultimediaResult> {\n+ const onProgress = callbacks && callbacks.onProgress;\n+ const abortHandler = callbacks && callbacks.abortHandler;\n+ const uploadBlob = callbacks && callbacks.uploadBlob;\nconst response = await fetchJSON(\n'upload_multimedia',\n{ multimedia: [multimedia] },\n- { blobUpload: true, onProgress, abortHandler },\n+ {\n+ onProgress,\n+ abortHandler,\n+ blobUpload: uploadBlob ? uploadBlob : true,\n+ },\n);\nconst [uploadResult] = response.results;\nreturn { id: uploadResult.id, uri: uploadResult.uri };\n" }, { "change_type": "MODIFY", "old_path": "lib/utils/fetch-json.js", "new_path": "lib/utils/fetch-json.js", "diff": "@@ -19,13 +19,13 @@ import { ServerError, FetchTimeout } from './errors';\nimport { getConfig } from './config';\nimport sleep from './sleep';\nimport { SocketOffline, SocketTimeout } from '../socket/inflight-requests';\n-import { uploadBlob } from './upload-blob';\n+import { uploadBlob, type UploadBlob } from './upload-blob';\nimport { fetchJSONTimeout } from '../shared/timeouts';\nexport type FetchJSONOptions = $Shape<{|\n// null timeout means no timeout, which is the default for uploadBlob\ntimeout: ?number, // in milliseconds\n- blobUpload: boolean,\n+ blobUpload: boolean | UploadBlob,\n// the rest (onProgress, abortHandler) only work with blobUpload\nonProgress: (percent: number) => void,\n// abortHandler will receive an abort function once the upload starts\n@@ -109,7 +109,11 @@ async function fetchJSON(\nlet json;\nif (options && options.blobUpload) {\n- json = await uploadBlob(url, cookie, sessionID, input, options);\n+ const uploadBlobCallback =\n+ typeof options.blobUpload === 'function'\n+ ? options.blobUpload\n+ : uploadBlob;\n+ json = await uploadBlobCallback(url, cookie, sessionID, input, options);\n} else {\nconst mergedData: RequestData = { input };\nif (getConfig().setCookieOnRequest) {\n" }, { "change_type": "MODIFY", "old_path": "lib/utils/upload-blob.js", "new_path": "lib/utils/upload-blob.js", "diff": "@@ -115,4 +115,6 @@ function uploadBlob(\nreturn responsePromise;\n}\n+export type UploadBlob = typeof uploadBlob;\n+\nexport { uploadBlob };\n" }, { "change_type": "MODIFY", "old_path": "native/chat/chat-input-state-container.react.js", "new_path": "native/chat/chat-input-state-container.react.js", "diff": "@@ -38,6 +38,7 @@ import { connect } from 'lib/utils/redux-utils';\nimport {\nuploadMultimedia,\nupdateMultimediaMessageMediaActionType,\n+ type MultimediaUploadCallbacks,\n} from 'lib/actions/upload-actions';\nimport {\ncreateLocalMessageActionType,\n@@ -73,8 +74,7 @@ type Props = {|\n// async functions that hit server APIs\nuploadMultimedia: (\nmultimedia: Object,\n- onProgress: (percent: number) => void,\n- abortHandler?: (abort: () => void) => void,\n+ callbacks: MultimediaUploadCallbacks,\n) => Promise<UploadMultimediaResult>,\nsendMultimediaMessage: (\nthreadID: string,\n@@ -487,7 +487,10 @@ class ChatInputStateContainer extends React.PureComponent<Props, State> {\ntry {\nuploadResult = await this.props.uploadMultimedia(\n{ uri: uploadURI, name, type: mime },\n- (percent: number) => this.setProgress(localMessageID, localID, percent),\n+ {\n+ onProgress: (percent: number) =>\n+ this.setProgress(localMessageID, localID, percent),\n+ },\n);\nmediaMissionResult = { success: true, totalTime: Date.now() - start };\n} catch (e) {\n" }, { "change_type": "MODIFY", "old_path": "web/chat/chat-input-state-container.react.js", "new_path": "web/chat/chat-input-state-container.react.js", "diff": "@@ -33,6 +33,7 @@ import {\nuploadMultimedia,\nupdateMultimediaMessageMediaActionType,\ndeleteUpload,\n+ type MultimediaUploadCallbacks,\n} from 'lib/actions/upload-actions';\nimport {\ncreateLocalMessageActionType,\n@@ -62,8 +63,7 @@ type Props = {|\n// async functions that hit server APIs\nuploadMultimedia: (\nmultimedia: Object,\n- onProgress: (percent: number) => void,\n- abortHandler?: (abort: () => void) => void,\n+ callbacks: MultimediaUploadCallbacks,\n) => Promise<UploadMultimediaResult>,\ndeleteUpload: (id: string) => Promise<void>,\nsendMultimediaMessage: (\n@@ -411,13 +411,12 @@ class ChatInputStateContainer extends React.PureComponent<Props, State> {\nasync uploadFile(threadID: string, upload: PendingMultimediaUpload) {\nlet result;\ntry {\n- result = await this.props.uploadMultimedia(\n- upload.file,\n- (percent: number) =>\n+ result = await this.props.uploadMultimedia(upload.file, {\n+ onProgress: (percent: number) =>\nthis.setProgress(threadID, upload.localID, percent),\n- (abort: () => void) =>\n+ abortHandler: (abort: () => void) =>\nthis.handleAbortCallback(threadID, upload.localID, abort),\n- );\n+ });\n} catch (e) {\nthis.handleUploadFailure(threadID, upload.localID, e);\nreturn;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Allow custom UploadBlob function
129,187
07.04.2020 01:11:41
14,400
ac56bea4463788ee4b2960df22322e21edbce5a3
Use react-native-background-upload to upload multimedia on native
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-input-state-container.react.js", "new_path": "native/chat/chat-input-state-container.react.js", "diff": "@@ -27,12 +27,17 @@ import {\ntype MediaMissionReportCreationRequest,\nreportTypes,\n} from 'lib/types/report-types';\n+import type {\n+ FetchJSONOptions,\n+ FetchJSONServerResponse,\n+} from 'lib/utils/fetch-json';\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport invariant from 'invariant';\nimport { createSelector } from 'reselect';\nimport filesystem from 'react-native-fs';\n+import * as Upload from 'react-native-background-upload';\nimport { connect } from 'lib/utils/redux-utils';\nimport {\n@@ -490,6 +495,7 @@ class ChatInputStateContainer extends React.PureComponent<Props, State> {\n{\nonProgress: (percent: number) =>\nthis.setProgress(localMessageID, localID, percent),\n+ uploadBlob: this.uploadBlob,\n},\n);\nmediaMissionResult = { success: true, totalTime: Date.now() - start };\n@@ -574,6 +580,66 @@ class ChatInputStateContainer extends React.PureComponent<Props, State> {\n});\n}\n+ uploadBlob = async (\n+ url: string,\n+ cookie: ?string,\n+ sessionID: ?string,\n+ input: { [key: string]: mixed },\n+ options?: ?FetchJSONOptions,\n+ ): Promise<FetchJSONServerResponse> => {\n+ invariant(\n+ cookie &&\n+ input.multimedia &&\n+ Array.isArray(input.multimedia) &&\n+ input.multimedia.length === 1 &&\n+ input.multimedia[0] &&\n+ typeof input.multimedia[0] === 'object',\n+ 'ChatInputStateContainer.uploadBlob sent incorrect input',\n+ );\n+ const { uri, name, type } = input.multimedia[0];\n+ invariant(\n+ typeof uri === 'string' &&\n+ typeof name === 'string' &&\n+ typeof type === 'string',\n+ 'ChatInputStateContainer.uploadBlob sent incorrect input',\n+ );\n+ const uploadID = await Upload.startUpload({\n+ url,\n+ path: uri,\n+ type: 'multipart',\n+ headers: {\n+ Accept: 'application/json',\n+ },\n+ field: 'multimedia',\n+ parameters: {\n+ cookie,\n+ filename: name,\n+ },\n+ });\n+ if (options && options.abortHandler) {\n+ options.abortHandler(() => {\n+ Upload.cancelUpload(uploadID);\n+ });\n+ }\n+ return await new Promise((resolve, reject) => {\n+ Upload.addListener('error', uploadID, data => {\n+ reject(data.error);\n+ });\n+ Upload.addListener('cancelled', uploadID, () => {\n+ reject(new Error('request aborted'));\n+ });\n+ Upload.addListener('completed', uploadID, data => {\n+ resolve(JSON.parse(data.responseBody));\n+ });\n+ if (options && options.onProgress) {\n+ const { onProgress } = options;\n+ Upload.addListener('progress', uploadID, data =>\n+ onProgress(data.progress / 100),\n+ );\n+ }\n+ });\n+ };\n+\nhandleUploadFailure(\nlocalMessageID: string,\nlocalUploadID: string,\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -74,6 +74,8 @@ PODS:\n- React-cxxreact (= 0.60.6)\n- React-jsi (= 0.60.6)\n- React-jsinspector (0.60.6)\n+ - react-native-background-upload (5.6.0):\n+ - React\n- react-native-camera (3.8.0):\n- React\n- react-native-camera/RCT (= 3.8.0)\n@@ -184,6 +186,7 @@ DEPENDENCIES:\n- React-jsi (from `../../node_modules/react-native/ReactCommon/jsi`)\n- React-jsiexecutor (from `../../node_modules/react-native/ReactCommon/jsiexecutor`)\n- React-jsinspector (from `../../node_modules/react-native/ReactCommon/jsinspector`)\n+ - react-native-background-upload (from `../../node_modules/react-native-background-upload`)\n- react-native-camera (from `../../node_modules/react-native-camera`)\n- \"react-native-cameraroll (from `../../node_modules/@react-native-community/cameraroll`)\"\n- react-native-ffmpeg/min-lts (from `../../node_modules/react-native-ffmpeg/ios/react-native-ffmpeg.podspec`)\n@@ -260,6 +263,8 @@ EXTERNAL SOURCES:\n:path: \"../../node_modules/react-native/ReactCommon/jsiexecutor\"\nReact-jsinspector:\n:path: \"../../node_modules/react-native/ReactCommon/jsinspector\"\n+ react-native-background-upload:\n+ :path: \"../../node_modules/react-native-background-upload\"\nreact-native-camera:\n:path: \"../../node_modules/react-native-camera\"\nreact-native-cameraroll:\n@@ -355,6 +360,7 @@ SPEC CHECKSUMS:\nReact-jsi: 1a4248256b96fa453536a8dafe11b784e24e789d\nReact-jsiexecutor: 2279e559b921d02dfc6253ebef3dcb3a9dc6c07e\nReact-jsinspector: a58b86545a0185f69768e78ac96ca9fe43fa3694\n+ react-native-background-upload: 6e8ba7f41a6308231306bddc88f11da3b74c9de4\nreact-native-camera: 21cf4ed26cf432ceb1fae959aa6924943fd6f714\nreact-native-cameraroll: 463aff54e37cff27ea76eb792e6f1fa43b876320\nreact-native-ffmpeg: 35e303059e3c958cb74e271a45f9391d044f915a\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"lottie-react-native\": \"^3.2.1\",\n\"react\": \"16.8.6\",\n\"react-native\": \"0.60.6\",\n+ \"react-native-background-upload\": \"^5.6.0\",\n\"react-native-camera\": \"^3.8.0\",\n\"react-native-dark-mode\": \"^0.2.0-rc.1\",\n\"react-native-exit-app\": \"^1.1.0\",\n" }, { "change_type": "MODIFY", "old_path": "server/src/uploads/uploads.js", "new_path": "server/src/uploads/uploads.js", "diff": "@@ -35,13 +35,22 @@ async function multimediaUploadResponder(\nviewer: Viewer,\nreq: $Request & { files?: $ReadOnlyArray<MulterFile> },\n): Promise<MultimediaUploadResult> {\n- const { files } = req;\n- if (!files) {\n+ const { files, body } = req;\n+ if (!files || !body || typeof body !== 'object') {\n+ throw new ServerError('invalid_parameters');\n+ }\n+ const overrideFilename =\n+ files.length === 1 && body.filename ? body.filename : null;\n+ if (overrideFilename && typeof overrideFilename !== 'string') {\nthrow new ServerError('invalid_parameters');\n}\nconst validationResults = await Promise.all(\nfiles.map(({ buffer, size, originalname }) =>\n- validateAndConvert(buffer, originalname, size),\n+ validateAndConvert(\n+ buffer,\n+ overrideFilename ? overrideFilename : originalname,\n+ size,\n+ ),\n),\n);\nconst uploadInfos = validationResults.filter(Boolean);\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "@@ -11456,6 +11456,11 @@ react-linkify@^1.0.0-alpha:\nlinkify-it \"^2.0.3\"\ntlds \"^1.199.0\"\n+react-native-background-upload@^5.6.0:\n+ version \"5.6.0\"\n+ resolved \"https://registry.yarnpkg.com/react-native-background-upload/-/react-native-background-upload-5.6.0.tgz#77953c78571c5c7d7a4885207743c6c462f22066\"\n+ integrity sha512-JWtRVs3LIP41BFIEd01wit/O/hsGcGPDBYASZFal+0wPYJHjZZCVFOj2sEQ/NSOb4ow7RXtkYYJEKnQt+RiMPw==\n+\nreact-native-camera@^3.8.0:\nversion \"3.8.0\"\nresolved \"https://registry.yarnpkg.com/react-native-camera/-/react-native-camera-3.8.0.tgz#c2e6aaa62dc84e07180c3ea29a5bfc4d24b188a7\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Use react-native-background-upload to upload multimedia on native
129,187
07.04.2020 02:39:39
14,400
774192ea2b1e0b8c6395071c2eb614333c36d17c
[native] ChatInputStateContainer -> InputStateContainer
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-input-bar.react.js", "new_path": "native/chat/chat-input-bar.react.js", "diff": "@@ -27,10 +27,10 @@ import {\nmessageListNavPropType,\n} from './message-list-types';\nimport {\n- type ChatInputState,\n- chatInputStatePropType,\n- withChatInputState,\n-} from './chat-input-state';\n+ type InputState,\n+ inputStatePropType,\n+ withInputState,\n+} from '../input/input-state';\nimport * as React from 'react';\nimport {\n@@ -94,8 +94,8 @@ type Props = {|\ndispatchActionPromise: DispatchActionPromise,\n// async functions that hit server APIs\njoinThread: (request: ClientThreadJoinRequest) => Promise<ThreadJoinPayload>,\n- // withChatInputState\n- chatInputState: ?ChatInputState,\n+ // withInputState\n+ inputState: ?InputState,\n|};\ntype State = {|\ntext: string,\n@@ -116,7 +116,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\ndispatchActionPayload: PropTypes.func.isRequired,\ndispatchActionPromise: PropTypes.func.isRequired,\njoinThread: PropTypes.func.isRequired,\n- chatInputState: chatInputStatePropType,\n+ inputState: inputStatePropType,\n};\ntextInput: ?TextInput;\nexpandOpacity: Animated.Value;\n@@ -421,10 +421,10 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nconst creatorID = this.props.viewerID;\ninvariant(creatorID, 'should have viewer ID in order to send a message');\ninvariant(\n- this.props.chatInputState,\n- 'chatInputState should be set in ChatInputBar.onSend',\n+ this.props.inputState,\n+ 'inputState should be set in ChatInputBar.onSend',\n);\n- this.props.chatInputState.sendTextMessage({\n+ this.props.inputState.sendTextMessage({\ntype: messageTypes.TEXT,\nlocalID,\nthreadID: this.props.threadInfo.id,\n@@ -615,5 +615,5 @@ export default connectNav((context: ?NavContextType) => ({\n};\n},\n{ joinThread },\n- )(withKeyboardState(withChatInputState(ChatInputBar))),\n+ )(withKeyboardState(withInputState(ChatInputBar))),\n);\n" }, { "change_type": "MODIFY", "old_path": "native/chat/chat.react.js", "new_path": "native/chat/chat.react.js", "diff": "@@ -35,7 +35,7 @@ import {\nimport HeaderBackButton from '../navigation/header-back-button.react';\nimport ChatHeader from './chat-header.react';\nimport ChatRouter from './chat-router';\n-import { ChatInputStateContext } from './chat-input-state';\n+import { InputStateContext } from '../input/input-state';\nimport KeyboardAvoidingView from '../keyboard/keyboard-avoiding-view.react';\nimport MessageStorePruner from './message-store-pruner.react';\nimport ThreadScreenPruner from './thread-screen-pruner.react';\n@@ -135,7 +135,7 @@ ChatNavigator.navigationOptions = {\nfunction WrappedChatNavigator(props: Props) {\nconst { navigation } = props;\n- const chatInputState = React.useContext(ChatInputStateContext);\n+ const inputState = React.useContext(InputStateContext);\nconst clearScreens = React.useCallback(\n() => navigation.clearScreens([ComposeThreadRouteName], true),\n@@ -143,12 +143,12 @@ function WrappedChatNavigator(props: Props) {\n);\nReact.useEffect(() => {\n- if (!chatInputState) {\n+ if (!inputState) {\nreturn undefined;\n}\n- chatInputState.registerSendCallback(clearScreens);\n- return () => chatInputState.unregisterSendCallback(clearScreens);\n- }, [chatInputState, clearScreens]);\n+ inputState.registerSendCallback(clearScreens);\n+ return () => inputState.unregisterSendCallback(clearScreens);\n+ }, [inputState, clearScreens]);\nreturn (\n<KeyboardAvoidingView style={styles.keyboardAvoidingView}>\n" }, { "change_type": "MODIFY", "old_path": "native/chat/failed-send.react.js", "new_path": "native/chat/failed-send.react.js", "diff": "@@ -6,10 +6,10 @@ import { messageTypes, type RawMessageInfo } from 'lib/types/message-types';\nimport type { AppState } from '../redux/redux-setup';\nimport type { Styles } from '../types/styles';\nimport {\n- type ChatInputState,\n- chatInputStatePropType,\n- withChatInputState,\n-} from './chat-input-state';\n+ type InputState,\n+ inputStatePropType,\n+ withInputState,\n+} from '../input/input-state';\nimport * as React from 'react';\nimport { Text, View } from 'react-native';\n@@ -31,15 +31,15 @@ type Props = {|\n// Redux state\nrawMessageInfo: ?RawMessageInfo,\nstyles: Styles,\n- // withChatInputState\n- chatInputState: ?ChatInputState,\n+ // withInputState\n+ inputState: ?InputState,\n|};\nclass FailedSend extends React.PureComponent<Props> {\nstatic propTypes = {\nitem: chatMessageItemPropType.isRequired,\nrawMessageInfo: PropTypes.object,\nstyles: PropTypes.objectOf(PropTypes.object).isRequired,\n- chatInputState: chatInputStatePropType,\n+ inputState: inputStatePropType,\n};\nretryingText = false;\nretryingMedia = false;\n@@ -101,17 +101,17 @@ class FailedSend extends React.PureComponent<Props> {\nif (!rawMessageInfo) {\nreturn;\n}\n- const { chatInputState } = this.props;\n+ const { inputState } = this.props;\ninvariant(\n- chatInputState,\n- 'chatInputState should be initialized before user can hit retry',\n+ inputState,\n+ 'inputState should be initialized before user can hit retry',\n);\nif (rawMessageInfo.type === messageTypes.TEXT) {\nif (this.retryingText) {\nreturn;\n}\nthis.retryingText = true;\n- chatInputState.sendTextMessage({\n+ inputState.sendTextMessage({\n...rawMessageInfo,\ntime: Date.now(),\n});\n@@ -125,7 +125,7 @@ class FailedSend extends React.PureComponent<Props> {\nreturn;\n}\nthis.retryingMedia = true;\n- chatInputState.retryMultimediaMessage(localID);\n+ inputState.retryMultimediaMessage(localID);\n}\n};\n}\n@@ -157,6 +157,6 @@ const ConnectedFailedSend = connect(\nstyles: stylesSelector(state),\n};\n},\n-)(withChatInputState(FailedSend));\n+)(withInputState(FailedSend));\nexport { ConnectedFailedSend as FailedSend, failedSendHeight };\n" }, { "change_type": "MODIFY", "old_path": "native/chat/inline-multimedia.react.js", "new_path": "native/chat/inline-multimedia.react.js", "diff": "@@ -4,7 +4,7 @@ import { type MediaInfo, mediaInfoPropType } from 'lib/types/media-types';\nimport {\ntype PendingMultimediaUpload,\npendingMultimediaUploadPropType,\n-} from './chat-input-state';\n+} from '../input/input-state';\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\n" }, { "change_type": "MODIFY", "old_path": "native/chat/message-list-container.react.js", "new_path": "native/chat/message-list-container.react.js", "diff": "@@ -43,10 +43,10 @@ import {\ncomposedMessageMaxWidthSelector,\n} from './composed-message-width';\nimport {\n- type ChatInputState,\n- chatInputStatePropType,\n- withChatInputState,\n-} from './chat-input-state';\n+ type InputState,\n+ inputStatePropType,\n+ withInputState,\n+} from '../input/input-state';\nimport {\ntype Colors,\ncolorsPropType,\n@@ -68,8 +68,8 @@ type Props = {|\ncomposedMessageMaxWidth: number,\ncolors: Colors,\nstyles: Styles,\n- // withChatInputState\n- chatInputState: ?ChatInputState,\n+ // withInputState\n+ inputState: ?InputState,\n|};\ntype State = {|\ntextToMeasure: TextToMeasure[],\n@@ -84,7 +84,7 @@ class MessageListContainer extends React.PureComponent<Props, State> {\ncomposedMessageMaxWidth: PropTypes.number.isRequired,\ncolors: colorsPropType.isRequired,\nstyles: PropTypes.objectOf(PropTypes.object).isRequired,\n- chatInputState: chatInputStatePropType,\n+ inputState: inputStatePropType,\n};\nstatic navigationOptions = ({ navigation }) => ({\nheaderTitle: (\n@@ -186,12 +186,12 @@ class MessageListContainer extends React.PureComponent<Props, State> {\nconst oldNavThreadInfo = MessageListContainer.getThreadInfo(prevProps);\nconst newNavThreadInfo = MessageListContainer.getThreadInfo(this.props);\n- const oldChatInputState = prevProps.chatInputState;\n- const newChatInputState = this.props.chatInputState;\n+ const oldInputState = prevProps.inputState;\n+ const newInputState = this.props.inputState;\nif (\nnewListData === oldListData &&\nnewNavThreadInfo === oldNavThreadInfo &&\n- newChatInputState === oldChatInputState\n+ newInputState === oldInputState\n) {\nreturn;\n}\n@@ -249,7 +249,7 @@ class MessageListContainer extends React.PureComponent<Props, State> {\n};\nmergeHeightsIntoListData(textHeights?: Map<string, number>) {\n- const { messageListData: listData, chatInputState } = this.props;\n+ const { messageListData: listData, inputState } = this.props;\nconst threadInfo = MessageListContainer.getThreadInfo(this.props);\nconst listDataWithHeights = listData.map((item: ChatMessageItem) => {\nif (item.itemType !== 'message') {\n@@ -267,9 +267,9 @@ class MessageListContainer extends React.PureComponent<Props, State> {\n: null;\nconst id = messageID(messageInfo);\nconst pendingUploads =\n- chatInputState &&\n- chatInputState.pendingUploads &&\n- chatInputState.pendingUploads[id];\n+ inputState &&\n+ inputState.pendingUploads &&\n+ inputState.pendingUploads[id];\nconst heights = multimediaMessageContentHeights(\nmessageInfo,\nthis.props.composedMessageMaxWidth,\n@@ -365,7 +365,7 @@ const ConnectedMessageListContainer = connect(\nstyles: stylesSelector(state),\n};\n},\n-)(withChatInputState(MessageListContainer));\n+)(withInputState(MessageListContainer));\nhoistNonReactStatics(ConnectedMessageListContainer, MessageListContainer);\n" }, { "change_type": "MODIFY", "old_path": "native/chat/multimedia-message-multimedia.react.js", "new_path": "native/chat/multimedia-message-multimedia.react.js", "diff": "@@ -14,7 +14,7 @@ import {\nimport {\ntype PendingMultimediaUpload,\npendingMultimediaUploadPropType,\n-} from './chat-input-state';\n+} from '../input/input-state';\nimport {\ntype MessageListNavProp,\nmessageListNavPropType,\n" }, { "change_type": "MODIFY", "old_path": "native/chat/multimedia-message.react.js", "new_path": "native/chat/multimedia-message.react.js", "diff": "@@ -12,7 +12,7 @@ import {\ntype VerticalBounds,\nverticalBoundsPropType,\n} from '../types/layout-types';\n-import type { MessagePendingUploads } from './chat-input-state';\n+import type { MessagePendingUploads } from '../input/input-state';\nimport {\ntype MessageListNavProp,\nmessageListNavPropType,\n" }, { "change_type": "MODIFY", "old_path": "native/chat/multimedia-tooltip-button.react.js", "new_path": "native/chat/multimedia-tooltip-button.react.js", "diff": "@@ -29,10 +29,10 @@ import { chatMessageItemPropType } from 'lib/selectors/chat-selectors';\nimport { messageID } from 'lib/shared/message-utils';\nimport {\n- type ChatInputState,\n- chatInputStatePropType,\n- withChatInputState,\n-} from './chat-input-state';\n+ type InputState,\n+ inputStatePropType,\n+ withInputState,\n+} from '../input/input-state';\nimport InlineMultimedia from './inline-multimedia.react';\nimport { multimediaMessageBorderRadius } from './multimedia-message.react';\nimport { getRoundedContainerStyle } from './rounded-message-container.react';\n@@ -61,8 +61,8 @@ type Props = {\nprogress: Value,\n// Redux state\nscreenDimensions: Dimensions,\n- // withChatInputState\n- chatInputState: ?ChatInputState,\n+ // withInputState\n+ inputState: ?InputState,\n};\nclass MultimediaTooltipButton extends React.PureComponent<Props> {\nstatic propTypes = {\n@@ -82,7 +82,7 @@ class MultimediaTooltipButton extends React.PureComponent<Props> {\n}).isRequired,\nprogress: PropTypes.object.isRequired,\nscreenDimensions: dimensionsPropType.isRequired,\n- chatInputState: chatInputStatePropType,\n+ inputState: inputStatePropType,\n};\nget headerStyle() {\n@@ -101,15 +101,15 @@ class MultimediaTooltipButton extends React.PureComponent<Props> {\n}\nrender() {\n- const { chatInputState } = this.props;\n+ const { inputState } = this.props;\nconst { mediaInfo, item } = this.props.navigation.state.params;\nconst { id: mediaID } = mediaInfo;\nconst ourMessageID = messageID(item.messageInfo);\nconst pendingUploads =\n- chatInputState &&\n- chatInputState.pendingUploads &&\n- chatInputState.pendingUploads[ourMessageID];\n+ inputState &&\n+ inputState.pendingUploads &&\n+ inputState.pendingUploads[ourMessageID];\nconst pendingUpload = pendingUploads && pendingUploads[mediaID];\nconst postInProgress = !!pendingUploads;\n@@ -151,4 +151,4 @@ const styles = StyleSheet.create({\nexport default connect((state: AppState) => ({\nscreenDimensions: dimensionsSelector(state),\n-}))(withChatInputState(MultimediaTooltipButton));\n+}))(withInputState(MultimediaTooltipButton));\n" }, { "change_type": "RENAME", "old_path": "native/chat/chat-input-state-container.react.js", "new_path": "native/input/input-state-container.react.js", "diff": "// @flow\n-import type { PendingMultimediaUploads } from './chat-input-state';\nimport type { AppState } from '../redux/redux-setup';\nimport type {\nDispatchActionPayload,\n@@ -56,7 +55,10 @@ import { createMediaMessageInfo } from 'lib/shared/message-utils';\nimport { queueReportsActionType } from 'lib/actions/report-actions';\nimport { getConfig } from 'lib/utils/config';\n-import { ChatInputStateContext } from './chat-input-state';\n+import {\n+ InputStateContext,\n+ type PendingMultimediaUploads,\n+} from './input-state';\nimport { processMedia } from '../utils/media-utils';\nimport { displayActionResultModal } from '../navigation/action-result-modal';\n@@ -95,7 +97,7 @@ type Props = {|\ntype State = {|\npendingUploads: PendingMultimediaUploads,\n|};\n-class ChatInputStateContainer extends React.PureComponent<Props, State> {\n+class InputStateContainer extends React.PureComponent<Props, State> {\nstatic propTypes = {\nchildren: PropTypes.node.isRequired,\nviewerID: PropTypes.string,\n@@ -158,11 +160,11 @@ class ChatInputStateContainer extends React.PureComponent<Props, State> {\nreturn;\n}\n- const currentlyComplete = ChatInputStateContainer.getCompletedUploads(\n+ const currentlyComplete = InputStateContainer.getCompletedUploads(\nthis.props,\nthis.state,\n);\n- const previouslyComplete = ChatInputStateContainer.getCompletedUploads(\n+ const previouslyComplete = InputStateContainer.getCompletedUploads(\nprevProps,\nprevState,\n);\n@@ -272,7 +274,7 @@ class ChatInputStateContainer extends React.PureComponent<Props, State> {\n}\n}\n- chatInputStateSelector = createSelector(\n+ inputStateSelector = createSelector(\n(state: State) => state.pendingUploads,\n(pendingUploads: PendingMultimediaUploads) => ({\npendingUploads,\n@@ -594,14 +596,14 @@ class ChatInputStateContainer extends React.PureComponent<Props, State> {\ninput.multimedia.length === 1 &&\ninput.multimedia[0] &&\ntypeof input.multimedia[0] === 'object',\n- 'ChatInputStateContainer.uploadBlob sent incorrect input',\n+ 'InputStateContainer.uploadBlob sent incorrect input',\n);\nconst { uri, name, type } = input.multimedia[0];\ninvariant(\ntypeof uri === 'string' &&\ntypeof name === 'string' &&\ntypeof type === 'string',\n- 'ChatInputStateContainer.uploadBlob sent incorrect input',\n+ 'InputStateContainer.uploadBlob sent incorrect input',\n);\nconst uploadID = await Upload.startUpload({\nurl,\n@@ -794,11 +796,11 @@ class ChatInputStateContainer extends React.PureComponent<Props, State> {\n};\nrender() {\n- const chatInputState = this.chatInputStateSelector(this.state);\n+ const inputState = this.inputStateSelector(this.state);\nreturn (\n- <ChatInputStateContext.Provider value={chatInputState}>\n+ <InputStateContext.Provider value={inputState}>\n{this.props.children}\n- </ChatInputStateContext.Provider>\n+ </InputStateContext.Provider>\n);\n}\n}\n@@ -810,4 +812,4 @@ export default connect(\nmessageStoreMessages: state.messageStore.messages,\n}),\n{ uploadMultimedia, sendMultimediaMessage, sendTextMessage },\n-)(ChatInputStateContainer);\n+)(InputStateContainer);\n" }, { "change_type": "RENAME", "old_path": "native/chat/chat-input-state.js", "new_path": "native/input/input-state.js", "diff": "@@ -32,7 +32,7 @@ const pendingMultimediaUploadsPropType = PropTypes.objectOf(\nmessagePendingUploadsPropType,\n);\n-export type ChatInputState = {|\n+export type InputState = {|\npendingUploads: PendingMultimediaUploads,\nsendTextMessage: (messageInfo: RawTextMessageInfo) => void,\nsendMultimediaMessage: (\n@@ -45,7 +45,7 @@ export type ChatInputState = {|\nunregisterSendCallback: (() => void) => void,\n|};\n-const chatInputStatePropType = PropTypes.shape({\n+const inputStatePropType = PropTypes.shape({\npendingUploads: pendingMultimediaUploadsPropType.isRequired,\nsendTextMessage: PropTypes.func.isRequired,\nsendMultimediaMessage: PropTypes.func.isRequired,\n@@ -53,40 +53,34 @@ const chatInputStatePropType = PropTypes.shape({\nretryMultimediaMessage: PropTypes.func.isRequired,\n});\n-const ChatInputStateContext = React.createContext<?ChatInputState>(null);\n+const InputStateContext = React.createContext<?InputState>(null);\n-function withChatInputState<\n+function withInputState<\nAllProps: {},\nComponentType: React.ComponentType<AllProps>,\n>(\nComponent: ComponentType,\n): React.ComponentType<\n- $Diff<\n- React.ElementConfig<ComponentType>,\n- { chatInputState: ?ChatInputState },\n- >,\n+ $Diff<React.ElementConfig<ComponentType>, { inputState: ?InputState }>,\n> {\n- class ChatInputStateHOC extends React.PureComponent<\n- $Diff<\n- React.ElementConfig<ComponentType>,\n- { chatInputState: ?ChatInputState },\n- >,\n+ class InputStateHOC extends React.PureComponent<\n+ $Diff<React.ElementConfig<ComponentType>, { inputState: ?InputState }>,\n> {\nrender() {\nreturn (\n- <ChatInputStateContext.Consumer>\n- {value => <Component {...this.props} chatInputState={value} />}\n- </ChatInputStateContext.Consumer>\n+ <InputStateContext.Consumer>\n+ {value => <Component {...this.props} inputState={value} />}\n+ </InputStateContext.Consumer>\n);\n}\n}\n- return ChatInputStateHOC;\n+ return InputStateHOC;\n}\nexport {\nmessagePendingUploadsPropType,\npendingMultimediaUploadPropType,\n- chatInputStatePropType,\n- ChatInputStateContext,\n- withChatInputState,\n+ inputStatePropType,\n+ InputStateContext,\n+ withInputState,\n};\n" }, { "change_type": "MODIFY", "old_path": "native/keyboard/keyboard-input-host.react.js", "new_path": "native/keyboard/keyboard-input-host.react.js", "diff": "import type { AppState } from '../redux/redux-setup';\nimport type { Styles } from '../types/styles';\nimport {\n- type ChatInputState,\n- chatInputStatePropType,\n- withChatInputState,\n-} from '../chat/chat-input-state';\n+ type InputState,\n+ inputStatePropType,\n+ withInputState,\n+} from '../input/input-state';\nimport {\ntype KeyboardState,\nkeyboardStatePropType,\n@@ -37,8 +37,8 @@ type Props = {|\nactiveMessageList: ?string,\n// withKeyboardState\nkeyboardState: ?KeyboardState,\n- // withChatInputState\n- chatInputState: ?ChatInputState,\n+ // withInputState\n+ inputState: ?InputState,\n|};\nclass KeyboardInputHost extends React.PureComponent<Props> {\nstatic propTypes = {\n@@ -46,7 +46,7 @@ class KeyboardInputHost extends React.PureComponent<Props> {\nstyles: PropTypes.objectOf(PropTypes.object).isRequired,\nactiveMessageList: PropTypes.string,\nkeyboardState: keyboardStatePropType,\n- chatInputState: chatInputStatePropType,\n+ inputState: inputStatePropType,\n};\ncomponentDidUpdate(prevProps: Props) {\n@@ -94,12 +94,12 @@ class KeyboardInputHost extends React.PureComponent<Props> {\nreturn;\n}\n- const { chatInputState } = this.props;\n+ const { inputState } = this.props;\ninvariant(\n- chatInputState,\n- 'chatInputState should be set in onMediaGalleryItemSelected',\n+ inputState,\n+ 'inputState should be set in onMediaGalleryItemSelected',\n);\n- chatInputState.sendMultimediaMessage(mediaGalleryThreadID, selections);\n+ inputState.sendMultimediaMessage(mediaGalleryThreadID, selections);\n};\nhideMediaGallery = () => {\n@@ -121,5 +121,5 @@ export default connect((state: AppState) => ({\n}))(\nconnectNav((context: ?NavContextType) => ({\nactiveMessageList: activeMessageListSelector(context),\n- }))(withKeyboardState(withChatInputState(KeyboardInputHost))),\n+ }))(withKeyboardState(withInputState(KeyboardInputHost))),\n);\n" }, { "change_type": "MODIFY", "old_path": "native/media/camera-modal.react.js", "new_path": "native/media/camera-modal.react.js", "diff": "@@ -20,10 +20,10 @@ import {\n} from '../types/camera';\nimport type { Orientations } from 'react-native-orientation-locker';\nimport {\n- type ChatInputState,\n- chatInputStatePropType,\n- withChatInputState,\n-} from '../chat/chat-input-state';\n+ type InputState,\n+ inputStatePropType,\n+ withInputState,\n+} from '../input/input-state';\nimport type { ViewStyle } from '../types/styles';\nimport * as React from 'react';\n@@ -241,8 +241,8 @@ type Props = {\ndeviceCameraInfo: DeviceCameraInfo,\ndeviceOrientation: Orientations,\nforeground: boolean,\n- // withChatInputState\n- chatInputState: ?ChatInputState,\n+ // withInputState\n+ inputState: ?InputState,\n// Redux dispatch functions\ndispatchActionPayload: DispatchActionPayload,\n};\n@@ -273,7 +273,7 @@ class CameraModal extends React.PureComponent<Props, State> {\ndeviceCameraInfo: deviceCameraInfoPropType.isRequired,\ndeviceOrientation: PropTypes.string.isRequired,\nforeground: PropTypes.bool.isRequired,\n- chatInputState: chatInputStatePropType,\n+ inputState: inputStatePropType,\ndispatchActionPayload: PropTypes.func.isRequired,\n};\ncamera: ?RNCamera;\n@@ -927,10 +927,10 @@ class CameraModal extends React.PureComponent<Props, State> {\nif (!pendingPhotoCapture) {\nreturn;\n}\n- const { chatInputState } = this.props;\n- invariant(chatInputState, 'chatInputState should be set');\n+ const { inputState } = this.props;\n+ invariant(inputState, 'inputState should be set');\nthis.close();\n- chatInputState.sendMultimediaMessage(\n+ inputState.sendMultimediaMessage(\nthis.props.navigation.state.params.threadID,\n[pendingPhotoCapture],\n);\n@@ -1185,4 +1185,4 @@ export default connect(\n}),\nnull,\ntrue,\n-)(withChatInputState(CameraModal));\n+)(withInputState(CameraModal));\n" }, { "change_type": "MODIFY", "old_path": "native/navigation/app-navigator.react.js", "new_path": "native/navigation/app-navigator.react.js", "diff": "@@ -33,7 +33,6 @@ import ActionResultModal from './action-result-modal.react';\nimport { TextMessageTooltipModal } from '../chat/text-message-tooltip-modal.react';\nimport ThreadSettingsMemberTooltipModal from '../chat/settings/thread-settings-member-tooltip-modal.react';\nimport CameraModal from '../media/camera-modal.react';\n-import ChatInputStateContainer from '../chat/chat-input-state-container.react';\nimport OverlayableScrollViewStateContainer from './overlayable-scroll-view-state-container.react';\nimport KeyboardStateContainer from '../keyboard/keyboard-state-container.react';\nimport PushHandler from '../push/push-handler.react';\n@@ -87,7 +86,6 @@ function WrappedAppNavigator(props: Props) {\nconst { navigation } = props;\nreturn (\n- <ChatInputStateContainer>\n<OverlayableScrollViewStateContainer>\n<KeyboardStateContainer>\n<AppNavigator navigation={navigation} />\n@@ -96,7 +94,6 @@ function WrappedAppNavigator(props: Props) {\n</PersistGate>\n</KeyboardStateContainer>\n</OverlayableScrollViewStateContainer>\n- </ChatInputStateContainer>\n);\n}\nhoistNonReactStatics(WrappedAppNavigator, AppNavigator);\n" }, { "change_type": "MODIFY", "old_path": "native/root.react.js", "new_path": "native/root.react.js", "diff": "@@ -51,6 +51,7 @@ import { setGlobalNavContext } from './navigation/icky-global';\nimport { RootContext, type RootContextType } from './root-context';\nimport NavigationHandler from './navigation/navigation-handler.react';\nimport { defaultNavigationState } from './navigation/default-state';\n+import InputStateContainer from './input/input-state-container.react';\nif (Platform.OS === 'android') {\nUIManager.setLayoutAnimationEnabledExperimental &&\n@@ -153,6 +154,7 @@ class Root extends React.PureComponent<Props, State> {\n<View style={styles.app}>\n<NavContext.Provider value={this.state.navContext}>\n<RootContext.Provider value={this.state.rootContext}>\n+ <InputStateContainer>\n<ConnectedStatusBar />\n<PersistGate persistor={getPersistor()}>{gated}</PersistGate>\n<NavAppContainer\n@@ -163,6 +165,7 @@ class Root extends React.PureComponent<Props, State> {\nref={this.appContainerRef}\n/>\n<NavigationHandler />\n+ </InputStateContainer>\n</RootContext.Provider>\n</NavContext.Provider>\n</View>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] ChatInputStateContainer -> InputStateContainer
129,187
07.04.2020 02:54:33
14,400
9620108148449ab3671ad3211ae47f1dc38e68ce
[native] Don't send reports while uploads are in progress
[ { "change_type": "MODIFY", "old_path": "native/input/input-state-container.react.js", "new_path": "native/input/input-state-container.react.js", "diff": "@@ -284,9 +284,23 @@ class InputStateContainer extends React.PureComponent<Props, State> {\nretryMultimediaMessage: this.retryMultimediaMessage,\nregisterSendCallback: this.registerSendCallback,\nunregisterSendCallback: this.unregisterSendCallback,\n+ uploadInProgress: InputStateContainer.uploadInProgress(pendingUploads),\n}),\n);\n+ static uploadInProgress(pendingUploads: PendingMultimediaUploads) {\n+ for (let localMessageID in pendingUploads) {\n+ const messagePendingUploads = pendingUploads[localMessageID];\n+ for (let localUploadID in messagePendingUploads) {\n+ const { failed } = messagePendingUploads[localUploadID];\n+ if (!failed) {\n+ return true;\n+ }\n+ }\n+ }\n+ return false;\n+ }\n+\nsendTextMessage = (messageInfo: RawTextMessageInfo) => {\nthis.sendCallbacks.forEach(callback => callback());\nthis.props.dispatchActionPromise(\n" }, { "change_type": "MODIFY", "old_path": "native/input/input-state.js", "new_path": "native/input/input-state.js", "diff": "@@ -43,6 +43,7 @@ export type InputState = {|\nretryMultimediaMessage: (localMessageID: string) => Promise<void>,\nregisterSendCallback: (() => void) => void,\nunregisterSendCallback: (() => void) => void,\n+ uploadInProgress: boolean,\n|};\nconst inputStatePropType = PropTypes.shape({\n@@ -51,6 +52,7 @@ const inputStatePropType = PropTypes.shape({\nsendMultimediaMessage: PropTypes.func.isRequired,\nmessageHasUploadFailure: PropTypes.func.isRequired,\nretryMultimediaMessage: PropTypes.func.isRequired,\n+ uploadInProgress: PropTypes.bool.isRequired,\n});\nconst InputStateContext = React.createContext<?InputState>(null);\n" }, { "change_type": "MODIFY", "old_path": "native/socket.react.js", "new_path": "native/socket.react.js", "diff": "@@ -21,17 +21,20 @@ import {\nconnectNav,\ntype NavContextType,\n} from './navigation/navigation-context';\n+import { withInputState, type InputState } from './input/input-state';\nexport default connectNav((context: ?NavContextType) => ({\nrawActiveThread: activeMessageListSelector(context),\nnavContext: context,\n}))(\n+ withInputState(\nconnect(\n(\nstate: AppState,\nownProps: {\nrawActiveThread: boolean,\nnavContext: ?NavContextType,\n+ inputState: ?InputState,\n},\n) => {\nconst active =\n@@ -50,11 +53,15 @@ export default connectNav((context: ?NavContextType) => ({\nurlPrefix: state.urlPrefix,\nconnection: state.connection,\ncurrentCalendarQuery: nativeCalendarQuery(navPlusRedux),\n- canSendReports: !state.frozen && state.connectivity.hasWiFi,\n+ canSendReports:\n+ !state.frozen &&\n+ state.connectivity.hasWiFi &&\n+ (!ownProps.inputState || !ownProps.inputState.uploadInProgress),\nfrozen: state.frozen,\npreRequestUserState: preRequestUserStateSelector(state),\n};\n},\n{ logOut },\n)(Socket),\n+ ),\n);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Don't send reports while uploads are in progress
129,187
07.04.2020 03:28:51
14,400
00485b1137c2c17c157df763089313a21e73bd84
New endpoint for multi-report creation
[ { "change_type": "MODIFY", "old_path": "lib/actions/report-actions.js", "new_path": "lib/actions/report-actions.js", "diff": "@@ -20,6 +20,24 @@ async function sendReport(\nreturn { id: response.id };\n}\n+const sendReportsActionTypes = Object.freeze({\n+ started: 'SEND_REPORTS_STARTED',\n+ success: 'SEND_REPORTS_SUCCESS',\n+ failed: 'SEND_REPORTS_FAILED',\n+});\n+async function sendReports(\n+ fetchJSON: FetchJSON,\n+ reports: $ReadOnlyArray<ClientReportCreationRequest>,\n+): Promise<void> {\n+ await fetchJSON('create_reports', { reports }, fetchJSONOptions);\n+}\n+\nconst queueReportsActionType = 'QUEUE_REPORTS';\n-export { sendReportActionTypes, sendReport, queueReportsActionType };\n+export {\n+ sendReportActionTypes,\n+ sendReport,\n+ sendReportsActionTypes,\n+ sendReports,\n+ queueReportsActionType,\n+};\n" }, { "change_type": "MODIFY", "old_path": "lib/reducers/entry-reducer.js", "new_path": "lib/reducers/entry-reducer.js", "diff": "@@ -20,7 +20,10 @@ import {\nfullStateSyncActionType,\nincrementalStateSyncActionType,\n} from '../types/socket-types';\n-import { sendReportActionTypes } from '../actions/report-actions';\n+import {\n+ sendReportActionTypes,\n+ sendReportsActionTypes,\n+} from '../actions/report-actions';\nimport {\ntype ClientEntryInconsistencyReportCreationRequest,\nreportTypes,\n@@ -610,7 +613,11 @@ function reduceEntryInfos(\nlastUserInteractionCalendar,\ninconsistencyReports,\n};\n- } else if (action.type === sendReportActionTypes.success && action.payload) {\n+ } else if (\n+ (action.type === sendReportActionTypes.success ||\n+ action.type === sendReportsActionTypes.success) &&\n+ action.payload\n+ ) {\nconst { payload } = action;\nconst updatedReports = inconsistencyReports.filter(\nresponse => !payload.reports.includes(response),\n" }, { "change_type": "MODIFY", "old_path": "lib/reducers/report-reducer.js", "new_path": "lib/reducers/report-reducer.js", "diff": "@@ -5,6 +5,7 @@ import type { ClientReportCreationRequest } from '../types/report-types';\nimport {\nsendReportActionTypes,\n+ sendReportsActionTypes,\nqueueReportsActionType,\n} from '../actions/report-actions';\n@@ -12,7 +13,11 @@ export default function reduceQueuedReports(\nstate: $ReadOnlyArray<ClientReportCreationRequest>,\naction: BaseAction,\n): $ReadOnlyArray<ClientReportCreationRequest> {\n- if (action.type === sendReportActionTypes.success && action.payload) {\n+ if (\n+ (action.type === sendReportActionTypes.success ||\n+ action.type === sendReportsActionTypes.success) &&\n+ action.payload\n+ ) {\nconst { payload } = action;\nconst updatedReports = state.filter(\nresponse => !payload.reports.includes(response),\n" }, { "change_type": "MODIFY", "old_path": "lib/reducers/thread-reducer.js", "new_path": "lib/reducers/thread-reducer.js", "diff": "@@ -16,7 +16,10 @@ import {\nincrementalStateSyncActionType,\n} from '../types/socket-types';\nimport { updateActivityActionTypes } from '../actions/activity-actions';\n-import { sendReportActionTypes } from '../actions/report-actions';\n+import {\n+ sendReportActionTypes,\n+ sendReportsActionTypes,\n+} from '../actions/report-actions';\nimport {\ntype ClientThreadInconsistencyReportCreationRequest,\nreportTypes,\n@@ -266,7 +269,11 @@ export default function reduceThreadInfos(\ninconsistencyReports: state.inconsistencyReports,\n};\n}\n- } else if (action.type === sendReportActionTypes.success && action.payload) {\n+ } else if (\n+ (action.type === sendReportActionTypes.success ||\n+ action.type === sendReportsActionTypes.success) &&\n+ action.payload\n+ ) {\nconst { payload } = action;\nconst updatedReports = state.inconsistencyReports.filter(\nresponse => !payload.reports.includes(response),\n" }, { "change_type": "MODIFY", "old_path": "lib/types/endpoints.js", "new_path": "lib/types/endpoints.js", "diff": "@@ -79,6 +79,7 @@ type SocketPreferredEndpoint = $Values<typeof socketPreferredEndpoints>;\nconst httpPreferredEndpoints = Object.freeze({\nCREATE_REPORT: 'create_report',\n+ CREATE_REPORTS: 'create_reports',\n});\ntype HTTPPreferredEndpoint = $Values<typeof httpPreferredEndpoints>;\n" }, { "change_type": "MODIFY", "old_path": "lib/types/redux-types.js", "new_path": "lib/types/redux-types.js", "diff": "@@ -645,6 +645,22 @@ export type BaseAction =\npayload?: ClearDeliveredReportsPayload,\nloadingInfo: LoadingInfo,\n|}\n+ | {|\n+ type: 'SEND_REPORTS_STARTED',\n+ payload?: void,\n+ loadingInfo: LoadingInfo,\n+ |}\n+ | {|\n+ type: 'SEND_REPORTS_FAILED',\n+ error: true,\n+ payload: Error,\n+ loadingInfo: LoadingInfo,\n+ |}\n+ | {|\n+ type: 'SEND_REPORTS_SUCCESS',\n+ payload?: ClearDeliveredReportsPayload,\n+ loadingInfo: LoadingInfo,\n+ |}\n| {|\ntype: 'QUEUE_REPORTS',\npayload: QueueReportsPayload,\n" }, { "change_type": "MODIFY", "old_path": "server/src/endpoints.js", "new_path": "server/src/endpoints.js", "diff": "@@ -45,6 +45,7 @@ import {\nimport { pingResponder } from './responders/ping-responders';\nimport {\nreportCreationResponder,\n+ reportMultiCreationResponder,\nerrorReportFetchInfosResponder,\n} from './responders/report-responders';\nimport { uploadDeletionResponder } from './uploads/uploads';\n@@ -81,6 +82,7 @@ const jsonEndpoints: { [id: Endpoint]: JSONResponder } = {\nupdate_password: passwordUpdateResponder,\ncreate_error_report: reportCreationResponder,\ncreate_report: reportCreationResponder,\n+ create_reports: reportMultiCreationResponder,\nfetch_error_report_infos: errorReportFetchInfosResponder,\nrequest_access: requestAccessResponder,\nupdate_calendar_query: calendarQueryUpdateResponder,\n" }, { "change_type": "MODIFY", "old_path": "server/src/responders/report-responders.js", "new_path": "server/src/responders/report-responders.js", "diff": "@@ -54,41 +54,23 @@ const entryInconsistencyReportValidatorShape = {\ntime: t.Number,\n};\n-const reportCreationRequestInputValidator = t.union([\n- tShape({\n- type: t.maybe(\n- t.irreducible('reportTypes.ERROR', x => x === reportTypes.ERROR),\n- ),\n- platformDetails: t.maybe(tPlatformDetails),\n- deviceType: t.maybe(tPlatform),\n- codeVersion: t.maybe(t.Number),\n- stateVersion: t.maybe(t.Number),\n- errors: t.list(\n- tShape({\n- errorMessage: t.String,\n- stack: t.maybe(t.String),\n- componentStack: t.maybe(t.String),\n- }),\n- ),\n- preloadedState: t.Object,\n- currentState: t.Object,\n- actions: t.list(t.Object),\n- }),\n- tShape({\n+const threadInconsistencyReportCreationRequest = tShape({\n...threadInconsistencyReportValidatorShape,\ntype: t.irreducible(\n'reportTypes.THREAD_INCONSISTENCY',\nx => x === reportTypes.THREAD_INCONSISTENCY,\n),\n- }),\n- tShape({\n+});\n+\n+const entryInconsistencyReportCreationRquest = tShape({\n...entryInconsistencyReportValidatorShape,\ntype: t.irreducible(\n'reportTypes.ENTRY_INCONSISTENCY',\nx => x === reportTypes.ENTRY_INCONSISTENCY,\n),\n- }),\n- tShape({\n+});\n+\n+const mediaMissionReportCreationRequest = tShape({\ntype: t.irreducible(\n'reportTypes.MEDIA_MISSION',\nx => x === reportTypes.MEDIA_MISSION,\n@@ -99,7 +81,31 @@ const reportCreationRequestInputValidator = t.union([\nuploadServerID: t.maybe(t.String),\nuploadLocalID: t.String,\nmediaLocalID: t.String,\n+});\n+\n+const reportCreationRequestInputValidator = t.union([\n+ tShape({\n+ type: t.maybe(\n+ t.irreducible('reportTypes.ERROR', x => x === reportTypes.ERROR),\n+ ),\n+ platformDetails: t.maybe(tPlatformDetails),\n+ deviceType: t.maybe(tPlatform),\n+ codeVersion: t.maybe(t.Number),\n+ stateVersion: t.maybe(t.Number),\n+ errors: t.list(\n+ tShape({\n+ errorMessage: t.String,\n+ stack: t.maybe(t.String),\n+ componentStack: t.maybe(t.String),\n}),\n+ ),\n+ preloadedState: t.Object,\n+ currentState: t.Object,\n+ actions: t.list(t.Object),\n+ }),\n+ threadInconsistencyReportCreationRequest,\n+ entryInconsistencyReportCreationRquest,\n+ mediaMissionReportCreationRequest,\n]);\nasync function reportCreationResponder(\n@@ -125,6 +131,50 @@ async function reportCreationResponder(\nreturn response;\n}\n+const reportMultiCreationRequestInputValidator = tShape({\n+ reports: t.list(\n+ t.union([\n+ tShape({\n+ type: t.irreducible('reportTypes.ERROR', x => x === reportTypes.ERROR),\n+ platformDetails: tPlatformDetails,\n+ errors: t.list(\n+ tShape({\n+ errorMessage: t.String,\n+ stack: t.maybe(t.String),\n+ componentStack: t.maybe(t.String),\n+ }),\n+ ),\n+ preloadedState: t.Object,\n+ currentState: t.Object,\n+ actions: t.list(t.Object),\n+ }),\n+ threadInconsistencyReportCreationRequest,\n+ entryInconsistencyReportCreationRquest,\n+ mediaMissionReportCreationRequest,\n+ ]),\n+ ),\n+});\n+\n+type ReportMultiCreationRequest = {|\n+ reports: $ReadOnlyArray<ReportCreationRequest>,\n+|};\n+async function reportMultiCreationResponder(\n+ viewer: Viewer,\n+ input: any,\n+): Promise<void> {\n+ const request: ReportMultiCreationRequest = input;\n+ await validateInput(\n+ viewer,\n+ reportMultiCreationRequestInputValidator,\n+ request,\n+ );\n+ await Promise.all(\n+ request.reports.map(reportCreationRequest =>\n+ createReport(viewer, reportCreationRequest),\n+ ),\n+ );\n+}\n+\nconst fetchErrorReportInfosRequestInputValidator = tShape({\ncursor: t.maybe(t.String),\n});\n@@ -163,6 +213,7 @@ export {\nthreadInconsistencyReportValidatorShape,\nentryInconsistencyReportValidatorShape,\nreportCreationResponder,\n+ reportMultiCreationResponder,\nerrorReportFetchInfosResponder,\nerrorReportDownloadResponder,\n};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
New endpoint for multi-report creation
129,187
07.04.2020 03:37:28
14,400
b64512fb0d3d46ccf4ab376a8ff6ae5dcb178364
[lib] Use new multi-report creation endpoint in ReportHandler
[ { "change_type": "MODIFY", "old_path": "lib/socket/report-handler.react.js", "new_path": "lib/socket/report-handler.react.js", "diff": "import {\ntype ClientReportCreationRequest,\n- type ReportCreationResponse,\ntype ClearDeliveredReportsPayload,\nqueuedClientReportCreationRequestPropType,\n} from '../types/report-types';\n@@ -13,9 +12,8 @@ import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from '../utils/redux-utils';\n-import { sendReportActionTypes, sendReport } from '../actions/report-actions';\n+import { sendReportsActionTypes, sendReports } from '../actions/report-actions';\nimport { queuedReports } from '../selectors/socket-selectors';\n-import { ServerError } from '../utils/errors';\ntype Props = {|\ncanSendReports: boolean,\n@@ -24,9 +22,9 @@ type Props = {|\n// Redux dispatch functions\ndispatchActionPromise: DispatchActionPromise,\n// async functions that hit server APIs\n- sendReport: (\n- request: ClientReportCreationRequest,\n- ) => Promise<ReportCreationResponse>,\n+ sendReports: (\n+ reports: $ReadOnlyArray<ClientReportCreationRequest>,\n+ ) => Promise<void>,\n|};\nclass ReportHandler extends React.PureComponent<Props> {\nstatic propTypes = {\n@@ -34,12 +32,12 @@ class ReportHandler extends React.PureComponent<Props> {\nqueuedReports: PropTypes.arrayOf(queuedClientReportCreationRequestPropType)\n.isRequired,\ndispatchActionPromise: PropTypes.func.isRequired,\n- sendReport: PropTypes.func.isRequired,\n+ sendReports: PropTypes.func.isRequired,\n};\ncomponentDidMount() {\nif (this.props.canSendReports) {\n- this.sendResponses(this.props.queuedReports);\n+ this.dispatchSendReports(this.props.queuedReports);\n}\n}\n@@ -51,7 +49,7 @@ class ReportHandler extends React.PureComponent<Props> {\nconst couldSend = prevProps.canSendReports;\nconst curReports = this.props.queuedReports;\nif (!couldSend) {\n- this.sendResponses(curReports);\n+ this.dispatchSendReports(curReports);\nreturn;\n}\n@@ -61,7 +59,7 @@ class ReportHandler extends React.PureComponent<Props> {\nconst newResponses = curReports.filter(\nresponse => !prevResponses.has(response),\n);\n- this.sendResponses(newResponses);\n+ this.dispatchSendReports(newResponses);\n}\n}\n@@ -69,30 +67,19 @@ class ReportHandler extends React.PureComponent<Props> {\nreturn null;\n}\n- sendResponses(responses: $ReadOnlyArray<ClientReportCreationRequest>) {\n- for (let response of responses) {\n+ dispatchSendReports(reports: $ReadOnlyArray<ClientReportCreationRequest>) {\n+ if (reports.length === 0) {\n+ return;\n+ }\nthis.props.dispatchActionPromise(\n- sendReportActionTypes,\n- this.sendResponse(response),\n+ sendReportsActionTypes,\n+ this.sendReports(reports),\n);\n}\n- }\n- async sendResponse(report: ClientReportCreationRequest) {\n- await this.sendReport(report);\n- return ({ reports: [report] }: ClearDeliveredReportsPayload);\n- }\n-\n- async sendReport(report: ClientReportCreationRequest) {\n- try {\n- await this.props.sendReport(report);\n- } catch (e) {\n- if (e instanceof ServerError && e.message === 'ignored_report') {\n- // nothing\n- } else {\n- throw e;\n- }\n- }\n+ async sendReports(reports: $ReadOnlyArray<ClientReportCreationRequest>) {\n+ await this.props.sendReports(reports);\n+ return ({ reports }: ClearDeliveredReportsPayload);\n}\n}\n@@ -100,5 +87,5 @@ export default connect(\n(state: AppState) => ({\nqueuedReports: queuedReports(state),\n}),\n- { sendReport },\n+ { sendReports },\n)(ReportHandler);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Use new multi-report creation endpoint in ReportHandler
129,187
07.04.2020 03:58:46
14,400
54876a495aa2a5523f6e6a8211e166271378fcbc
[native] inputState.uploadInProgress should return true while message creation is ongoing
[ { "change_type": "MODIFY", "old_path": "native/input/input-state-container.react.js", "new_path": "native/input/input-state-container.react.js", "diff": "@@ -54,6 +54,10 @@ import {\nimport { createMediaMessageInfo } from 'lib/shared/message-utils';\nimport { queueReportsActionType } from 'lib/actions/report-actions';\nimport { getConfig } from 'lib/utils/config';\n+import {\n+ createLoadingStatusSelector,\n+ combineLoadingStatuses,\n+} from 'lib/selectors/loading-selectors';\nimport {\nInputStateContext,\n@@ -75,6 +79,7 @@ type Props = {|\nviewerID: ?string,\nnextLocalID: number,\nmessageStoreMessages: { [id: string]: RawMessageInfo },\n+ ongoingMessageCreation: boolean,\n// Redux dispatch functions\ndispatchActionPayload: DispatchActionPayload,\ndispatchActionPromise: DispatchActionPromise,\n@@ -103,6 +108,7 @@ class InputStateContainer extends React.PureComponent<Props, State> {\nviewerID: PropTypes.string,\nnextLocalID: PropTypes.number.isRequired,\nmessageStoreMessages: PropTypes.object.isRequired,\n+ ongoingMessageCreation: PropTypes.bool.isRequired,\ndispatchActionPayload: PropTypes.func.isRequired,\ndispatchActionPromise: PropTypes.func.isRequired,\nuploadMultimedia: PropTypes.func.isRequired,\n@@ -284,13 +290,16 @@ class InputStateContainer extends React.PureComponent<Props, State> {\nretryMultimediaMessage: this.retryMultimediaMessage,\nregisterSendCallback: this.registerSendCallback,\nunregisterSendCallback: this.unregisterSendCallback,\n- uploadInProgress: InputStateContainer.uploadInProgress(pendingUploads),\n+ uploadInProgress: this.uploadInProgress,\n}),\n);\n- static uploadInProgress(pendingUploads: PendingMultimediaUploads) {\n- for (let localMessageID in pendingUploads) {\n- const messagePendingUploads = pendingUploads[localMessageID];\n+ uploadInProgress = () => {\n+ if (this.props.ongoingMessageCreation) {\n+ return true;\n+ }\n+ for (let localMessageID in this.state.pendingUploads) {\n+ const messagePendingUploads = this.state.pendingUploads[localMessageID];\nfor (let localUploadID in messagePendingUploads) {\nconst { failed } = messagePendingUploads[localUploadID];\nif (!failed) {\n@@ -299,7 +308,7 @@ class InputStateContainer extends React.PureComponent<Props, State> {\n}\n}\nreturn false;\n- }\n+ };\nsendTextMessage = (messageInfo: RawTextMessageInfo) => {\nthis.sendCallbacks.forEach(callback => callback());\n@@ -819,11 +828,23 @@ class InputStateContainer extends React.PureComponent<Props, State> {\n}\n}\n+const mediaCreationLoadingStatusSelector = createLoadingStatusSelector(\n+ sendMultimediaMessageActionTypes,\n+);\n+const textCreationLoadingStatusSelector = createLoadingStatusSelector(\n+ sendTextMessageActionTypes,\n+);\n+\nexport default connect(\n(state: AppState) => ({\nviewerID: state.currentUserInfo && state.currentUserInfo.id,\nnextLocalID: state.nextLocalID,\nmessageStoreMessages: state.messageStore.messages,\n+ ongoingMessageCreation:\n+ combineLoadingStatuses(\n+ mediaCreationLoadingStatusSelector(state),\n+ textCreationLoadingStatusSelector(state),\n+ ) === 'loading',\n}),\n{ uploadMultimedia, sendMultimediaMessage, sendTextMessage },\n)(InputStateContainer);\n" }, { "change_type": "MODIFY", "old_path": "native/input/input-state.js", "new_path": "native/input/input-state.js", "diff": "@@ -43,7 +43,7 @@ export type InputState = {|\nretryMultimediaMessage: (localMessageID: string) => Promise<void>,\nregisterSendCallback: (() => void) => void,\nunregisterSendCallback: (() => void) => void,\n- uploadInProgress: boolean,\n+ uploadInProgress: () => boolean,\n|};\nconst inputStatePropType = PropTypes.shape({\n@@ -52,7 +52,7 @@ const inputStatePropType = PropTypes.shape({\nsendMultimediaMessage: PropTypes.func.isRequired,\nmessageHasUploadFailure: PropTypes.func.isRequired,\nretryMultimediaMessage: PropTypes.func.isRequired,\n- uploadInProgress: PropTypes.bool.isRequired,\n+ uploadInProgress: PropTypes.func.isRequired,\n});\nconst InputStateContext = React.createContext<?InputState>(null);\n" }, { "change_type": "MODIFY", "old_path": "native/socket.react.js", "new_path": "native/socket.react.js", "diff": "@@ -56,7 +56,7 @@ export default connectNav((context: ?NavContextType) => ({\ncanSendReports:\n!state.frozen &&\nstate.connectivity.hasWiFi &&\n- (!ownProps.inputState || !ownProps.inputState.uploadInProgress),\n+ (!ownProps.inputState || !ownProps.inputState.uploadInProgress()),\nfrozen: state.frozen,\npreRequestUserState: preRequestUserStateSelector(state),\n};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] inputState.uploadInProgress should return true while message creation is ongoing
129,187
08.04.2020 21:21:24
14,400
c4a0f11c3bd70d4f5e0c509f5d0b977bcb3dbf29
[native] Don't require loadingInfo in all conforming actions `sendMultimediaMessageActionTypes.started` is dispatched outside of `dispatchActionPromise` on native
[ { "change_type": "MODIFY", "old_path": "lib/reducers/loading-reducer.js", "new_path": "lib/reducers/loading-reducer.js", "diff": "@@ -5,7 +5,6 @@ import type { LoadingStatus } from '../types/loading-types';\nimport type { ActionTypes } from '../utils/action-utils';\nimport _omit from 'lodash/fp/omit';\n-import invariant from 'invariant';\nconst fetchKeyRegistry: Set<string> = new Set();\nconst registerFetchKey = (actionTypes: ActionTypes<*, *, *>) => {\n@@ -20,15 +19,13 @@ function reduceLoadingStatuses(\n): { [key: string]: { [idx: number]: LoadingStatus } } {\nconst startMatch = action.type.match(/(.*)_STARTED/);\nif (startMatch && fetchKeyRegistry.has(action.type)) {\n- invariant(\n- action.loadingInfo && typeof action.loadingInfo === 'object',\n- \"Flow can't handle regex\",\n- );\n- const loadingInfo = action.loadingInfo;\n- invariant(\n- typeof loadingInfo.fetchIndex === 'number',\n- \"Flow can't handle regex\",\n- );\n+ if (!action.loadingInfo || typeof action.loadingInfo !== 'object') {\n+ return state;\n+ }\n+ const { loadingInfo } = action;\n+ if (typeof loadingInfo.fetchIndex !== 'number') {\n+ return state;\n+ }\nconst keyName =\nloadingInfo.customKeyName && typeof loadingInfo.customKeyName === 'string'\n? loadingInfo.customKeyName\n@@ -52,15 +49,13 @@ function reduceLoadingStatuses(\n}\nconst failMatch = action.type.match(/(.*)_FAILED/);\nif (failMatch && fetchKeyRegistry.has(action.type)) {\n- invariant(\n- action.loadingInfo && typeof action.loadingInfo === 'object',\n- \"Flow can't handle regex\",\n- );\n- const loadingInfo = action.loadingInfo;\n- invariant(\n- typeof loadingInfo.fetchIndex === 'number',\n- \"Flow can't handle regex\",\n- );\n+ if (!action.loadingInfo || typeof action.loadingInfo !== 'object') {\n+ return state;\n+ }\n+ const { loadingInfo } = action;\n+ if (typeof loadingInfo.fetchIndex !== 'number') {\n+ return state;\n+ }\nconst keyName =\nloadingInfo.customKeyName && typeof loadingInfo.customKeyName === 'string'\n? loadingInfo.customKeyName\n@@ -78,15 +73,13 @@ function reduceLoadingStatuses(\n}\nconst successMatch = action.type.match(/(.*)_SUCCESS/);\nif (successMatch && fetchKeyRegistry.has(action.type)) {\n- invariant(\n- action.loadingInfo && typeof action.loadingInfo === 'object',\n- \"Flow can't handle regex\",\n- );\n- const loadingInfo = action.loadingInfo;\n- invariant(\n- typeof loadingInfo.fetchIndex === 'number',\n- \"Flow can't handle regex\",\n- );\n+ if (!action.loadingInfo || typeof action.loadingInfo !== 'object') {\n+ return state;\n+ }\n+ const { loadingInfo } = action;\n+ if (typeof loadingInfo.fetchIndex !== 'number') {\n+ return state;\n+ }\nconst keyName =\nloadingInfo.customKeyName && typeof loadingInfo.customKeyName === 'string'\n? loadingInfo.customKeyName\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Don't require loadingInfo in all conforming actions `sendMultimediaMessageActionTypes.started` is dispatched outside of `dispatchActionPromise` on native
129,187
08.04.2020 21:22:09
14,400
08807cc50d362a8f4c6878e32a3d9c622e93c0ed
[native] Get react-native-background-upload working on Android
[ { "change_type": "MODIFY", "old_path": "native/android/app/src/main/AndroidManifest.xml", "new_path": "native/android/app/src/main/AndroidManifest.xml", "diff": "<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" />\n<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />\n<uses-permission android:name=\"android.permission.CAMERA\" />\n+ <uses-permission android:name=\"android.permission.FOREGROUND_SERVICE\" />\n<application\nandroid:name=\".MainApplication\"\n" }, { "change_type": "MODIFY", "old_path": "native/input/input-state-container.react.js", "new_path": "native/input/input-state-container.react.js", "diff": "@@ -37,6 +37,7 @@ import invariant from 'invariant';\nimport { createSelector } from 'reselect';\nimport filesystem from 'react-native-fs';\nimport * as Upload from 'react-native-background-upload';\n+import { Platform } from 'react-native';\nimport { connect } from 'lib/utils/redux-utils';\nimport {\n@@ -58,6 +59,7 @@ import {\ncreateLoadingStatusSelector,\ncombineLoadingStatuses,\n} from 'lib/selectors/loading-selectors';\n+import { pathFromURI } from 'lib/utils/file-utils';\nimport {\nInputStateContext,\n@@ -628,9 +630,16 @@ class InputStateContainer extends React.PureComponent<Props, State> {\ntypeof type === 'string',\n'InputStateContainer.uploadBlob sent incorrect input',\n);\n+ let path = uri;\n+ if (Platform.OS === 'android') {\n+ const resolvedPath = pathFromURI(uri);\n+ if (resolvedPath) {\n+ path = resolvedPath;\n+ }\n+ }\nconst uploadID = await Upload.startUpload({\nurl,\n- path: uri,\n+ path,\ntype: 'multipart',\nheaders: {\nAccept: 'application/json',\n" }, { "change_type": "ADD", "old_path": null, "new_path": "patches/react-native-background-upload+5.6.0.patch", "diff": "+diff --git a/node_modules/react-native-background-upload/android/.build.gradle.swp b/node_modules/react-native-background-upload/android/.build.gradle.swp\n+new file mode 100644\n+index 0000000..64c3944\n+Binary files /dev/null and b/node_modules/react-native-background-upload/android/.build.gradle.swp differ\n+diff --git a/node_modules/react-native-background-upload/android/build.gradle b/node_modules/react-native-background-upload/android/build.gradle\n+index 9262df3..ba3e21c 100755\n+--- a/node_modules/react-native-background-upload/android/build.gradle\n++++ b/node_modules/react-native-background-upload/android/build.gradle\n+@@ -19,7 +19,7 @@ android {\n+ buildToolsVersion project.hasProperty('buildToolsVersion') ? project.buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION\n+\n+ defaultConfig {\n+- minSdkVersion 18\n++ minSdkVersion 16\n+ targetSdkVersion project.hasProperty('targetSdkVersion') ? project.targetSdkVersion : DEFAULT_TARGET_SDK_VERSION\n+ versionCode 1\n+ versionName \"1.0\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Get react-native-background-upload working on Android
129,187
09.04.2020 02:33:46
14,400
820628487d1940f55da6441e3d42ca75828004a4
[native] Remove react-native-segmented-control-tab Seems to have gone unused for a while...
[ { "change_type": "DELETE", "old_path": "native/flow-typed/npm/react-native-segmented-control-tab_vx.x.x.js", "new_path": null, "diff": "-// flow-typed signature: 7ae325fb9e807e29c60788704807b171\n-// flow-typed version: <<STUB>>/react-native-segmented-control-tab_v^3.2.1/flow_v0.98.0\n-\n-/**\n- * This is an autogenerated libdef stub for:\n- *\n- * 'react-native-segmented-control-tab'\n- *\n- * Fill this stub out by replacing all the `any` types.\n- *\n- * Once filled out, we encourage you to share your work with the\n- * community by sending a pull request to:\n- * https://github.com/flowtype/flow-typed\n- */\n-\n-declare module 'react-native-segmented-control-tab' {\n- declare module.exports: any;\n-}\n-\n-/**\n- * We include stubs for each file inside this npm package in case you need to\n- * require those files directly. Feel free to delete any files that aren't\n- * needed.\n- */\n-declare module 'react-native-segmented-control-tab/SegmentedControlTab' {\n- declare module.exports: any;\n-}\n-\n-// Filename aliases\n-declare module 'react-native-segmented-control-tab/SegmentedControlTab.js' {\n- declare module.exports: $Exports<'react-native-segmented-control-tab/SegmentedControlTab'>;\n-}\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"react-native-progress\": \"^4.0.3\",\n\"react-native-reanimated\": \"^1.3.0\",\n\"react-native-screens\": \"1.0.0-alpha.17\",\n- \"react-native-segmented-control-tab\": \"^3.2.1\",\n\"react-native-splash-screen\": \"^3.2.0\",\n\"react-native-vector-icons\": \"^6.6.0\",\n\"react-native-video\": \"^5.0.2\",\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "@@ -11621,11 +11621,6 @@ react-native-screens@1.0.0-alpha.17:\ndependencies:\ndebounce \"^1.2.0\"\n-react-native-segmented-control-tab@^3.2.1:\n- version \"3.4.1\"\n- resolved \"https://registry.yarnpkg.com/react-native-segmented-control-tab/-/react-native-segmented-control-tab-3.4.1.tgz#b6e54b8975ce8092315c9b0a1ab58b834d8ccf8e\"\n- integrity sha512-BNPdlE9Unr0Xabewn8W+FhBMLjssXy9Ey7S7AY0hXlrKrEKFdC9z0yT+eEWd5dLam4T6T4IuGL8b7ZF4uGyWNw==\n-\nreact-native-splash-screen@^3.2.0:\nversion \"3.2.0\"\nresolved \"https://registry.yarnpkg.com/react-native-splash-screen/-/react-native-splash-screen-3.2.0.tgz#d47ec8557b1ba988ee3ea98d01463081b60fff45\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Remove react-native-segmented-control-tab Seems to have gone unused for a while...
129,187
08.04.2020 14:58:46
14,400
ffc959bf21f1fdd8f9d8d1b58d48e88101b0ace9
[native] RN0.61 upgrade: update .gitignore
[ { "change_type": "MODIFY", "old_path": "native/.gitignore", "new_path": "native/.gitignore", "diff": "@@ -20,7 +20,6 @@ DerivedData\n*.hmap\n*.ipa\n*.xcuserstate\n-project.xcworkspace\n# Android/IntelliJ\n#\n@@ -36,12 +35,6 @@ node_modules/\nnpm-debug.log\nyarn-error.log\n-# BUCK\n-buck-out/\n-\\.buckd/\n-*.keystore\n-!debug.keystore\n-\n# fastlane\n#\n# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/ios/SquadCal.xcodeproj/project.xcworkspace/contents.xcworkspacedata", "diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<Workspace\n+ version = \"1.0\">\n+ <FileRef\n+ location = \"self:\">\n+ </FileRef>\n+</Workspace>\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/ios/SquadCal.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist", "diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n+<plist version=\"1.0\">\n+<dict>\n+ <key>IDEDidComputeMac32BitWarning</key>\n+ <true/>\n+</dict>\n+</plist>\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/ios/SquadCal.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings", "diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n+<plist version=\"1.0\">\n+<dict/>\n+</plist>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] RN0.61 upgrade: update .gitignore
129,187
09.04.2020 22:38:51
14,400
3a3a03abe8a9992e7909ca58db5430bc00c555f3
[native] RN0.61 upgrade: Metro packager config
[ { "change_type": "DELETE", "old_path": "native/flow-typed/npm/get-yarn-workspaces_vx.x.x.js", "new_path": null, "diff": "-// flow-typed signature: fb36214500abd1ceaa89d07676f5c610\n-// flow-typed version: <<STUB>>/get-yarn-workspaces_v^1.0.2/flow_v0.98.0\n-\n-/**\n- * This is an autogenerated libdef stub for:\n- *\n- * 'get-yarn-workspaces'\n- *\n- * Fill this stub out by replacing all the `any` types.\n- *\n- * Once filled out, we encourage you to share your work with the\n- * community by sending a pull request to:\n- * https://github.com/flowtype/flow-typed\n- */\n-\n-declare module 'get-yarn-workspaces' {\n- declare module.exports: any;\n-}\n-\n-/**\n- * We include stubs for each file inside this npm package in case you need to\n- * require those files directly. Feel free to delete any files that aren't\n- * needed.\n- */\n-\n-\n-// Filename aliases\n-declare module 'get-yarn-workspaces/index' {\n- declare module.exports: $Exports<'get-yarn-workspaces'>;\n-}\n-declare module 'get-yarn-workspaces/index.js' {\n- declare module.exports: $Exports<'get-yarn-workspaces'>;\n-}\n" }, { "change_type": "MODIFY", "old_path": "native/metro.config.js", "new_path": "native/metro.config.js", "diff": "const path = require('path');\n-const getWorkspaces = require('get-yarn-workspaces');\n-\n-const workspaces = getWorkspaces(__dirname);\nmodule.exports = {\n- watchFolders: [path.resolve(__dirname, '../node_modules'), ...workspaces],\n+ watchFolders: [\n+ path.resolve(__dirname, '../node_modules'),\n+ path.resolve(__dirname, '../lib'),\n+ ],\ntransformer: {\ngetTransformOptions: async () => ({\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"flow-bin\": \"^0.98.0\",\n\"flow-mono-cli\": \"^1.5.0\",\n\"fs-extra\": \"^8.1.0\",\n- \"get-yarn-workspaces\": \"^1.0.2\",\n\"jest\": \"^24.9.0\",\n\"jetifier\": \"^1.6.4\",\n\"metro-react-native-babel-preset\": \"^0.56.0\",\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "@@ -6077,11 +6077,6 @@ flatted@^2.0.0:\nresolved \"https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08\"\nintegrity sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==\n-flatten@^1.0.2:\n- version \"1.0.2\"\n- resolved \"https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782\"\n- integrity sha1-2uRqnXj74lKSJYzB54CkHZXAN4I=\n-\nflow-bin@^0.105.0:\nversion \"0.105.2\"\nresolved \"https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.105.2.tgz#9d03d5ae3e1d011e311f309cb8786b3b3695fec2\"\n@@ -6440,15 +6435,6 @@ get-value@^2.0.3, get-value@^2.0.6:\nresolved \"https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28\"\nintegrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=\n-get-yarn-workspaces@^1.0.2:\n- version \"1.0.2\"\n- resolved \"https://registry.yarnpkg.com/get-yarn-workspaces/-/get-yarn-workspaces-1.0.2.tgz#81591bdb392f1c6bac09cdc8491a6d275781aa44\"\n- integrity sha512-Auel048Uclfgr74oNXKZWH30UgKDZXQdfUfgD9iWXdoUGJpeWg9lSuX/FZkQ6RB3KnBfAaf70xQXfwOjiE9rPw==\n- dependencies:\n- find-root \"^1.1.0\"\n- flatten \"^1.0.2\"\n- glob \"^7.1.2\"\n-\ngetpass@^0.1.1:\nversion \"0.1.7\"\nresolved \"https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] RN0.61 upgrade: Metro packager config
129,187
09.04.2020 22:45:16
14,400
01e313c38fdd0e6842624cfb65b3266648db39fb
[native] RN0.61 upgrade: iOS native build
[ { "change_type": "MODIFY", "old_path": "native/ios/Podfile", "new_path": "native/ios/Podfile", "diff": "@@ -3,9 +3,14 @@ require_relative '../../node_modules/@react-native-community/cli-platform-ios/na\ntarget 'SquadCal' do\n# Pods for SquadCal\n+ pod 'FBLazyVector', :path => \"../node_modules/react-native/Libraries/FBLazyVector\"\n+ pod 'FBReactNativeSpec', :path => \"../node_modules/react-native/Libraries/FBReactNativeSpec\"\n+ pod 'RCTRequired', :path => \"../node_modules/react-native/Libraries/RCTRequired\"\n+ pod 'RCTTypeSafety', :path => \"../node_modules/react-native/Libraries/TypeSafety\"\npod 'React', :path => '../../node_modules/react-native/'\n- pod 'React-Core', :path => '../../node_modules/react-native/React'\n- pod 'React-DevSupport', :path => '../../node_modules/react-native/React'\n+ pod 'React-Core', :path => '../node_modules/react-native/'\n+ pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'\n+ pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'\npod 'React-RCTActionSheet', :path => '../../node_modules/react-native/Libraries/ActionSheetIOS'\npod 'React-RCTAnimation', :path => '../../node_modules/react-native/Libraries/NativeAnimation'\npod 'React-RCTBlob', :path => '../../node_modules/react-native/Libraries/Blob'\n@@ -15,13 +20,15 @@ target 'SquadCal' do\npod 'React-RCTSettings', :path => '../../node_modules/react-native/Libraries/Settings'\npod 'React-RCTText', :path => '../../node_modules/react-native/Libraries/Text'\npod 'React-RCTVibration', :path => '../../node_modules/react-native/Libraries/Vibration'\n- pod 'React-RCTWebSocket', :path => '../../node_modules/react-native/Libraries/WebSocket'\n+ pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'\npod 'React-cxxreact', :path => '../../node_modules/react-native/ReactCommon/cxxreact'\npod 'React-jsi', :path => '../../node_modules/react-native/ReactCommon/jsi'\npod 'React-jsiexecutor', :path => '../../node_modules/react-native/ReactCommon/jsiexecutor'\npod 'React-jsinspector', :path => '../../node_modules/react-native/ReactCommon/jsinspector'\n- pod 'yoga', :path => '../../node_modules/react-native/ReactCommon/yoga'\n+ pod 'ReactCommon/jscallinvoker', :path => \"../node_modules/react-native/ReactCommon\"\n+ pod 'ReactCommon/turbomodule/core', :path => \"../node_modules/react-native/ReactCommon\"\n+ pod 'Yoga', :path => '../../node_modules/react-native/ReactCommon/yoga'\npod 'DoubleConversion', :podspec => '../../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'\npod 'glog', :podspec => '../../node_modules/react-native/third-party-podspecs/glog.podspec'\n@@ -35,5 +42,5 @@ target 'SquadCal' do\npod '1PasswordExtension', :git => 'https://github.com/agilebits/onepassword-app-extension.git',\n:commit => 'ba96cf1203f6ea749b7c3f4e921b15d577536253'\n- use_native_modules!(\"..\")\n+ use_native_modules!\nend\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -3,6 +3,14 @@ PODS:\n- boost-for-react-native (1.63.0)\n- DoubleConversion (1.1.6)\n- DVAssetLoaderDelegate (0.3.3)\n+ - FBLazyVector (0.61.5)\n+ - FBReactNativeSpec (0.61.5):\n+ - Folly (= 2018.10.22.00)\n+ - RCTRequired (= 0.61.5)\n+ - RCTTypeSafety (= 0.61.5)\n+ - React-Core (= 0.61.5)\n+ - React-jsi (= 0.61.5)\n+ - ReactCommon/turbomodule/core (= 0.61.5)\n- Folly (2018.10.22.00):\n- boost-for-react-native\n- DoubleConversion\n@@ -27,51 +35,169 @@ PODS:\n- lottie-ios (~> 3.1.3)\n- React\n- mobile-ffmpeg-min (4.2.2.LTS)\n- - React (0.60.6):\n- - React-Core (= 0.60.6)\n- - React-DevSupport (= 0.60.6)\n- - React-RCTActionSheet (= 0.60.6)\n- - React-RCTAnimation (= 0.60.6)\n- - React-RCTBlob (= 0.60.6)\n- - React-RCTImage (= 0.60.6)\n- - React-RCTLinking (= 0.60.6)\n- - React-RCTNetwork (= 0.60.6)\n- - React-RCTSettings (= 0.60.6)\n- - React-RCTText (= 0.60.6)\n- - React-RCTVibration (= 0.60.6)\n- - React-RCTWebSocket (= 0.60.6)\n- - React-Core (0.60.6):\n+ - RCTRequired (0.61.5)\n+ - RCTTypeSafety (0.61.5):\n+ - FBLazyVector (= 0.61.5)\n+ - Folly (= 2018.10.22.00)\n+ - RCTRequired (= 0.61.5)\n+ - React-Core (= 0.61.5)\n+ - React (0.61.5):\n+ - React-Core (= 0.61.5)\n+ - React-Core/DevSupport (= 0.61.5)\n+ - React-Core/RCTWebSocket (= 0.61.5)\n+ - React-RCTActionSheet (= 0.61.5)\n+ - React-RCTAnimation (= 0.61.5)\n+ - React-RCTBlob (= 0.61.5)\n+ - React-RCTImage (= 0.61.5)\n+ - React-RCTLinking (= 0.61.5)\n+ - React-RCTNetwork (= 0.61.5)\n+ - React-RCTSettings (= 0.61.5)\n+ - React-RCTText (= 0.61.5)\n+ - React-RCTVibration (= 0.61.5)\n+ - React-Core (0.61.5):\n+ - Folly (= 2018.10.22.00)\n+ - glog\n+ - React-Core/Default (= 0.61.5)\n+ - React-cxxreact (= 0.61.5)\n+ - React-jsi (= 0.61.5)\n+ - React-jsiexecutor (= 0.61.5)\n+ - Yoga\n+ - React-Core/CoreModulesHeaders (0.61.5):\n+ - Folly (= 2018.10.22.00)\n+ - glog\n+ - React-Core/Default\n+ - React-cxxreact (= 0.61.5)\n+ - React-jsi (= 0.61.5)\n+ - React-jsiexecutor (= 0.61.5)\n+ - Yoga\n+ - React-Core/Default (0.61.5):\n+ - Folly (= 2018.10.22.00)\n+ - glog\n+ - React-cxxreact (= 0.61.5)\n+ - React-jsi (= 0.61.5)\n+ - React-jsiexecutor (= 0.61.5)\n+ - Yoga\n+ - React-Core/DevSupport (0.61.5):\n+ - Folly (= 2018.10.22.00)\n+ - glog\n+ - React-Core/Default (= 0.61.5)\n+ - React-Core/RCTWebSocket (= 0.61.5)\n+ - React-cxxreact (= 0.61.5)\n+ - React-jsi (= 0.61.5)\n+ - React-jsiexecutor (= 0.61.5)\n+ - React-jsinspector (= 0.61.5)\n+ - Yoga\n+ - React-Core/RCTActionSheetHeaders (0.61.5):\n+ - Folly (= 2018.10.22.00)\n+ - glog\n+ - React-Core/Default\n+ - React-cxxreact (= 0.61.5)\n+ - React-jsi (= 0.61.5)\n+ - React-jsiexecutor (= 0.61.5)\n+ - Yoga\n+ - React-Core/RCTAnimationHeaders (0.61.5):\n+ - Folly (= 2018.10.22.00)\n+ - glog\n+ - React-Core/Default\n+ - React-cxxreact (= 0.61.5)\n+ - React-jsi (= 0.61.5)\n+ - React-jsiexecutor (= 0.61.5)\n+ - Yoga\n+ - React-Core/RCTBlobHeaders (0.61.5):\n+ - Folly (= 2018.10.22.00)\n+ - glog\n+ - React-Core/Default\n+ - React-cxxreact (= 0.61.5)\n+ - React-jsi (= 0.61.5)\n+ - React-jsiexecutor (= 0.61.5)\n+ - Yoga\n+ - React-Core/RCTImageHeaders (0.61.5):\n+ - Folly (= 2018.10.22.00)\n+ - glog\n+ - React-Core/Default\n+ - React-cxxreact (= 0.61.5)\n+ - React-jsi (= 0.61.5)\n+ - React-jsiexecutor (= 0.61.5)\n+ - Yoga\n+ - React-Core/RCTLinkingHeaders (0.61.5):\n- Folly (= 2018.10.22.00)\n- - React-cxxreact (= 0.60.6)\n- - React-jsiexecutor (= 0.60.6)\n- - yoga (= 0.60.6.React)\n- - React-cxxreact (0.60.6):\n+ - glog\n+ - React-Core/Default\n+ - React-cxxreact (= 0.61.5)\n+ - React-jsi (= 0.61.5)\n+ - React-jsiexecutor (= 0.61.5)\n+ - Yoga\n+ - React-Core/RCTNetworkHeaders (0.61.5):\n+ - Folly (= 2018.10.22.00)\n+ - glog\n+ - React-Core/Default\n+ - React-cxxreact (= 0.61.5)\n+ - React-jsi (= 0.61.5)\n+ - React-jsiexecutor (= 0.61.5)\n+ - Yoga\n+ - React-Core/RCTSettingsHeaders (0.61.5):\n+ - Folly (= 2018.10.22.00)\n+ - glog\n+ - React-Core/Default\n+ - React-cxxreact (= 0.61.5)\n+ - React-jsi (= 0.61.5)\n+ - React-jsiexecutor (= 0.61.5)\n+ - Yoga\n+ - React-Core/RCTTextHeaders (0.61.5):\n+ - Folly (= 2018.10.22.00)\n+ - glog\n+ - React-Core/Default\n+ - React-cxxreact (= 0.61.5)\n+ - React-jsi (= 0.61.5)\n+ - React-jsiexecutor (= 0.61.5)\n+ - Yoga\n+ - React-Core/RCTVibrationHeaders (0.61.5):\n+ - Folly (= 2018.10.22.00)\n+ - glog\n+ - React-Core/Default\n+ - React-cxxreact (= 0.61.5)\n+ - React-jsi (= 0.61.5)\n+ - React-jsiexecutor (= 0.61.5)\n+ - Yoga\n+ - React-Core/RCTWebSocket (0.61.5):\n+ - Folly (= 2018.10.22.00)\n+ - glog\n+ - React-Core/Default (= 0.61.5)\n+ - React-cxxreact (= 0.61.5)\n+ - React-jsi (= 0.61.5)\n+ - React-jsiexecutor (= 0.61.5)\n+ - Yoga\n+ - React-CoreModules (0.61.5):\n+ - FBReactNativeSpec (= 0.61.5)\n+ - Folly (= 2018.10.22.00)\n+ - RCTTypeSafety (= 0.61.5)\n+ - React-Core/CoreModulesHeaders (= 0.61.5)\n+ - React-RCTImage (= 0.61.5)\n+ - ReactCommon/turbomodule/core (= 0.61.5)\n+ - React-cxxreact (0.61.5):\n- boost-for-react-native (= 1.63.0)\n- DoubleConversion\n- Folly (= 2018.10.22.00)\n- glog\n- - React-jsinspector (= 0.60.6)\n- - React-DevSupport (0.60.6):\n- - React-Core (= 0.60.6)\n- - React-RCTWebSocket (= 0.60.6)\n- - React-jsi (0.60.6):\n+ - React-jsinspector (= 0.61.5)\n+ - React-jsi (0.61.5):\n- boost-for-react-native (= 1.63.0)\n- DoubleConversion\n- Folly (= 2018.10.22.00)\n- glog\n- - React-jsi/Default (= 0.60.6)\n- - React-jsi/Default (0.60.6):\n+ - React-jsi/Default (= 0.61.5)\n+ - React-jsi/Default (0.61.5):\n- boost-for-react-native (= 1.63.0)\n- DoubleConversion\n- Folly (= 2018.10.22.00)\n- glog\n- - React-jsiexecutor (0.60.6):\n+ - React-jsiexecutor (0.61.5):\n- DoubleConversion\n- Folly (= 2018.10.22.00)\n- glog\n- - React-cxxreact (= 0.60.6)\n- - React-jsi (= 0.60.6)\n- - React-jsinspector (0.60.6)\n+ - React-cxxreact (= 0.61.5)\n+ - React-jsi (= 0.61.5)\n+ - React-jsinspector (0.61.5)\n- react-native-background-upload (5.6.0):\n- React\n- react-native-camera (3.8.0):\n@@ -111,29 +237,41 @@ PODS:\n- React\n- react-native-video/Video\n- SPTPersistentCache (~> 1.1.0)\n- - React-RCTActionSheet (0.60.6):\n- - React-Core (= 0.60.6)\n- - React-RCTAnimation (0.60.6):\n- - React-Core (= 0.60.6)\n- - React-RCTBlob (0.60.6):\n- - React-Core (= 0.60.6)\n- - React-RCTNetwork (= 0.60.6)\n- - React-RCTWebSocket (= 0.60.6)\n- - React-RCTImage (0.60.6):\n- - React-Core (= 0.60.6)\n- - React-RCTNetwork (= 0.60.6)\n- - React-RCTLinking (0.60.6):\n- - React-Core (= 0.60.6)\n- - React-RCTNetwork (0.60.6):\n- - React-Core (= 0.60.6)\n- - React-RCTSettings (0.60.6):\n- - React-Core (= 0.60.6)\n- - React-RCTText (0.60.6):\n- - React-Core (= 0.60.6)\n- - React-RCTVibration (0.60.6):\n- - React-Core (= 0.60.6)\n- - React-RCTWebSocket (0.60.6):\n- - React-Core (= 0.60.6)\n+ - React-RCTActionSheet (0.61.5):\n+ - React-Core/RCTActionSheetHeaders (= 0.61.5)\n+ - React-RCTAnimation (0.61.5):\n+ - React-Core/RCTAnimationHeaders (= 0.61.5)\n+ - React-RCTBlob (0.61.5):\n+ - React-Core/RCTBlobHeaders (= 0.61.5)\n+ - React-Core/RCTWebSocket (= 0.61.5)\n+ - React-jsi (= 0.61.5)\n+ - React-RCTNetwork (= 0.61.5)\n+ - React-RCTImage (0.61.5):\n+ - React-Core/RCTImageHeaders (= 0.61.5)\n+ - React-RCTNetwork (= 0.61.5)\n+ - React-RCTLinking (0.61.5):\n+ - React-Core/RCTLinkingHeaders (= 0.61.5)\n+ - React-RCTNetwork (0.61.5):\n+ - React-Core/RCTNetworkHeaders (= 0.61.5)\n+ - React-RCTSettings (0.61.5):\n+ - React-Core/RCTSettingsHeaders (= 0.61.5)\n+ - React-RCTText (0.61.5):\n+ - React-Core/RCTTextHeaders (= 0.61.5)\n+ - React-RCTVibration (0.61.5):\n+ - React-Core/RCTVibrationHeaders (= 0.61.5)\n+ - ReactCommon/jscallinvoker (0.61.5):\n+ - DoubleConversion\n+ - Folly (= 2018.10.22.00)\n+ - glog\n+ - React-cxxreact (= 0.61.5)\n+ - ReactCommon/turbomodule/core (0.61.5):\n+ - DoubleConversion\n+ - Folly (= 2018.10.22.00)\n+ - glog\n+ - React-Core (= 0.61.5)\n+ - React-cxxreact (= 0.61.5)\n+ - React-jsi (= 0.61.5)\n+ - ReactCommon/jscallinvoker (= 0.61.5)\n- ReactNativeART (1.1.2):\n- React\n- ReactNativeDarkMode (0.2.0-rc.1):\n@@ -169,19 +307,25 @@ PODS:\n- libwebp (~> 1.0)\n- SDWebImage/Core (~> 5.0)\n- SPTPersistentCache (1.1.0)\n- - yoga (0.60.6.React)\n+ - Yoga (1.14.0)\nDEPENDENCIES:\n- 1PasswordExtension (from `https://github.com/agilebits/onepassword-app-extension.git`, commit `ba96cf1203f6ea749b7c3f4e921b15d577536253`)\n- DoubleConversion (from `../../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)\n+ - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)\n+ - FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`)\n- Folly (from `../../node_modules/react-native/third-party-podspecs/Folly.podspec`)\n- glog (from `../../node_modules/react-native/third-party-podspecs/glog.podspec`)\n- lottie-ios (from `../../node_modules/lottie-ios`)\n- lottie-react-native (from `../../node_modules/lottie-react-native`)\n+ - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)\n+ - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)\n- React (from `../../node_modules/react-native/`)\n- - React-Core (from `../../node_modules/react-native/React`)\n+ - React-Core (from `../node_modules/react-native/`)\n+ - React-Core/DevSupport (from `../node_modules/react-native/`)\n+ - React-Core/RCTWebSocket (from `../node_modules/react-native/`)\n+ - React-CoreModules (from `../node_modules/react-native/React/CoreModules`)\n- React-cxxreact (from `../../node_modules/react-native/ReactCommon/cxxreact`)\n- - React-DevSupport (from `../../node_modules/react-native/React`)\n- React-jsi (from `../../node_modules/react-native/ReactCommon/jsi`)\n- React-jsiexecutor (from `../../node_modules/react-native/ReactCommon/jsiexecutor`)\n- React-jsinspector (from `../../node_modules/react-native/ReactCommon/jsinspector`)\n@@ -207,7 +351,8 @@ DEPENDENCIES:\n- React-RCTSettings (from `../../node_modules/react-native/Libraries/Settings`)\n- React-RCTText (from `../../node_modules/react-native/Libraries/Text`)\n- React-RCTVibration (from `../../node_modules/react-native/Libraries/Vibration`)\n- - React-RCTWebSocket (from `../../node_modules/react-native/Libraries/WebSocket`)\n+ - ReactCommon/jscallinvoker (from `../node_modules/react-native/ReactCommon`)\n+ - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)\n- \"ReactNativeART (from `../../node_modules/@react-native-community/art`)\"\n- ReactNativeDarkMode (from `../../node_modules/react-native-dark-mode`)\n- ReactNativeKeyboardInput (from `../../node_modules/react-native-keyboard-input`)\n@@ -221,7 +366,7 @@ DEPENDENCIES:\n- RNReanimated (from `../../node_modules/react-native-reanimated`)\n- RNScreens (from `../../node_modules/react-native-screens`)\n- RNVectorIcons (from `../../node_modules/react-native-vector-icons`)\n- - yoga (from `../../node_modules/react-native/ReactCommon/yoga`)\n+ - Yoga (from `../../node_modules/react-native/ReactCommon/yoga`)\nSPEC REPOS:\ntrunk:\n@@ -239,6 +384,10 @@ EXTERNAL SOURCES:\n:git: https://github.com/agilebits/onepassword-app-extension.git\nDoubleConversion:\n:podspec: \"../../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec\"\n+ FBLazyVector:\n+ :path: \"../node_modules/react-native/Libraries/FBLazyVector\"\n+ FBReactNativeSpec:\n+ :path: \"../node_modules/react-native/Libraries/FBReactNativeSpec\"\nFolly:\n:podspec: \"../../node_modules/react-native/third-party-podspecs/Folly.podspec\"\nglog:\n@@ -247,14 +396,18 @@ EXTERNAL SOURCES:\n:path: \"../../node_modules/lottie-ios\"\nlottie-react-native:\n:path: \"../../node_modules/lottie-react-native\"\n+ RCTRequired:\n+ :path: \"../node_modules/react-native/Libraries/RCTRequired\"\n+ RCTTypeSafety:\n+ :path: \"../node_modules/react-native/Libraries/TypeSafety\"\nReact:\n:path: \"../../node_modules/react-native/\"\nReact-Core:\n- :path: \"../../node_modules/react-native/React\"\n+ :path: \"../node_modules/react-native/\"\n+ React-CoreModules:\n+ :path: \"../node_modules/react-native/React/CoreModules\"\nReact-cxxreact:\n:path: \"../../node_modules/react-native/ReactCommon/cxxreact\"\n- React-DevSupport:\n- :path: \"../../node_modules/react-native/React\"\nReact-jsi:\n:path: \"../../node_modules/react-native/ReactCommon/jsi\"\nReact-jsiexecutor:\n@@ -305,8 +458,8 @@ EXTERNAL SOURCES:\n:path: \"../../node_modules/react-native/Libraries/Text\"\nReact-RCTVibration:\n:path: \"../../node_modules/react-native/Libraries/Vibration\"\n- React-RCTWebSocket:\n- :path: \"../../node_modules/react-native/Libraries/WebSocket\"\n+ ReactCommon:\n+ :path: \"../node_modules/react-native/ReactCommon\"\nReactNativeART:\n:path: \"../../node_modules/@react-native-community/art\"\nReactNativeDarkMode:\n@@ -333,7 +486,7 @@ EXTERNAL SOURCES:\n:path: \"../../node_modules/react-native-screens\"\nRNVectorIcons:\n:path: \"../../node_modules/react-native-vector-icons\"\n- yoga:\n+ Yoga:\n:path: \"../../node_modules/react-native/ReactCommon/yoga\"\nCHECKOUT OPTIONS:\n@@ -346,19 +499,23 @@ SPEC CHECKSUMS:\nboost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c\nDoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2\nDVAssetLoaderDelegate: 0caec20e4e08b8560b691131539e9180024d4bce\n+ FBLazyVector: aaeaf388755e4f29cd74acbc9e3b8da6d807c37f\n+ FBReactNativeSpec: 118d0d177724c2d67f08a59136eb29ef5943ec75\nFolly: 30e7936e1c45c08d884aa59369ed951a8e68cf51\nglog: 1f3da668190260b06b429bb211bfbee5cd790c28\nlibwebp: 946cb3063cea9236285f7e9a8505d806d30e07f3\nlottie-ios: 496ac5cea1bbf1a7bd1f1f472f3232eb1b8d744b\nlottie-react-native: b123a79529cc732201091f585c62c89bb4747252\nmobile-ffmpeg-min: 05ebe3998721155274ae50466b5223d3637a92ab\n- React: 68e7f8dfc27729eade18423072a143120f2f32ab\n- React-Core: fc9dace551f6c8c1007dd2d3cb1bc10c90a01d3e\n- React-cxxreact: abe59014fce932d41a08bf1aa5dcad9ca8f0a2c5\n- React-DevSupport: b0da2fd9ad4ffb25561bf2a328ab84f78f871bdd\n- React-jsi: 1a4248256b96fa453536a8dafe11b784e24e789d\n- React-jsiexecutor: 2279e559b921d02dfc6253ebef3dcb3a9dc6c07e\n- React-jsinspector: a58b86545a0185f69768e78ac96ca9fe43fa3694\n+ RCTRequired: b153add4da6e7dbc44aebf93f3cf4fcae392ddf1\n+ RCTTypeSafety: 9aa1b91d7f9310fc6eadc3cf95126ffe818af320\n+ React: b6a59ef847b2b40bb6e0180a97d0ca716969ac78\n+ React-Core: 688b451f7d616cc1134ac95295b593d1b5158a04\n+ React-CoreModules: d04f8494c1a328b69ec11db9d1137d667f916dcb\n+ React-cxxreact: d0f7bcafa196ae410e5300736b424455e7fb7ba7\n+ React-jsi: cb2cd74d7ccf4cffb071a46833613edc79cdf8f7\n+ React-jsiexecutor: d5525f9ed5f782fdbacb64b9b01a43a9323d2386\n+ React-jsinspector: fa0ecc501688c3c4c34f28834a76302233e29dc0\nreact-native-background-upload: 6e8ba7f41a6308231306bddc88f11da3b74c9de4\nreact-native-camera: 21cf4ed26cf432ceb1fae959aa6924943fd6f714\nreact-native-cameraroll: 463aff54e37cff27ea76eb792e6f1fa43b876320\n@@ -372,16 +529,16 @@ SPEC CHECKSUMS:\nreact-native-orientation-locker: 23918c400376a7043e752c639c122fcf6bce8f1c\nreact-native-splash-screen: 200d11d188e2e78cea3ad319964f6142b6384865\nreact-native-video: d01ed7ff1e38fa7dcc6c15c94cf505e661b7bfd0\n- React-RCTActionSheet: 49f6a67a7efa6688f637296383d453b97ef13645\n- React-RCTAnimation: e8047438b2927ebbe630bbf600c7309374075df3\n- React-RCTBlob: 2c4b28daca5b3e6e356706d8e0c7436a0e8ef492\n- React-RCTImage: 273501f0529775962551613259c20ccdf1a87cd2\n- React-RCTLinking: 76c88b3cc98657915a2ba2f20d208e44d0530a43\n- React-RCTNetwork: 77c11e672ccdcc33da5d047705f100b016497b15\n- React-RCTSettings: f727c25ad26a8a9bd7272a8ba93781bd1f53952a\n- React-RCTText: d91537e29e38dc69cf09cbca0875cf5dc7402da6\n- React-RCTVibration: 7655d72dfb919dd6d8e135ca108a5a2bd9fcd7b4\n- React-RCTWebSocket: 7cd2c8d0f8ddd680dc76404defba7ab1f56b83af\n+ React-RCTActionSheet: 600b4d10e3aea0913b5a92256d2719c0cdd26d76\n+ React-RCTAnimation: 791a87558389c80908ed06cc5dfc5e7920dfa360\n+ React-RCTBlob: d89293cc0236d9cb0933d85e430b0bbe81ad1d72\n+ React-RCTImage: 6b8e8df449eb7c814c99a92d6b52de6fe39dea4e\n+ React-RCTLinking: 121bb231c7503cf9094f4d8461b96a130fabf4a5\n+ React-RCTNetwork: fb353640aafcee84ca8b78957297bd395f065c9a\n+ React-RCTSettings: 8db258ea2a5efee381fcf7a6d5044e2f8b68b640\n+ React-RCTText: 9ccc88273e9a3aacff5094d2175a605efa854dbe\n+ React-RCTVibration: a49a1f42bf8f5acf1c3e297097517c6b3af377ad\n+ ReactCommon: 198c7c8d3591f975e5431bec1b0b3b581aa1c5dd\nReactNativeART: c580fba2f7d188d8fa4418ce78db8130654ed10f\nReactNativeDarkMode: 88317ff05ba95fd063dd347ad32f8c4cefd3166c\nReactNativeKeyboardInput: c37e26821519869993b3b61844350feb9177ff37\n@@ -398,8 +555,8 @@ SPEC CHECKSUMS:\nSDWebImage: 4d5c027c935438f341ed33dbac53ff9f479922ca\nSDWebImageWebPCoder: 947093edd1349d820c40afbd9f42acb6cdecd987\nSPTPersistentCache: df36ea46762d7cf026502bbb86a8b79d0080dff4\n- yoga: 5079887aa3e4c62142d6bcee493022643ee4d730\n+ Yoga: f2a7cd4280bfe2cca5a7aed98ba0eb3d1310f18b\n-PODFILE CHECKSUM: 854ab89ac3b1d39a6889a2a6c47a64f84df459b4\n+PODFILE CHECKSUM: 43ca6ae2aa727213e4a0b2168fca850443c2f429\nCOCOAPODS: 1.9.1\n" }, { "change_type": "DELETE", "old_path": "patches/react-native+0.60.6.patch", "new_path": null, "diff": "-diff --git a/node_modules/react-native/React/Modules/RCTStatusBarManager.m b/node_modules/react-native/React/Modules/RCTStatusBarManager.m\n-index 9b6f9d6..d15fd73 100644\n---- a/node_modules/react-native/React/Modules/RCTStatusBarManager.m\n-+++ b/node_modules/react-native/React/Modules/RCTStatusBarManager.m\n-@@ -14,17 +14,44 @@\n- #if !TARGET_OS_TV\n- @implementation RCTConvert (UIStatusBar)\n-\n--RCT_ENUM_CONVERTER(UIStatusBarStyle, (@{\n-- @\"default\": @(UIStatusBarStyleDefault),\n-- @\"light-content\": @(UIStatusBarStyleLightContent),\n-- @\"dark-content\": @(UIStatusBarStyleDefault),\n--}), UIStatusBarStyleDefault, integerValue);\n--\n--RCT_ENUM_CONVERTER(UIStatusBarAnimation, (@{\n-- @\"none\": @(UIStatusBarAnimationNone),\n-- @\"fade\": @(UIStatusBarAnimationFade),\n-- @\"slide\": @(UIStatusBarAnimationSlide),\n--}), UIStatusBarAnimationNone, integerValue);\n-++ (UIStatusBarStyle)UIStatusBarStyle:(id)json RCT_DYNAMIC\n-+{\n-+ static NSDictionary *mapping;\n-+ static dispatch_once_t onceToken;\n-+ dispatch_once(&onceToken, ^{\n-+ if (@available(iOS 13.0, *)) {\n-+ mapping = @{\n-+ @\"default\" : @(UIStatusBarStyleDefault),\n-+ @\"light-content\" : @(UIStatusBarStyleLightContent),\n-+#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && \\\n-+ __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0\n-+ @\"dark-content\" : @(UIStatusBarStyleDarkContent)\n-+#else\n-+ @\"dark-content\": @(UIStatusBarStyleDefault)\n-+#endif\n-+ };\n-+\n-+ } else {\n-+ mapping = @{\n-+ @\"default\" : @(UIStatusBarStyleDefault),\n-+ @\"light-content\" : @(UIStatusBarStyleLightContent),\n-+ @\"dark-content\" : @(UIStatusBarStyleDefault)\n-+ };\n-+ }\n-+ });\n-+ return _RCT_CAST(\n-+ type, [RCTConvertEnumValue(\"UIStatusBarStyle\", mapping, @(UIStatusBarStyleDefault), json) integerValue]);\n-+}\n-+\n-+RCT_ENUM_CONVERTER(\n-+ UIStatusBarAnimation,\n-+ (@{\n-+ @\"none\" : @(UIStatusBarAnimationNone),\n-+ @\"fade\" : @(UIStatusBarAnimationFade),\n-+ @\"slide\" : @(UIStatusBarAnimationSlide),\n-+ }),\n-+ UIStatusBarAnimationNone,\n-+ integerValue);\n-\n- @end\n- #endif\n-@@ -36,8 +63,9 @@ static BOOL RCTViewControllerBasedStatusBarAppearance()\n- static BOOL value;\n- static dispatch_once_t onceToken;\n- dispatch_once(&onceToken, ^{\n-- value = [[[NSBundle mainBundle] objectForInfoDictionaryKey:\n-- @\"UIViewControllerBasedStatusBarAppearance\"] ?: @YES boolValue];\n-+ value =\n-+ [[[NSBundle mainBundle] objectForInfoDictionaryKey:@\"UIViewControllerBasedStatusBarAppearance\"]\n-+ ?: @YES boolValue];\n- });\n-\n- return value;\n-@@ -47,8 +75,7 @@ static BOOL RCTViewControllerBasedStatusBarAppearance()\n-\n- - (NSArray<NSString *> *)supportedEvents\n- {\n-- return @[@\"statusBarFrameDidChange\",\n-- @\"statusBarFrameWillChange\"];\n-+ return @[ @\"statusBarFrameDidChange\", @\"statusBarFrameWillChange\" ];\n- }\n-\n- #if !TARGET_OS_TV\n-@@ -56,8 +83,14 @@ static BOOL RCTViewControllerBasedStatusBarAppearance()\n- - (void)startObserving\n- {\n- NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];\n-- [nc addObserver:self selector:@selector(applicationDidChangeStatusBarFrame:) name:UIApplicationDidChangeStatusBarFrameNotification object:nil];\n-- [nc addObserver:self selector:@selector(applicationWillChangeStatusBarFrame:) name:UIApplicationWillChangeStatusBarFrameNotification object:nil];\n-+ [nc addObserver:self\n-+ selector:@selector(applicationDidChangeStatusBarFrame:)\n-+ name:UIApplicationDidChangeStatusBarFrameNotification\n-+ object:nil];\n-+ [nc addObserver:self\n-+ selector:@selector(applicationWillChangeStatusBarFrame:)\n-+ name:UIApplicationWillChangeStatusBarFrameNotification\n-+ object:nil];\n- }\n-\n- - (void)stopObserving\n-@@ -74,11 +107,11 @@ - (void)emitEvent:(NSString *)eventName forNotification:(NSNotification *)notifi\n- {\n- CGRect frame = [notification.userInfo[UIApplicationStatusBarFrameUserInfoKey] CGRectValue];\n- NSDictionary *event = @{\n-- @\"frame\": @{\n-- @\"x\": @(frame.origin.x),\n-- @\"y\": @(frame.origin.y),\n-- @\"width\": @(frame.size.width),\n-- @\"height\": @(frame.size.height),\n-+ @\"frame\" : @{\n-+ @\"x\" : @(frame.origin.x),\n-+ @\"y\" : @(frame.origin.y),\n-+ @\"width\" : @(frame.size.width),\n-+ @\"height\" : @(frame.size.height),\n- },\n- };\n- [self sendEventWithName:eventName body:event];\n-@@ -94,15 +127,14 @@ - (void)applicationWillChangeStatusBarFrame:(NSNotification *)notification\n- [self emitEvent:@\"statusBarFrameWillChange\" forNotification:notification];\n- }\n-\n--RCT_EXPORT_METHOD(getHeight:(RCTResponseSenderBlock)callback)\n-+RCT_EXPORT_METHOD(getHeight : (RCTResponseSenderBlock)callback)\n- {\n-- callback(@[@{\n-- @\"height\": @(RCTSharedApplication().statusBarFrame.size.height),\n-- }]);\n-+ callback(@[ @{\n-+ @\"height\" : @(RCTSharedApplication().statusBarFrame.size.height),\n-+ } ]);\n- }\n-\n--RCT_EXPORT_METHOD(setStyle:(UIStatusBarStyle)statusBarStyle\n-- animated:(BOOL)animated)\n-+RCT_EXPORT_METHOD(setStyle : (UIStatusBarStyle)statusBarStyle animated : (BOOL)animated)\n- {\n- if (RCTViewControllerBasedStatusBarAppearance()) {\n- RCTLogError(@\"RCTStatusBarManager module requires that the \\\n-@@ -110,14 +142,12 @@ - (void)applicationWillChangeStatusBarFrame:(NSNotification *)notification\n- } else {\n- #pragma clang diagnostic push\n- #pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n-- [RCTSharedApplication() setStatusBarStyle:statusBarStyle\n-- animated:animated];\n-+ [RCTSharedApplication() setStatusBarStyle:statusBarStyle animated:animated];\n- }\n- #pragma clang diagnostic pop\n- }\n-\n--RCT_EXPORT_METHOD(setHidden:(BOOL)hidden\n-- withAnimation:(UIStatusBarAnimation)animation)\n-+RCT_EXPORT_METHOD(setHidden : (BOOL)hidden withAnimation : (UIStatusBarAnimation)animation)\n- {\n- if (RCTViewControllerBasedStatusBarAppearance()) {\n- RCTLogError(@\"RCTStatusBarManager module requires that the \\\n-@@ -125,17 +155,16 @@ - (void)applicationWillChangeStatusBarFrame:(NSNotification *)notification\n- } else {\n- #pragma clang diagnostic push\n- #pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n-- [RCTSharedApplication() setStatusBarHidden:hidden\n-- withAnimation:animation];\n-+ [RCTSharedApplication() setStatusBarHidden:hidden withAnimation:animation];\n- #pragma clang diagnostic pop\n- }\n- }\n-\n--RCT_EXPORT_METHOD(setNetworkActivityIndicatorVisible:(BOOL)visible)\n-+RCT_EXPORT_METHOD(setNetworkActivityIndicatorVisible : (BOOL)visible)\n- {\n- RCTSharedApplication().networkActivityIndicatorVisible = visible;\n- }\n-\n--#endif //TARGET_OS_TV\n-+#endif // TARGET_OS_TV\n-\n- @end\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] RN0.61 upgrade: iOS native build
129,187
09.04.2020 22:45:49
14,400
2a53f390228807f9a8391c9f773ad3579a2e2a28
[native] RN0.61 upgrade: Android native build
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -173,15 +173,6 @@ android {\n}\n}\n-\n- packagingOptions {\n- pickFirst '**/armeabi-v7a/libc++_shared.so'\n- pickFirst '**/x86/libc++_shared.so'\n- pickFirst '**/arm64-v8a/libc++_shared.so'\n- pickFirst '**/x86_64/libc++_shared.so'\n- pickFirst '**/x86/libjsc.so'\n- pickFirst '**/armeabi-v7a/libjsc.so'\n- }\n}\ndependencies {\n@@ -195,7 +186,7 @@ dependencies {\nimplementation \"androidx.multidex:multidex:2.0.1\"\nif (enableHermes) {\n- def hermesPath = \"../../../node_modules/hermesvm/android/\";\n+ def hermesPath = \"../../../node_modules/hermes-engine/android/\";\ndebugImplementation files(hermesPath + \"hermes-debug.aar\")\nreleaseImplementation files(hermesPath + \"hermes-release.aar\")\n} else {\n@@ -211,5 +202,5 @@ task copyDownloadableDepsToLibs(type: Copy) {\n}\napply from: file(\"../../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle\");\n-applyNativeModulesAppBuildGradle(project, \"..\")\n+applyNativeModulesAppBuildGradle(project)\napply plugin: 'com.google.gms.google-services'\n" }, { "change_type": "MODIFY", "old_path": "native/android/app/src/main/java/org/squadcal/MainApplication.java", "new_path": "native/android/app/src/main/java/org/squadcal/MainApplication.java", "diff": "package org.squadcal;\nimport androidx.multidex.MultiDexApplication;\n-import android.util.Log;\n+import android.content.Context;\nimport com.facebook.react.PackageList;\nimport com.facebook.hermes.reactexecutor.HermesExecutorFactory;\n@@ -17,6 +17,7 @@ import com.facebook.soloader.SoLoader;\nimport java.util.Arrays;\nimport java.util.List;\n+import java.lang.reflect.InvocationTargetException;\npublic class MainApplication extends MultiDexApplication implements ReactApplication {\n@@ -50,5 +51,32 @@ public class MainApplication extends MultiDexApplication implements ReactApplica\npublic void onCreate() {\nsuper.onCreate();\nSoLoader.init(this, /* native exopackage */ false);\n+ initializeFlipper(this); // Remove this line if you don't want Flipper enabled\n+ }\n+\n+ /**\n+ * Loads Flipper in React Native templates.\n+ *\n+ * @param context\n+ */\n+ private static void initializeFlipper(Context context) {\n+ if (BuildConfig.DEBUG) {\n+ try {\n+ /*\n+ We use reflection here to pick up the class that initializes Flipper,\n+ since Flipper library is not available in release mode\n+ */\n+ Class<?> aClass = Class.forName(\"com.facebook.flipper.ReactNativeFlipper\");\n+ aClass.getMethod(\"initializeFlipper\", Context.class).invoke(null, context);\n+ } catch (ClassNotFoundException e) {\n+ e.printStackTrace();\n+ } catch (NoSuchMethodException e) {\n+ e.printStackTrace();\n+ } catch (IllegalAccessException e) {\n+ e.printStackTrace();\n+ } catch (InvocationTargetException e) {\n+ e.printStackTrace();\n+ }\n+ }\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "native/android/build.gradle", "new_path": "native/android/build.gradle", "diff": "@@ -13,7 +13,7 @@ buildscript {\njcenter()\n}\ndependencies {\n- classpath(\"com.android.tools.build:gradle:3.4.1\")\n+ classpath(\"com.android.tools.build:gradle:3.4.2\")\nclasspath(\"com.google.gms:google-services:4.2.0\")\n// NOTE: Do not place your application dependencies here; they belong\n@@ -38,5 +38,6 @@ allprojects {\n}\ngoogle()\njcenter()\n+ maven { url 'https://www.jitpack.io' }\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "native/android/gradle/wrapper/gradle-wrapper.properties", "new_path": "native/android/gradle/wrapper/gradle-wrapper.properties", "diff": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\n-distributionUrl=https\\://services.gradle.org/distributions/gradle-5.4.1-all.zip\n+distributionUrl=https\\://services.gradle.org/distributions/gradle-5.5-all.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n" }, { "change_type": "MODIFY", "old_path": "native/android/settings.gradle", "new_path": "native/android/settings.gradle", "diff": "rootProject.name = 'SquadCal'\napply from: file(\"../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle\");\n-applyNativeModulesSettingsGradle(settings, \"..\")\n+applyNativeModulesSettingsGradle(settings)\ninclude ':reactnativekeyboardinput'\nproject(':reactnativekeyboardinput').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-keyboard-input/lib/android')\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] RN0.61 upgrade: Android native build
129,187
09.04.2020 22:47:26
14,400
a58b8aaf5e3c33eee145a7b1a69d63258b3abdb6
RN0.61 upgrade: update Flow & native/.flowconfig
[ { "change_type": "MODIFY", "old_path": "lib/package.json", "new_path": "lib/package.json", "diff": "\"clean\": \"rm -rf node_modules/\"\n},\n\"devDependencies\": {\n- \"flow-bin\": \"^0.98.0\"\n+ \"flow-bin\": \"^0.105.0\"\n},\n\"dependencies\": {\n\"dateformat\": \"^3.0.3\",\n" }, { "change_type": "MODIFY", "old_path": "native/.flowconfig", "new_path": "native/.flowconfig", "diff": "; We fork some components by platform\n.*/*[.]android.js\n-; Ignore \"BUCK\" generated dirs\n-<PROJECT_ROOT>/\\.buckd/\n-\n-.*/node_modules/react-native/Libraries/react-native/react-native-implementation.js\n-\n.*/node_modules/redux-persist/lib/index.js\n.*/node_modules/react-native-fast-image/src/index.js.flow\n.*/node_modules/react-native-fs/FS.common.js\n; Flow doesn't support platforms\n-.*/Libraries/Utilities/HMRLoadingView.js\n+.*/Libraries/Utilities/LoadingView.js\n+\n+.*/squadcal/web/.*\n+.*/squadcal/server/.*\n[untyped]\n.*/node_modules/@react-native-community/cli/.*/.*\n+.*/node_modules/react-native-camera/src/.*\n[include]\n-../lib\n+../node_modules\n[libs]\n-node_modules/react-native/Libraries/react-native/react-native-interface.js\n-node_modules/react-native/flow/\n+../node_modules/react-native/Libraries/react-native/react-native-interface.js\n+../node_modules/react-native/flow/\n[options]\nemoji=true\n@@ -34,27 +33,11 @@ module.file_ext=.js\nmodule.file_ext=.json\nmodule.file_ext=.ios.js\n-module.system=haste\n-module.system.haste.use_name_reducers=true\n-# get basename\n-module.system.haste.name_reducers='^.*/\\([a-zA-Z0-9$_.-]+\\.js\\(\\.flow\\)?\\)$' -> '\\1'\n-# strip .js or .js.flow suffix\n-module.system.haste.name_reducers='^\\(.*\\)\\.js\\(\\.flow\\)?$' -> '\\1'\n-# strip .ios suffix\n-module.system.haste.name_reducers='^\\(.*\\)\\.ios$' -> '\\1'\n-module.system.haste.name_reducers='^\\(.*\\)\\.android$' -> '\\1'\n-module.system.haste.name_reducers='^\\(.*\\)\\.native$' -> '\\1'\n-module.system.haste.paths.blacklist=.*/__tests__/.*\n-module.system.haste.paths.blacklist=.*/__mocks__/.*\n-module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*\n-module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/RNTester/.*\n-module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/IntegrationTests/.*\n-module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/react-native/react-native-implementation.js\n-module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*\n-\nmunge_underscores=true\n-module.name_mapper='^[./a-zA-Z0-9$_-]+\\.\\(bmp\\|gif\\|jpg\\|jpeg\\|png\\|psd\\|svg\\|webp\\|m4v\\|mov\\|mp4\\|mpeg\\|mpg\\|webm\\|aac\\|aiff\\|caf\\|m4a\\|mp3\\|wav\\|html\\|pdf\\)$' -> 'RelativeImageStub'\n+module.name_mapper='^react-native$' -> '<PROJECT_ROOT>/../node_modules/react-native/Libraries/react-native/react-native-implementation'\n+module.name_mapper='^react-native/\\(.*\\)$' -> '<PROJECT_ROOT>/../node_modules/react-native/\\1'\n+module.name_mapper='^[./a-zA-Z0-9$_-]+\\.\\(bmp\\|gif\\|jpg\\|jpeg\\|png\\|psd\\|svg\\|webp\\|m4v\\|mov\\|mp4\\|mpeg\\|mpg\\|webm\\|aac\\|aiff\\|caf\\|m4a\\|mp3\\|wav\\|html\\|pdf\\)$' -> '<PROJECT_ROOT>/../node_modules/react-native/Libraries/Image/RelativeImageStub'\nsuppress_type=$FlowIssue\nsuppress_type=$FlowFixMe\n@@ -88,4 +71,4 @@ untyped-import\nuntyped-type-import\n[version]\n-^0.98.0\n+^0.105.0\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"babel-jest\": \"^24.9.0\",\n\"babel-plugin-transform-remove-console\": \"^6.8.5\",\n\"babel-plugin-transform-remove-strict-mode\": \"0.0.2\",\n- \"flow-bin\": \"^0.98.0\",\n+ \"flow-bin\": \"^0.105.0\",\n\"flow-mono-cli\": \"^1.5.0\",\n\"fs-extra\": \"^8.1.0\",\n\"jest\": \"^24.9.0\",\n" }, { "change_type": "MODIFY", "old_path": "server/package.json", "new_path": "server/package.json", "diff": "\"@babel/preset-react\": \"^7.0.0\",\n\"chokidar-cli\": \"^2.0.0\",\n\"concurrently\": \"^5.0.0\",\n- \"flow-bin\": \"^0.98.0\",\n+ \"flow-bin\": \"^0.105.0\",\n\"flow-typed\": \"^2.2.3\",\n\"nodemon\": \"^1.19.3\"\n},\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
RN0.61 upgrade: update Flow & native/.flowconfig
129,187
09.04.2020 23:49:45
14,400
b61af31eb79624461471e458e7184bf0daca6828
[native] RN0.61 upgrade: use_frameworks in Podfile See for more context
[ { "change_type": "MODIFY", "old_path": "native/ios/Podfile", "new_path": "native/ios/Podfile", "diff": "@@ -43,4 +43,5 @@ target 'SquadCal' do\n:commit => 'ba96cf1203f6ea749b7c3f4e921b15d577536253'\nuse_native_modules!\n+ use_frameworks!\nend\n" }, { "change_type": "DELETE", "old_path": "native/ios/SquadCal-Bridging-Header.h", "new_path": null, "diff": "-//\n-// Use this file to import your target's public headers that you would like to expose to Swift.\n-//\n-\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal.xcodeproj/project.pbxproj", "new_path": "native/ios/SquadCal.xcodeproj/project.pbxproj", "diff": "13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };\n13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };\n13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };\n- 79E6AA073D734E63267D7356 /* libPods-SquadCal.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F03667D146661AF6D8C91AB9 /* libPods-SquadCal.a */; };\n7F761E602201141E001B6FB7 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F761E292201141E001B6FB7 /* JavaScriptCore.framework */; };\n- 7F8FB0942333063D007EF826 /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F8FB0932333063D007EF826 /* File.swift */; };\n7FB58ABE1E7F6BD500B4C1B1 /* Anaheim-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 7FB58ABB1E7F6BC600B4C1B1 /* Anaheim-Regular.ttf */; };\n7FB58AC01E7F6BD800B4C1B1 /* OpenSans-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 7FB58ABC1E7F6BC600B4C1B1 /* OpenSans-Regular.ttf */; };\n7FB58AC21E7F6BDB00B4C1B1 /* OpenSans-Semibold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 7FB58ABD1E7F6BC600B4C1B1 /* OpenSans-Semibold.ttf */; };\n+ B142D461DA6DEBA783DF658F /* Pods_SquadCal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BECA2B0914281D4FAAD45B78 /* Pods_SquadCal.framework */; };\n/* End PBXBuildFile section */\n/* Begin PBXFileReference section */\n7EE5A7681B39319D3AF09109 /* Pods-SquadCal.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = \"Pods-SquadCal.release.xcconfig\"; path = \"Target Support Files/Pods-SquadCal/Pods-SquadCal.release.xcconfig\"; sourceTree = \"<group>\"; };\n7F554F822332D58B007CB9F7 /* Info.debug.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.debug.plist; path = SquadCal/Info.debug.plist; sourceTree = \"<group>\"; };\n7F761E292201141E001B6FB7 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };\n- 7F8FB0922333063C007EF826 /* SquadCal-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"SquadCal-Bridging-Header.h\"; sourceTree = \"<group>\"; };\n- 7F8FB0932333063D007EF826 /* File.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = \"<group>\"; };\n7FB58ABB1E7F6BC600B4C1B1 /* Anaheim-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = \"Anaheim-Regular.ttf\"; sourceTree = \"<group>\"; };\n7FB58ABC1E7F6BC600B4C1B1 /* OpenSans-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = \"OpenSans-Regular.ttf\"; sourceTree = \"<group>\"; };\n7FB58ABD1E7F6BC600B4C1B1 /* OpenSans-Semibold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = \"OpenSans-Semibold.ttf\"; sourceTree = \"<group>\"; };\n7FCFD8BD1E81B8DF00629B0E /* SquadCal.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = SquadCal.entitlements; path = SquadCal/SquadCal.entitlements; sourceTree = \"<group>\"; };\n8C0A50BD3E650F9A49DACD73 /* Pods-SquadCal.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = \"Pods-SquadCal.debug.xcconfig\"; path = \"Target Support Files/Pods-SquadCal/Pods-SquadCal.debug.xcconfig\"; sourceTree = \"<group>\"; };\n- F03667D146661AF6D8C91AB9 /* libPods-SquadCal.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libPods-SquadCal.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n+ BECA2B0914281D4FAAD45B78 /* Pods_SquadCal.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SquadCal.framework; sourceTree = BUILT_PRODUCTS_DIR; };\n/* End PBXFileReference section */\n/* Begin PBXFrameworksBuildPhase section */\nbuildActionMask = 2147483647;\nfiles = (\n7F761E602201141E001B6FB7 /* JavaScriptCore.framework in Frameworks */,\n- 79E6AA073D734E63267D7356 /* libPods-SquadCal.a in Frameworks */,\n+ B142D461DA6DEBA783DF658F /* Pods_SquadCal.framework in Frameworks */,\n);\nrunOnlyForDeploymentPostprocessing = 0;\n};\n13B07FB61A68108700A75B9A /* Info.release.plist */,\n13B07FB11A68108700A75B9A /* LaunchScreen.xib */,\n13B07FB71A68108700A75B9A /* main.m */,\n- 7F8FB0932333063D007EF826 /* File.swift */,\n- 7F8FB0922333063C007EF826 /* SquadCal-Bridging-Header.h */,\n);\nname = SquadCal;\nsourceTree = \"<group>\";\nisa = PBXGroup;\nchildren = (\n7F761E292201141E001B6FB7 /* JavaScriptCore.framework */,\n- F03667D146661AF6D8C91AB9 /* libPods-SquadCal.a */,\n+ BECA2B0914281D4FAAD45B78 /* Pods_SquadCal.framework */,\n);\nname = Frameworks;\nsourceTree = \"<group>\";\n13B07F8C1A680F5B00A75B9A /* Frameworks */,\n13B07F8E1A680F5B00A75B9A /* Resources */,\n00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,\n- 2D0D91B65B8CBEADFD2210D0 /* [CP] Copy Pods Resources */,\n+ CC5FF6BDB10C85E53F3024F6 /* [CP] Embed Pods Frameworks */,\n);\nbuildRules = (\n);\nTargetAttributes = {\n13B07F861A680F5B00A75B9A = {\nDevelopmentTeam = 6BF4H9TU5U;\n- LastSwiftMigration = 1030;\nProvisioningStyle = Automatic;\nSystemCapabilities = {\ncom.apple.BackgroundModes = {\nshellPath = /bin/sh;\nshellScript = \"export NODE_BINARY=node\\n../node_modules/react-native/scripts/react-native-xcode.sh\\n\";\n};\n- 2D0D91B65B8CBEADFD2210D0 /* [CP] Copy Pods Resources */ = {\n- isa = PBXShellScriptBuildPhase;\n- buildActionMask = 2147483647;\n- files = (\n- );\n- inputPaths = (\n- \"${PODS_ROOT}/Target Support Files/Pods-SquadCal/Pods-SquadCal-resources.sh\",\n- \"${PODS_CONFIGURATION_BUILD_DIR}/1PasswordExtension/OnePasswordExtensionResources.bundle\",\n- \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/AntDesign.ttf\",\n- \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/Entypo.ttf\",\n- \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf\",\n- \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/Feather.ttf\",\n- \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf\",\n- \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Brands.ttf\",\n- \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Regular.ttf\",\n- \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Solid.ttf\",\n- \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/Fontisto.ttf\",\n- \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/Foundation.ttf\",\n- \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/Ionicons.ttf\",\n- \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf\",\n- \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/MaterialIcons.ttf\",\n- \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/Octicons.ttf\",\n- \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/SimpleLineIcons.ttf\",\n- \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/Zocial.ttf\",\n- );\n- name = \"[CP] Copy Pods Resources\";\n- outputPaths = (\n- \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/OnePasswordExtensionResources.bundle\",\n- \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AntDesign.ttf\",\n- \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Entypo.ttf\",\n- \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EvilIcons.ttf\",\n- \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Feather.ttf\",\n- \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome.ttf\",\n- \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Brands.ttf\",\n- \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Regular.ttf\",\n- \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Solid.ttf\",\n- \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Fontisto.ttf\",\n- \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Foundation.ttf\",\n- \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Ionicons.ttf\",\n- \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MaterialCommunityIcons.ttf\",\n- \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MaterialIcons.ttf\",\n- \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Octicons.ttf\",\n- \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SimpleLineIcons.ttf\",\n- \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Zocial.ttf\",\n- );\n- runOnlyForDeploymentPostprocessing = 0;\n- shellPath = /bin/sh;\n- shellScript = \"\\\"${PODS_ROOT}/Target Support Files/Pods-SquadCal/Pods-SquadCal-resources.sh\\\"\\n\";\n- showEnvVarsInLog = 0;\n- };\n3FE01AD85986FDE151C2E50A /* [CP] Check Pods Manifest.lock */ = {\nisa = PBXShellScriptBuildPhase;\nbuildActionMask = 2147483647;\nshellScript = \"diff \\\"${PODS_PODFILE_DIR_PATH}/Podfile.lock\\\" \\\"${PODS_ROOT}/Manifest.lock\\\" > /dev/null\\nif [ $? != 0 ] ; then\\n # print error to STDERR\\n echo \\\"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\\\" >&2\\n exit 1\\nfi\\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\\necho \\\"SUCCESS\\\" > \\\"${SCRIPT_OUTPUT_FILE_0}\\\"\\n\";\nshowEnvVarsInLog = 0;\n};\n+ CC5FF6BDB10C85E53F3024F6 /* [CP] Embed Pods Frameworks */ = {\n+ isa = PBXShellScriptBuildPhase;\n+ buildActionMask = 2147483647;\n+ files = (\n+ );\n+ inputPaths = (\n+ \"${PODS_ROOT}/Target Support Files/Pods-SquadCal/Pods-SquadCal-frameworks.sh\",\n+ \"${BUILT_PRODUCTS_DIR}/1PasswordExtension/OnePasswordExtension.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/DVAssetLoaderDelegate/DVAssetLoaderDelegate.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/DoubleConversion/DoubleConversion.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/FBReactNativeSpec/FBReactNativeSpec.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/Folly/folly.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/RCTTypeSafety/RCTTypeSafety.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/RNCAsyncStorage/RNCAsyncStorage.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/RNExitApp/RNExitApp.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/RNFS/RNFS.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/RNFastImage/RNFastImage.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/RNGestureHandler/RNGestureHandler.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/RNKeychain/RNKeychain.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/RNReanimated/RNReanimated.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/RNScreens/RNScreens.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/RNVectorIcons/RNVectorIcons.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/React-Core/React.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/React-CoreModules/CoreModules.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/React-RCTActionSheet/RCTActionSheet.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/React-RCTAnimation/RCTAnimation.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/React-RCTBlob/RCTBlob.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/React-RCTImage/RCTImage.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/React-RCTLinking/RCTLinking.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/React-RCTNetwork/RCTNetwork.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/React-RCTSettings/RCTSettings.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/React-RCTText/RCTText.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/React-RCTVibration/RCTVibration.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/React-cxxreact/cxxreact.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/React-jsi/jsi.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/React-jsiexecutor/jsireact.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/React-jsinspector/jsinspector.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/ReactCommon/ReactCommon.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/ReactNativeART/ReactNativeART.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/ReactNativeDarkMode/ReactNativeDarkMode.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/ReactNativeKeyboardInput/ReactNativeKeyboardInput.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/ReactNativeKeyboardTrackingView/ReactNativeKeyboardTrackingView.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/SDWebImageWebPCoder/SDWebImageWebPCoder.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/SPTPersistentCache/SPTPersistentCache.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/Yoga/yoga.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/glog/glog.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/libwebp/libwebp.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/lottie-ios/Lottie.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/lottie-react-native/lottie_react_native.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/react-native-background-upload/react_native_background_upload.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/react-native-camera/react_native_camera.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/react-native-cameraroll/react_native_cameraroll.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/react-native-image-resizer/react_native_image_resizer.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/react-native-in-app-message/react_native_in_app_message.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/react-native-mov-to-mp4/react_native_mov_to_mp4.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/react-native-netinfo/react_native_netinfo.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/react-native-notifications/react_native_notifications.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/react-native-onepassword/react_native_onepassword.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/react-native-orientation-locker/react_native_orientation_locker.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/react-native-splash-screen/react_native_splash_screen.framework\",\n+ );\n+ name = \"[CP] Embed Pods Frameworks\";\n+ outputPaths = (\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OnePasswordExtension.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DVAssetLoaderDelegate.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DoubleConversion.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBReactNativeSpec.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/folly.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTTypeSafety.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNCAsyncStorage.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNExitApp.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNFS.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNFastImage.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNGestureHandler.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNKeychain.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNReanimated.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNScreens.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNVectorIcons.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/React.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CoreModules.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTActionSheet.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTAnimation.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTBlob.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTImage.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTLinking.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTNetwork.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTSettings.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTText.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTVibration.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/cxxreact.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/jsi.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/jsireact.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/jsinspector.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ReactCommon.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ReactNativeART.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ReactNativeDarkMode.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ReactNativeKeyboardInput.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ReactNativeKeyboardTrackingView.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImageWebPCoder.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SPTPersistentCache.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/yoga.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/glog.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libwebp.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Lottie.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/lottie_react_native.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_background_upload.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_camera.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_cameraroll.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_image_resizer.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_in_app_message.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_mov_to_mp4.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_netinfo.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_notifications.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_onepassword.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_orientation_locker.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_splash_screen.framework\",\n+ );\n+ runOnlyForDeploymentPostprocessing = 0;\n+ shellPath = /bin/sh;\n+ shellScript = \"\\\"${PODS_ROOT}/Target Support Files/Pods-SquadCal/Pods-SquadCal-frameworks.sh\\\"\\n\";\n+ showEnvVarsInLog = 0;\n+ };\n/* End PBXShellScriptBuildPhase section */\n/* Begin PBXSourcesBuildPhase section */\nbuildActionMask = 2147483647;\nfiles = (\n13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,\n- 7F8FB0942333063D007EF826 /* File.swift in Sources */,\n13B07FC11A68108700A75B9A /* main.m in Sources */,\n);\nrunOnlyForDeploymentPostprocessing = 0;\nisa = XCBuildConfiguration;\nbaseConfigurationReference = 8C0A50BD3E650F9A49DACD73 /* Pods-SquadCal.debug.xcconfig */;\nbuildSettings = {\n+ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;\nASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\nCLANG_ENABLE_MODULES = YES;\nCODE_SIGN_ENTITLEMENTS = SquadCal/SquadCal.entitlements;\n);\nPRODUCT_BUNDLE_IDENTIFIER = org.squadcal.app;\nPRODUCT_NAME = SquadCal;\n- SWIFT_OBJC_BRIDGING_HEADER = \"SquadCal-Bridging-Header.h\";\n- SWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n- SWIFT_VERSION = 5.0;\nTARGETED_DEVICE_FAMILY = 1;\nVERSIONING_SYSTEM = \"apple-generic\";\n};\nisa = XCBuildConfiguration;\nbaseConfigurationReference = 7EE5A7681B39319D3AF09109 /* Pods-SquadCal.release.xcconfig */;\nbuildSettings = {\n+ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;\nASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n- CLANG_ENABLE_MODULES = YES;\nCODE_SIGN_ENTITLEMENTS = SquadCal/SquadCal.entitlements;\n\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\nCURRENT_PROJECT_VERSION = 1;\n);\nPRODUCT_BUNDLE_IDENTIFIER = org.squadcal.app;\nPRODUCT_NAME = SquadCal;\n- SWIFT_OBJC_BRIDGING_HEADER = \"SquadCal-Bridging-Header.h\";\n- SWIFT_VERSION = 5.0;\nTARGETED_DEVICE_FAMILY = 1;\nVERSIONING_SYSTEM = \"apple-generic\";\n};\nALWAYS_SEARCH_USER_PATHS = NO;\nCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\nCLANG_CXX_LIBRARY = \"libc++\";\n- CLANG_ENABLE_MODULES = YES;\nCLANG_ENABLE_OBJC_ARC = YES;\nCLANG_WARN_BOOL_CONVERSION = YES;\nCLANG_WARN_CONSTANT_CONVERSION = YES;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] RN0.61 upgrade: use_frameworks in Podfile See 54b3a62cab58156aff5a099f4ae711ccfd1a26df for more context
129,187
10.04.2020 00:04:14
14,400
6af93f6f10f9c56be375078764a93ec43b5f262d
[native] RN0.61 upgrade: set up react-native-vector-icons for use_frameworks
[ { "change_type": "MODIFY", "old_path": "native/root.react.js", "new_path": "native/root.react.js", "diff": "@@ -52,6 +52,7 @@ import { RootContext, type RootContextType } from './root-context';\nimport NavigationHandler from './navigation/navigation-handler.react';\nimport { defaultNavigationState } from './navigation/default-state';\nimport InputStateContainer from './input/input-state-container.react';\n+import './themes/fonts';\nif (Platform.OS === 'android') {\nUIManager.setLayoutAnimationEnabledExperimental &&\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/themes/fonts.js", "diff": "+// @flow\n+\n+import FeatherIcon from 'react-native-vector-icons/Feather';\n+import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';\n+import IonIcon from 'react-native-vector-icons/Ionicons';\n+import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons';\n+import MaterialIcon from 'react-native-vector-icons/MaterialIcons';\n+\n+FeatherIcon.loadFont();\n+FontAwesomeIcon.loadFont();\n+IonIcon.loadFont();\n+MaterialCommunityIcon.loadFont();\n+MaterialIcon.loadFont();\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] RN0.61 upgrade: set up react-native-vector-icons for use_frameworks
129,187
10.04.2020 00:08:55
14,400
eada262a6db3354171e1f046c02aed0ee9d0dc6a
[native] codeVersion -> 46 Build to test RN0.61
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -131,8 +131,8 @@ android {\napplicationId \"org.squadcal\"\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 45\n- versionName \"0.0.45\"\n+ versionCode 46\n+ versionName \"0.0.46\"\nmissingDimensionStrategy 'react-native-camera', 'general'\nmultiDexEnabled true\n}\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal/Info.debug.plist", "new_path": "native/ios/SquadCal/Info.debug.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.45</string>\n+ <string>0.0.46</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>45</string>\n+ <string>46</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal/Info.release.plist", "new_path": "native/ios/SquadCal/Info.release.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.45</string>\n+ <string>0.0.46</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>45</string>\n+ <string>46</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/redux/persist.js", "new_path": "native/redux/persist.js", "diff": "@@ -178,7 +178,7 @@ const persistConfig = {\ntimeout: __DEV__ ? 0 : undefined,\n};\n-const codeVersion = 45;\n+const codeVersion = 46;\n// This local exists to avoid a circular dependency where redux-setup needs to\n// import all the navigation and screen stuff, but some of those screens want to\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] codeVersion -> 46 Build to test RN0.61
129,187
10.04.2020 01:16:22
14,400
f10564d2e1286e35ff2c9ecc9a07285f395e01e2
[native] codeVersion -> 47 Last build had a major regression, this is the real one to test RN0.61
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -131,8 +131,8 @@ android {\napplicationId \"org.squadcal\"\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 46\n- versionName \"0.0.46\"\n+ versionCode 47\n+ versionName \"0.0.47\"\nmissingDimensionStrategy 'react-native-camera', 'general'\nmultiDexEnabled true\n}\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal/Info.debug.plist", "new_path": "native/ios/SquadCal/Info.debug.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.46</string>\n+ <string>0.0.47</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>46</string>\n+ <string>47</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal/Info.release.plist", "new_path": "native/ios/SquadCal/Info.release.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.46</string>\n+ <string>0.0.47</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>46</string>\n+ <string>47</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/redux/persist.js", "new_path": "native/redux/persist.js", "diff": "@@ -178,7 +178,7 @@ const persistConfig = {\ntimeout: __DEV__ ? 0 : undefined,\n};\n-const codeVersion = 46;\n+const codeVersion = 47;\n// This local exists to avoid a circular dependency where redux-setup needs to\n// import all the navigation and screen stuff, but some of those screens want to\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] codeVersion -> 47 Last build had a major regression, this is the real one to test RN0.61
129,187
10.04.2020 14:42:41
14,400
7bda5df87920149fd78a1ba6a4b68d11ff6e05d3
Clean up react-native-background-upload patch
[ { "change_type": "MODIFY", "old_path": "patches/react-native-background-upload+5.6.0.patch", "new_path": "patches/react-native-background-upload+5.6.0.patch", "diff": "-diff --git a/node_modules/react-native-background-upload/android/.build.gradle.swp b/node_modules/react-native-background-upload/android/.build.gradle.swp\n-new file mode 100644\n-index 0000000..64c3944\n-Binary files /dev/null and b/node_modules/react-native-background-upload/android/.build.gradle.swp differ\ndiff --git a/node_modules/react-native-background-upload/android/build.gradle b/node_modules/react-native-background-upload/android/build.gradle\nindex 9262df3..ba3e21c 100755\n--- a/node_modules/react-native-background-upload/android/build.gradle\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Clean up react-native-background-upload patch
129,187
10.04.2020 18:17:19
14,400
b44b915ddda1f5d40b8cf71605cde745d7d29121
[native] Get rid of extra viewProps to Message components
[ { "change_type": "MODIFY", "old_path": "native/chat/composed-message.react.js", "new_path": "native/chat/composed-message.react.js", "diff": "@@ -27,7 +27,6 @@ type Props = {|\n// Redux state\ncomposedMessageMaxWidth: number,\ncolors: Colors,\n- ...React.ElementProps<typeof View>,\n|};\nclass ComposedMessage extends React.PureComponent<Props> {\nstatic propTypes = {\n@@ -41,7 +40,14 @@ class ComposedMessage extends React.PureComponent<Props> {\nrender() {\nassertComposableMessageType(this.props.item.messageInfo.type);\n- const { item, focused, sendFailed, children, colors, composedMessageMaxWidth, ...viewProps } = this.props;\n+ const {\n+ item,\n+ focused,\n+ sendFailed,\n+ children,\n+ colors,\n+ composedMessageMaxWidth,\n+ } = this.props;\nconst { id, creator } = item.messageInfo;\nconst { isViewer } = creator;\n@@ -79,7 +85,7 @@ class ComposedMessage extends React.PureComponent<Props> {\n}\nreturn (\n- <View {...viewProps}>\n+ <View>\n<MessageHeader item={item} focused={focused} display=\"lowContrast\" />\n<View style={containerStyle}>\n<View style={[styles.content, alignStyle]}>\n" }, { "change_type": "MODIFY", "old_path": "native/chat/multimedia-message.react.js", "new_path": "native/chat/multimedia-message.react.js", "diff": "@@ -129,7 +129,6 @@ type Props = {|\nverticalBounds: ?VerticalBounds,\n// withOverlayPositionContext\noverlayPosition: ?Animated.Value,\n- ...React.ElementProps<typeof View>,\n|};\nclass MultimediaMessage extends React.PureComponent<Props> {\nstatic propTypes = {\n@@ -142,22 +141,13 @@ class MultimediaMessage extends React.PureComponent<Props> {\n};\nrender() {\n- const {\n- item,\n- navigation,\n- focused,\n- toggleFocus,\n- verticalBounds,\n- overlayPosition,\n- ...viewProps\n- } = this.props;\n+ const { item, focused } = this.props;\nconst heightStyle = { height: item.contentHeight };\nreturn (\n<ComposedMessage\nitem={item}\nsendFailed={sendFailed(item)}\nfocused={focused}\n- {...viewProps}\n>\n<View style={[heightStyle, styles.container]}>\n{this.renderContent()}\n" }, { "change_type": "MODIFY", "old_path": "native/chat/robotext-message.react.js", "new_path": "native/chat/robotext-message.react.js", "diff": "@@ -55,7 +55,6 @@ type Props = {|\nkeyboardState: ?KeyboardState,\n// Redux state\nstyles: typeof styles,\n- ...React.ElementProps<typeof View>,\n|};\nclass RobotextMessage extends React.PureComponent<Props> {\nstatic propTypes = {\n@@ -67,14 +66,7 @@ class RobotextMessage extends React.PureComponent<Props> {\n};\nrender() {\n- const {\n- item,\n- focused,\n- toggleFocus,\n- keyboardState,\n- styles,\n- ...viewProps\n- } = this.props;\n+ const { item, focused } = this.props;\nlet timestamp = null;\nif (focused || item.startsConversation) {\ntimestamp = (\n@@ -82,7 +74,7 @@ class RobotextMessage extends React.PureComponent<Props> {\n);\n}\nreturn (\n- <View {...viewProps}>\n+ <View>\n{timestamp}\n<TouchableWithoutFeedback onPress={this.onPress}>\n{this.linkedRobotext()}\n" }, { "change_type": "MODIFY", "old_path": "native/chat/text-message.react.js", "new_path": "native/chat/text-message.react.js", "diff": "@@ -77,7 +77,6 @@ type Props = {|\noverlayableScrollViewState: ?OverlayableScrollViewState,\n// withKeyboardState\nkeyboardState: ?KeyboardState,\n- ...React.ElementProps<typeof View>,\n|};\nclass TextMessage extends React.PureComponent<Props> {\nstatic propTypes = {\n@@ -92,22 +91,12 @@ class TextMessage extends React.PureComponent<Props> {\nmessage: ?View;\nrender() {\n- const {\n- item,\n- navigation,\n- focused,\n- toggleFocus,\n- verticalBounds,\n- overlayableScrollViewState,\n- keyboardState,\n- ...viewProps\n- } = this.props;\n+ const { item, focused } = this.props;\nreturn (\n<ComposedMessage\nitem={item}\nsendFailed={textMessageSendFailed(item)}\nfocused={focused}\n- {...viewProps}\n>\n<InnerTextMessage\nitem={item}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Get rid of extra viewProps to Message components
129,187
10.04.2020 18:53:16
14,400
9a46bf07588722a9e23dc43fdaf89f71577935f2
[native] Get rid of RoundedMessageContainer It was needlessly increasing native draw stack depth and styles could be inlined
[ { "change_type": "MODIFY", "old_path": "native/chat/inner-text-message.react.js", "new_path": "native/chat/inner-text-message.react.js", "diff": "@@ -14,7 +14,11 @@ import { colorIsDark } from 'lib/shared/thread-utils';\nimport { onlyEmojiRegex } from 'lib/shared/emojis';\nimport { connect } from 'lib/utils/redux-utils';\n-import { RoundedMessageContainer } from './rounded-message-container.react';\n+import {\n+ allCorners,\n+ filterCorners,\n+ getRoundedContainerStyle,\n+} from './rounded-corners';\nimport {\ntype Colors,\ncolorsPropType,\n@@ -65,16 +69,19 @@ class InnerTextMessage extends React.PureComponent<Props> {\n? styles.emojiOnlyText\n: styles.text;\n+ const cornerStyle = getRoundedContainerStyle(\n+ filterCorners(allCorners, item),\n+ );\n+\nconst message = (\n<TouchableOpacity\nonPress={this.props.onPress}\nonLongPress={this.props.onPress}\nactiveOpacity={0.6}\n>\n- <RoundedMessageContainer item={item}>\n<Hyperlink\nlinkDefault={true}\n- style={[styles.message, messageStyle]}\n+ style={[styles.message, messageStyle, cornerStyle]}\nlinkStyle={linkStyle}\n>\n<Text\n@@ -85,7 +92,6 @@ class InnerTextMessage extends React.PureComponent<Props> {\n{text}\n</Text>\n</Hyperlink>\n- </RoundedMessageContainer>\n</TouchableOpacity>\n);\n@@ -118,6 +124,7 @@ const styles = StyleSheet.create({\ntextDecorationLine: 'underline',\n},\nmessage: {\n+ overflow: 'hidden',\npaddingHorizontal: 12,\npaddingVertical: 6,\n},\n" }, { "change_type": "MODIFY", "old_path": "native/chat/multimedia-message.react.js", "new_path": "native/chat/multimedia-message.react.js", "diff": "@@ -31,7 +31,7 @@ import {\nallCorners,\nfilterCorners,\ngetRoundedContainerStyle,\n-} from './rounded-message-container.react';\n+} from './rounded-corners';\nimport { authorNameHeight } from './message-header.react';\nimport { failedSendHeight } from './failed-send.react';\nimport sendFailed from './multimedia-message-send-failed';\n" }, { "change_type": "MODIFY", "old_path": "native/chat/multimedia-tooltip-button.react.js", "new_path": "native/chat/multimedia-tooltip-button.react.js", "diff": "@@ -35,7 +35,7 @@ import {\n} from '../input/input-state';\nimport InlineMultimedia from './inline-multimedia.react';\nimport { multimediaMessageBorderRadius } from './multimedia-message.react';\n-import { getRoundedContainerStyle } from './rounded-message-container.react';\n+import { getRoundedContainerStyle } from './rounded-corners';\nimport { MessageHeader } from './message-header.react';\nimport { dimensionsSelector } from '../selectors/dimension-selectors';\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/chat/rounded-corners.js", "diff": "+// @flow\n+\n+import type { ChatMessageInfoItemWithHeight } from './message.react';\n+import type { Corners } from 'lib/types/media-types';\n+\n+function filterCorners(corners: Corners, item: ChatMessageInfoItemWithHeight) {\n+ const { startsCluster, endsCluster } = item;\n+ const { isViewer } = item.messageInfo.creator;\n+ const { topLeft, topRight, bottomLeft, bottomRight } = corners;\n+ return {\n+ topLeft: topLeft && (isViewer || startsCluster),\n+ topRight: topRight && (!isViewer || startsCluster),\n+ bottomLeft: bottomLeft && (isViewer || endsCluster),\n+ bottomRight: bottomRight && (!isViewer || endsCluster),\n+ };\n+}\n+\n+const allCorners = {\n+ topLeft: true,\n+ topRight: true,\n+ bottomLeft: true,\n+ bottomRight: true,\n+};\n+\n+function getRoundedContainerStyle(corners: Corners, borderRadius?: number = 8) {\n+ const { topLeft, topRight, bottomLeft, bottomRight } = corners;\n+ return {\n+ borderTopLeftRadius: topLeft ? borderRadius : 0,\n+ borderTopRightRadius: topRight ? borderRadius : 0,\n+ borderBottomLeftRadius: bottomLeft ? borderRadius : 0,\n+ borderBottomRightRadius: bottomRight ? borderRadius : 0,\n+ };\n+}\n+\n+export { allCorners, filterCorners, getRoundedContainerStyle };\n" }, { "change_type": "DELETE", "old_path": "native/chat/rounded-message-container.react.js", "new_path": null, "diff": "-// @flow\n-\n-import type { ChatMessageInfoItemWithHeight } from './message.react';\n-import { chatMessageItemPropType } from 'lib/selectors/chat-selectors';\n-import type { ViewStyle } from '../types/styles';\n-import type { Corners } from 'lib/types/media-types';\n-import type { AppState } from '../redux/redux-setup';\n-\n-import * as React from 'react';\n-import PropTypes from 'prop-types';\n-import { View, ViewPropTypes } from 'react-native';\n-\n-import { connect } from 'lib/utils/redux-utils';\n-\n-import { styleSelector } from '../themes/colors';\n-\n-function filterCorners(corners: Corners, item: ChatMessageInfoItemWithHeight) {\n- const { startsCluster, endsCluster } = item;\n- const { isViewer } = item.messageInfo.creator;\n- const { topLeft, topRight, bottomLeft, bottomRight } = corners;\n- return {\n- topLeft: topLeft && (isViewer || startsCluster),\n- topRight: topRight && (!isViewer || startsCluster),\n- bottomLeft: bottomLeft && (isViewer || endsCluster),\n- bottomRight: bottomRight && (!isViewer || endsCluster),\n- };\n-}\n-\n-const allCorners = {\n- topLeft: true,\n- topRight: true,\n- bottomLeft: true,\n- bottomRight: true,\n-};\n-function getRoundedContainerStyle(corners: Corners, borderRadius?: number = 8) {\n- const { topLeft, topRight, bottomLeft, bottomRight } = corners;\n- return {\n- borderTopLeftRadius: topLeft ? borderRadius : 0,\n- borderTopRightRadius: topRight ? borderRadius : 0,\n- borderBottomLeftRadius: bottomLeft ? borderRadius : 0,\n- borderBottomRightRadius: bottomRight ? borderRadius : 0,\n- };\n-}\n-\n-type Props = {|\n- item: ChatMessageInfoItemWithHeight,\n- borderRadius: number,\n- style?: ViewStyle,\n- children: React.Node,\n- // Redux state\n- styles: typeof styles,\n-|};\n-class RoundedMessageContainer extends React.PureComponent<Props> {\n- static propTypes = {\n- item: chatMessageItemPropType.isRequired,\n- borderRadius: PropTypes.number.isRequired,\n- style: ViewPropTypes.style,\n- children: PropTypes.node.isRequired,\n- styles: PropTypes.objectOf(PropTypes.object).isRequired,\n- };\n- static defaultProps = {\n- borderRadius: 8,\n- };\n-\n- render() {\n- const { item, borderRadius, style } = this.props;\n- const cornerStyle = getRoundedContainerStyle(\n- filterCorners(allCorners, item),\n- borderRadius,\n- );\n- return (\n- <View style={[this.props.styles.message, cornerStyle, style]}>\n- {this.props.children}\n- </View>\n- );\n- }\n-}\n-\n-const styles = {\n- message: {\n- backgroundColor: 'listBackground',\n- overflow: 'hidden',\n- },\n-};\n-const stylesSelector = styleSelector(styles);\n-\n-const WrappedRoundedMessageContainer = connect((state: AppState) => ({\n- styles: stylesSelector(state),\n-}))(RoundedMessageContainer);\n-\n-export {\n- allCorners,\n- filterCorners,\n- getRoundedContainerStyle,\n- WrappedRoundedMessageContainer as RoundedMessageContainer,\n-};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Get rid of RoundedMessageContainer It was needlessly increasing native draw stack depth and styles could be inlined
129,187
07.04.2020 15:41:18
14,400
bc204dd0221fa6e649e87dc44626e4c715722d9f
[native] react-native-unimodules
[ { "change_type": "MODIFY", "old_path": "native/.gitignore", "new_path": "native/.gitignore", "diff": "@@ -51,3 +51,6 @@ yarn-error.log\n# CocoaPods\n/ios/Pods/\n+\n+# unimodules\n+**/generated/BasePackageList.java\n" }, { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -175,6 +175,8 @@ android {\n}\n}\n+apply from: '../../../node_modules/react-native-unimodules/gradle.groovy'\n+\ndependencies {\nimplementation \"com.google.android.gms:play-services-base:16.1.0\"\nimplementation \"com.google.firebase:firebase-core:16.0.9\"\n@@ -192,6 +194,8 @@ dependencies {\n} else {\nimplementation jscFlavor\n}\n+\n+ addUnimodulesDependencies([ modulesPaths: [ '../../../node_modules' ] ])\n}\n// Run this once to be able to run the application with BUCK\n" }, { "change_type": "MODIFY", "old_path": "native/android/app/src/main/java/org/squadcal/MainApplication.java", "new_path": "native/android/app/src/main/java/org/squadcal/MainApplication.java", "diff": "package org.squadcal;\n+import org.squadcal.generated.BasePackageList;\n+\nimport androidx.multidex.MultiDexApplication;\nimport android.content.Context;\n+import org.unimodules.adapters.react.ModuleRegistryAdapter;\n+import org.unimodules.adapters.react.ReactModuleRegistryProvider;\n+import org.unimodules.core.interfaces.SingletonModule;\n+\nimport com.facebook.react.PackageList;\nimport com.facebook.hermes.reactexecutor.HermesExecutorFactory;\nimport com.facebook.react.bridge.JavaScriptExecutorFactory;\n@@ -20,6 +26,7 @@ import java.util.List;\nimport java.lang.reflect.InvocationTargetException;\npublic class MainApplication extends MultiDexApplication implements ReactApplication {\n+ private final ReactModuleRegistryProvider mModuleRegistryProvider = new ReactModuleRegistryProvider(new BasePackageList().getPackageList(), null);\nprivate final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {\n@Override\n@@ -33,6 +40,12 @@ public class MainApplication extends MultiDexApplication implements ReactApplica\npackages.add(new RNFirebaseMessagingPackage());\npackages.add(new RNFirebaseNotificationsPackage());\npackages.add(new KeyboardInputPackage(this.getApplication()));\n+\n+ // Add unimodules\n+ List<ReactPackage> unimodules = Arrays.<ReactPackage>asList(\n+ new ModuleRegistryAdapter(mModuleRegistryProvider)\n+ );\n+ packages.addAll(unimodules);\nreturn packages;\n}\n" }, { "change_type": "MODIFY", "old_path": "native/android/settings.gradle", "new_path": "native/android/settings.gradle", "diff": "+apply from: '../../node_modules/react-native-unimodules/gradle.groovy'\n+includeUnimodulesProjects([ modulesPaths: [ '../../../node_modules' ] ])\n+\nrootProject.name = 'SquadCal'\napply from: file(\"../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle\");\napplyNativeModulesSettingsGradle(settings)\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Podfile", "new_path": "native/ios/Podfile", "diff": "platform :ios, '9.3'\nrequire_relative '../../node_modules/@react-native-community/cli-platform-ios/native_modules'\n+require_relative '../../node_modules/react-native-unimodules/cocoapods.rb'\ntarget 'SquadCal' do\n# Pods for SquadCal\n@@ -44,4 +45,5 @@ target 'SquadCal' do\nuse_native_modules!\nuse_frameworks!\n+ use_unimodules!(modules_paths: ['../..'])\nend\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -3,6 +3,19 @@ PODS:\n- boost-for-react-native (1.63.0)\n- DoubleConversion (1.1.6)\n- DVAssetLoaderDelegate (0.3.3)\n+ - EXConstants (9.0.0):\n+ - UMConstantsInterface\n+ - UMCore\n+ - EXFileSystem (8.1.0):\n+ - UMCore\n+ - UMFileSystemInterface\n+ - EXImageLoader (1.0.1):\n+ - React-Core\n+ - UMCore\n+ - UMImageLoaderInterface\n+ - EXPermissions (8.1.0):\n+ - UMCore\n+ - UMPermissionsInterface\n- FBLazyVector (0.61.5)\n- FBReactNativeSpec (0.61.5):\n- Folly (= 2018.10.22.00)\n@@ -307,11 +320,32 @@ PODS:\n- libwebp (~> 1.0)\n- SDWebImage/Core (~> 5.0)\n- SPTPersistentCache (1.1.0)\n+ - UMAppLoader (1.0.1)\n+ - UMBarCodeScannerInterface (5.1.0)\n+ - UMCameraInterface (5.1.0)\n+ - UMConstantsInterface (5.1.0)\n+ - UMCore (5.1.0)\n+ - UMFaceDetectorInterface (5.1.0)\n+ - UMFileSystemInterface (5.1.0)\n+ - UMFontInterface (5.1.0)\n+ - UMImageLoaderInterface (5.1.0)\n+ - UMPermissionsInterface (5.1.0):\n+ - UMCore\n+ - UMReactNativeAdapter (5.2.0):\n+ - React-Core\n+ - UMCore\n+ - UMFontInterface\n+ - UMSensorsInterface (5.1.0)\n+ - UMTaskManagerInterface (5.1.0)\n- Yoga (1.14.0)\nDEPENDENCIES:\n- 1PasswordExtension (from `https://github.com/agilebits/onepassword-app-extension.git`, commit `ba96cf1203f6ea749b7c3f4e921b15d577536253`)\n- DoubleConversion (from `../../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)\n+ - EXConstants (from `../../node_modules/expo-constants/ios`)\n+ - EXFileSystem (from `../../node_modules/expo-file-system/ios`)\n+ - EXImageLoader (from `../../node_modules/expo-image-loader/ios`)\n+ - EXPermissions (from `../../node_modules/expo-permissions/ios`)\n- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)\n- FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`)\n- Folly (from `../../node_modules/react-native/third-party-podspecs/Folly.podspec`)\n@@ -366,6 +400,19 @@ DEPENDENCIES:\n- RNReanimated (from `../../node_modules/react-native-reanimated`)\n- RNScreens (from `../../node_modules/react-native-screens`)\n- RNVectorIcons (from `../../node_modules/react-native-vector-icons`)\n+ - UMAppLoader (from `../../node_modules/unimodules-app-loader/ios`)\n+ - UMBarCodeScannerInterface (from `../../node_modules/unimodules-barcode-scanner-interface/ios`)\n+ - UMCameraInterface (from `../../node_modules/unimodules-camera-interface/ios`)\n+ - UMConstantsInterface (from `../../node_modules/unimodules-constants-interface/ios`)\n+ - \"UMCore (from `../../node_modules/@unimodules/core/ios`)\"\n+ - UMFaceDetectorInterface (from `../../node_modules/unimodules-face-detector-interface/ios`)\n+ - UMFileSystemInterface (from `../../node_modules/unimodules-file-system-interface/ios`)\n+ - UMFontInterface (from `../../node_modules/unimodules-font-interface/ios`)\n+ - UMImageLoaderInterface (from `../../node_modules/unimodules-image-loader-interface/ios`)\n+ - UMPermissionsInterface (from `../../node_modules/unimodules-permissions-interface/ios`)\n+ - \"UMReactNativeAdapter (from `../../node_modules/@unimodules/react-native-adapter/ios`)\"\n+ - UMSensorsInterface (from `../../node_modules/unimodules-sensors-interface/ios`)\n+ - UMTaskManagerInterface (from `../../node_modules/unimodules-task-manager-interface/ios`)\n- Yoga (from `../../node_modules/react-native/ReactCommon/yoga`)\nSPEC REPOS:\n@@ -384,6 +431,14 @@ EXTERNAL SOURCES:\n:git: https://github.com/agilebits/onepassword-app-extension.git\nDoubleConversion:\n:podspec: \"../../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec\"\n+ EXConstants:\n+ :path: \"../../node_modules/expo-constants/ios\"\n+ EXFileSystem:\n+ :path: \"../../node_modules/expo-file-system/ios\"\n+ EXImageLoader:\n+ :path: \"../../node_modules/expo-image-loader/ios\"\n+ EXPermissions:\n+ :path: \"../../node_modules/expo-permissions/ios\"\nFBLazyVector:\n:path: \"../node_modules/react-native/Libraries/FBLazyVector\"\nFBReactNativeSpec:\n@@ -486,6 +541,32 @@ EXTERNAL SOURCES:\n:path: \"../../node_modules/react-native-screens\"\nRNVectorIcons:\n:path: \"../../node_modules/react-native-vector-icons\"\n+ UMAppLoader:\n+ :path: \"../../node_modules/unimodules-app-loader/ios\"\n+ UMBarCodeScannerInterface:\n+ :path: \"../../node_modules/unimodules-barcode-scanner-interface/ios\"\n+ UMCameraInterface:\n+ :path: \"../../node_modules/unimodules-camera-interface/ios\"\n+ UMConstantsInterface:\n+ :path: \"../../node_modules/unimodules-constants-interface/ios\"\n+ UMCore:\n+ :path: \"../../node_modules/@unimodules/core/ios\"\n+ UMFaceDetectorInterface:\n+ :path: \"../../node_modules/unimodules-face-detector-interface/ios\"\n+ UMFileSystemInterface:\n+ :path: \"../../node_modules/unimodules-file-system-interface/ios\"\n+ UMFontInterface:\n+ :path: \"../../node_modules/unimodules-font-interface/ios\"\n+ UMImageLoaderInterface:\n+ :path: \"../../node_modules/unimodules-image-loader-interface/ios\"\n+ UMPermissionsInterface:\n+ :path: \"../../node_modules/unimodules-permissions-interface/ios\"\n+ UMReactNativeAdapter:\n+ :path: \"../../node_modules/@unimodules/react-native-adapter/ios\"\n+ UMSensorsInterface:\n+ :path: \"../../node_modules/unimodules-sensors-interface/ios\"\n+ UMTaskManagerInterface:\n+ :path: \"../../node_modules/unimodules-task-manager-interface/ios\"\nYoga:\n:path: \"../../node_modules/react-native/ReactCommon/yoga\"\n@@ -499,6 +580,10 @@ SPEC CHECKSUMS:\nboost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c\nDoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2\nDVAssetLoaderDelegate: 0caec20e4e08b8560b691131539e9180024d4bce\n+ EXConstants: 5304709b1bea70a4828f48ba4c7fc3ec3b2d9b17\n+ EXFileSystem: cf4232ba7c62dc49b78c2d36005f97b6fddf0b01\n+ EXImageLoader: 5ad6896fa1ef2ee814b551873cbf7a7baccc694a\n+ EXPermissions: 24b97f734ce9172d245a5be38ad9ccfcb6135964\nFBLazyVector: aaeaf388755e4f29cd74acbc9e3b8da6d807c37f\nFBReactNativeSpec: 118d0d177724c2d67f08a59136eb29ef5943ec75\nFolly: 30e7936e1c45c08d884aa59369ed951a8e68cf51\n@@ -555,8 +640,21 @@ SPEC CHECKSUMS:\nSDWebImage: 4d5c027c935438f341ed33dbac53ff9f479922ca\nSDWebImageWebPCoder: 947093edd1349d820c40afbd9f42acb6cdecd987\nSPTPersistentCache: df36ea46762d7cf026502bbb86a8b79d0080dff4\n+ UMAppLoader: 90273a65f9b1d789214e0c913dfcabc7a1b1590e\n+ UMBarCodeScannerInterface: 9dc692b87e5f20fe277fa57aa47f45d418c3cc6c\n+ UMCameraInterface: 625878bbf2ba188a8548675e1d1d2e438a653e6d\n+ UMConstantsInterface: 64060cf86587bcd90b1dbd804cceb6d377a308c1\n+ UMCore: d6117852f32c74cde466b863cfdeaa0960186249\n+ UMFaceDetectorInterface: d6677d6ddc9ab95a0ca857aa7f8ba76656cc770f\n+ UMFileSystemInterface: c70ea7147198b9807080f3597f26236be49b0165\n+ UMFontInterface: d9d3b27af698c5389ae9e20b99ef56a083f491fb\n+ UMImageLoaderInterface: 14dd2c46c67167491effc9e91250e9510f12709e\n+ UMPermissionsInterface: 5e83a9167c177e4a0f0a3539345983cc749efb3e\n+ UMReactNativeAdapter: 126da3486c1a1f11945b649d557d6c2ebb9407b2\n+ UMSensorsInterface: 48941f70175e2975af1a9386c6d6cb16d8126805\n+ UMTaskManagerInterface: cb890c79c63885504ddc0efd7a7d01481760aca2\nYoga: f2a7cd4280bfe2cca5a7aed98ba0eb3d1310f18b\n-PODFILE CHECKSUM: b6b307b3920b2176fb8ff1b70deb2771cb0f1cef\n+PODFILE CHECKSUM: cf021c38da91cadc7175ec6114a1ca99fe5d1d1e\nCOCOAPODS: 1.9.1\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal.xcodeproj/project.pbxproj", "new_path": "native/ios/SquadCal.xcodeproj/project.pbxproj", "diff": "\"${BUILT_PRODUCTS_DIR}/1PasswordExtension/OnePasswordExtension.framework\",\n\"${BUILT_PRODUCTS_DIR}/DVAssetLoaderDelegate/DVAssetLoaderDelegate.framework\",\n\"${BUILT_PRODUCTS_DIR}/DoubleConversion/DoubleConversion.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/EXConstants/EXConstants.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/EXFileSystem/EXFileSystem.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/EXImageLoader/EXImageLoader.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/EXPermissions/EXPermissions.framework\",\n\"${BUILT_PRODUCTS_DIR}/FBReactNativeSpec/FBReactNativeSpec.framework\",\n\"${BUILT_PRODUCTS_DIR}/Folly/folly.framework\",\n\"${BUILT_PRODUCTS_DIR}/RCTTypeSafety/RCTTypeSafety.framework\",\n\"${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework\",\n\"${BUILT_PRODUCTS_DIR}/SDWebImageWebPCoder/SDWebImageWebPCoder.framework\",\n\"${BUILT_PRODUCTS_DIR}/SPTPersistentCache/SPTPersistentCache.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/UMAppLoader/UMAppLoader.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/UMCore/UMCore.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/UMPermissionsInterface/UMPermissionsInterface.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/UMReactNativeAdapter/UMReactNativeAdapter.framework\",\n\"${BUILT_PRODUCTS_DIR}/Yoga/yoga.framework\",\n\"${BUILT_PRODUCTS_DIR}/glog/glog.framework\",\n\"${BUILT_PRODUCTS_DIR}/libwebp/libwebp.framework\",\n\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OnePasswordExtension.framework\",\n\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DVAssetLoaderDelegate.framework\",\n\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DoubleConversion.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/EXConstants.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/EXFileSystem.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/EXImageLoader.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/EXPermissions.framework\",\n\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBReactNativeSpec.framework\",\n\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/folly.framework\",\n\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTTypeSafety.framework\",\n\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework\",\n\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImageWebPCoder.framework\",\n\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SPTPersistentCache.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/UMAppLoader.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/UMCore.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/UMPermissionsInterface.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/UMReactNativeAdapter.framework\",\n\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/yoga.framework\",\n\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/glog.framework\",\n\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libwebp.framework\",\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal/AppDelegate.h", "new_path": "native/ios/SquadCal/AppDelegate.h", "diff": "#import <React/RCTBridgeDelegate.h>\n#import <UIKit/UIKit.h>\n+#import <UMReactNativeAdapter/UMModuleRegistryAdapter.h>\n@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>\n+@property (nonatomic, strong) UMModuleRegistryAdapter *moduleRegistryAdapter;\n@property (nonatomic, strong) UIWindow *window;\n@end\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal/AppDelegate.m", "new_path": "native/ios/SquadCal/AppDelegate.m", "diff": "#import \"RNSplashScreen.h\"\n#import \"Orientation.h\"\n+#import <UMCore/UMModuleRegistry.h>\n+#import <UMReactNativeAdapter/UMNativeModulesProxy.h>\n+#import <UMReactNativeAdapter/UMModuleRegistryAdapter.h>\n+\n@implementation AppDelegate\n- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n{\n+ self.moduleRegistryAdapter = [[UMModuleRegistryAdapter alloc] initWithModuleRegistryProvider:[[UMModuleRegistryProvider alloc] init]];\nRCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];\nRCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge\nmoduleName:@\"SquadCal\"\nreturn YES;\n}\n+- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge\n+{\n+ NSArray<id<RCTBridgeModule>> *extraModules = [_moduleRegistryAdapter extraModulesForBridge:bridge];\n+ // You can inject any extra modules that you would like here, more information at:\n+ // https://facebook.github.io/react-native/docs/native-modules-ios.html#dependency-injection\n+ return extraModules;\n+}\n+\n- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity\nrestorationHandler:(void (^)(NSArray * _Nullable))restorationHandler\n{\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"react-native-reanimated\": \"^1.3.0\",\n\"react-native-screens\": \"1.0.0-alpha.17\",\n\"react-native-splash-screen\": \"^3.2.0\",\n+ \"react-native-unimodules\": \"^0.9.0\",\n\"react-native-vector-icons\": \"^6.6.0\",\n\"react-native-video\": \"^5.0.2\",\n\"react-navigation\": \"^4.0.6\",\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "semver \"^6.3.0\"\ntsutils \"^3.17.1\"\n+\"@unimodules/core@~5.1.0\":\n+ version \"5.1.0\"\n+ resolved \"https://registry.yarnpkg.com/@unimodules/core/-/core-5.1.0.tgz#eae3706e1ecc99d4b992ad39970c43d92418d394\"\n+ integrity sha512-gaamGkJ4PVwusWEfsZyPo4uhrVWPDE0BmHc/lTYfkZCv2oIAswC7gG/ULRdtZpYdwnYqFIZng+WQxwuVrJUNDw==\n+ dependencies:\n+ compare-versions \"^3.4.0\"\n+\n+\"@unimodules/react-native-adapter@~5.2.0\":\n+ version \"5.2.0\"\n+ resolved \"https://registry.yarnpkg.com/@unimodules/react-native-adapter/-/react-native-adapter-5.2.0.tgz#96bfd4cfbad5083b3aa1152ee0a4ac84fa9dfb69\"\n+ integrity sha512-S3HMEeQbV6xs7ORRcxXFGMk38DAnxqNcZG9T8JkX/KGY9ILUUqTS/e68+d849B6beEeglNMcOxyjwlqjykN+FA==\n+ dependencies:\n+ invariant \"^2.2.4\"\n+ lodash \"^4.5.0\"\n+ prop-types \"^15.6.1\"\n+\n\"@webassemblyjs/ast@1.8.5\":\nversion \"1.8.5\"\nresolved \"https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.8.5.tgz#51b1c5fe6576a34953bf4b253df9f0d490d9e359\"\n@@ -3316,6 +3332,11 @@ bluebird@~3.4.1:\nresolved \"https://registry.yarnpkg.com/bluebird/-/bluebird-3.4.7.tgz#f72d760be09b7f76d08ed8fae98b289a8d05fab3\"\nintegrity sha1-9y12C+Cbf3bQjtj66Ysomo0F+rM=\n+blueimp-md5@^2.10.0:\n+ version \"2.13.0\"\n+ resolved \"https://registry.yarnpkg.com/blueimp-md5/-/blueimp-md5-2.13.0.tgz#07314b0c64dda0bf1733f96ce40d5af94eb28965\"\n+ integrity sha512-lmp0m647R5e77ORduxLW5mISIDcvgJZa52vMBv5uVI3UmSWTQjkJsZVBfaFqQPw/QFogJwvY6e3Gl9nP+Loe+Q==\n+\nbn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0:\nversion \"4.11.8\"\nresolved \"https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f\"\n@@ -3519,6 +3540,19 @@ btoa-lite@^1.0.0:\nresolved \"https://registry.yarnpkg.com/btoa-lite/-/btoa-lite-1.0.0.tgz#337766da15801210fdd956c22e9c6891ab9d0337\"\nintegrity sha1-M3dm2hWAEhD92VbCLpxokaudAzc=\n+buffer-alloc-unsafe@^1.1.0:\n+ version \"1.1.0\"\n+ resolved \"https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0\"\n+ integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==\n+\n+buffer-alloc@^1.1.0:\n+ version \"1.2.0\"\n+ resolved \"https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec\"\n+ integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==\n+ dependencies:\n+ buffer-alloc-unsafe \"^1.1.0\"\n+ buffer-fill \"^1.0.0\"\n+\nbuffer-crc32@^0.2.13, buffer-crc32@~0.2.3:\nversion \"0.2.13\"\nresolved \"https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242\"\n@@ -3529,6 +3563,11 @@ buffer-equal-constant-time@1.0.1:\nresolved \"https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819\"\nintegrity sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=\n+buffer-fill@^1.0.0:\n+ version \"1.0.0\"\n+ resolved \"https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c\"\n+ integrity sha1-+PeLdniYiO858gXNY39o5wISKyw=\n+\nbuffer-from@^1.0.0:\nversion \"1.1.1\"\nresolved \"https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef\"\n@@ -4117,7 +4156,7 @@ commondir@^1.0.1:\nresolved \"https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b\"\nintegrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=\n-compare-versions@^3.5.1:\n+compare-versions@^3.4.0, compare-versions@^3.5.1:\nversion \"3.6.0\"\nresolved \"https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.6.0.tgz#1a5689913685e5a87637b8d3ffca75514ec41d62\"\nintegrity sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==\n@@ -5694,6 +5733,39 @@ expect@^24.9.0:\njest-message-util \"^24.9.0\"\njest-regex-util \"^24.9.0\"\n+expo-asset@~8.1.0:\n+ version \"8.1.4\"\n+ resolved \"https://registry.yarnpkg.com/expo-asset/-/expo-asset-8.1.4.tgz#5265c28c1c279b2f9779269195bec4caf250ba5d\"\n+ integrity sha512-6YqW22F5issD1rgqBCja8TCA2dr+yf/89FdYs/jhQYpw5OJAnAvfpK3GL8h3jRCu1TvxZqhH5NeLG6f2b3oUqg==\n+ dependencies:\n+ blueimp-md5 \"^2.10.0\"\n+ invariant \"^2.2.4\"\n+ md5-file \"^3.2.3\"\n+ path-browserify \"^1.0.0\"\n+ url-parse \"^1.4.4\"\n+\n+expo-constants@~9.0.0:\n+ version \"9.0.0\"\n+ resolved \"https://registry.yarnpkg.com/expo-constants/-/expo-constants-9.0.0.tgz#35c600079ee91d38fe4f56375caae6e90f122fdd\"\n+ integrity sha512-1kqZMM8Ez5JT3sTEx8I69fP6NYFLOJjeM6Z63dD/m2NiwvzSADiO5+BhghnWNGN1L3bxbgOjXS6EHtS7CdSfxA==\n+\n+expo-file-system@~8.1.0:\n+ version \"8.1.0\"\n+ resolved \"https://registry.yarnpkg.com/expo-file-system/-/expo-file-system-8.1.0.tgz#d6aa66fa32c19982b94d0013f963c5ee972dfd6d\"\n+ integrity sha512-xb4roeU8CotW8t3LkmsrliNbgFpY2KB+3sW1NnujnH39pFVwCd/kfujCYzRauj8aUy/HhSq+3xGkQTpC7pSjVw==\n+ dependencies:\n+ uuid \"^3.4.0\"\n+\n+expo-image-loader@~1.0.0:\n+ version \"1.0.1\"\n+ resolved \"https://registry.yarnpkg.com/expo-image-loader/-/expo-image-loader-1.0.1.tgz#a83e336768df4dfcb8909aebb6d8152e256d7a72\"\n+ integrity sha512-v7ziP+UGj+LArEmP//XTaqi9iFWRa8LAShNoFwwnpPS9huM8q3I+P16xK+GTo+4bQa1pPSIFBUZ8KqwAc+k8mQ==\n+\n+expo-permissions@~8.1.0:\n+ version \"8.1.0\"\n+ resolved \"https://registry.yarnpkg.com/expo-permissions/-/expo-permissions-8.1.0.tgz#a7f2ee91ba76ce3a467e7b10adaa9ca5201b226f\"\n+ integrity sha512-QBHD+1J9+sGFnhoEGzMRchPweeEE0OJ9ehG/0l1BMRBA7qsLS9vRC1FTJ55NwjI0Kr4RTha9r6ZX1kZHT09f/w==\n+\nexpress-ws@^4.0.0:\nversion \"4.0.0\"\nresolved \"https://registry.yarnpkg.com/express-ws/-/express-ws-4.0.0.tgz#dabd8dc974516418902a41fe6e30ed949b4d36c4\"\n@@ -8748,7 +8820,7 @@ lodash.uniq@^4.5.0:\nresolved \"https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773\"\nintegrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=\n-lodash@4.17.15, lodash@^4.0.0, lodash@^4.0.1, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.3.0:\n+lodash@4.17.15, lodash@^4.0.0, lodash@^4.0.1, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.3.0, lodash@^4.5.0:\nversion \"4.17.15\"\nresolved \"https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548\"\nintegrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==\n@@ -8922,6 +8994,13 @@ material-colors@^1.2.1:\nresolved \"https://registry.yarnpkg.com/material-colors/-/material-colors-1.2.6.tgz#6d1958871126992ceecc72f4bcc4d8f010865f46\"\nintegrity sha512-6qE4B9deFBIa9YSpOc9O0Sgc43zTeVYbgDT5veRKSlB2+ZuHNoVVxA1L/ckMUayV9Ay9y7Z/SZCLcGteW9i7bg==\n+md5-file@^3.2.3:\n+ version \"3.2.3\"\n+ resolved \"https://registry.yarnpkg.com/md5-file/-/md5-file-3.2.3.tgz#f9bceb941eca2214a4c0727f5e700314e770f06f\"\n+ integrity sha512-3Tkp1piAHaworfcCgH0jKbTvj1jWWFgbvh2cXaNCgHwyTCBxxvD1Y04rmfpvdPm1P4oXMOpm6+2H7sr7v9v8Fw==\n+ dependencies:\n+ buffer-alloc \"^1.1.0\"\n+\nmd5.js@^1.3.4:\nversion \"1.3.5\"\nresolved \"https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f\"\n@@ -10500,6 +10579,11 @@ path-browserify@0.0.1:\nresolved \"https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.1.tgz#e6c4ddd7ed3aa27c68a20cc4e50e1a4ee83bbc4a\"\nintegrity sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==\n+path-browserify@^1.0.0:\n+ version \"1.0.1\"\n+ resolved \"https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd\"\n+ integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==\n+\npath-dirname@^1.0.0:\nversion \"1.0.2\"\nresolved \"https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0\"\n@@ -11656,6 +11740,31 @@ react-native-tab-view@^2.9.0:\nresolved \"https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-2.10.0.tgz#5e249e5650502010013449ffd4e5edc18a95364b\"\nintegrity sha512-qgexVz5eO4yaFjdkmn/sURXgVvaBo6pZD/q1eoca96SbPVbaH3WzVhF3bRUfeTHwZkXwznFTpS3JURqIFU8vQA==\n+react-native-unimodules@^0.9.0:\n+ version \"0.9.0\"\n+ resolved \"https://registry.yarnpkg.com/react-native-unimodules/-/react-native-unimodules-0.9.0.tgz#5ce642ac50d124b9d41c09ff7cb397e22f1110ea\"\n+ integrity sha512-zcdNo74d/x19d0JkNiKL+4d71OaivumgfKVdmOYPOGRMOlct6KL3177TvkxgmF7ddlJJIlfftSFtnPuiOfejQA==\n+ dependencies:\n+ \"@unimodules/core\" \"~5.1.0\"\n+ \"@unimodules/react-native-adapter\" \"~5.2.0\"\n+ chalk \"^2.4.2\"\n+ expo-asset \"~8.1.0\"\n+ expo-constants \"~9.0.0\"\n+ expo-file-system \"~8.1.0\"\n+ expo-image-loader \"~1.0.0\"\n+ expo-permissions \"~8.1.0\"\n+ unimodules-app-loader \"~1.0.0\"\n+ unimodules-barcode-scanner-interface \"~5.1.0\"\n+ unimodules-camera-interface \"~5.1.0\"\n+ unimodules-constants-interface \"~5.1.0\"\n+ unimodules-face-detector-interface \"~5.1.0\"\n+ unimodules-file-system-interface \"~5.1.0\"\n+ unimodules-font-interface \"~5.1.0\"\n+ unimodules-image-loader-interface \"~5.1.0\"\n+ unimodules-permissions-interface \"~5.1.0\"\n+ unimodules-sensors-interface \"~5.1.0\"\n+ unimodules-task-manager-interface \"~5.1.0\"\n+\nreact-native-vector-icons@^6.6.0:\nversion \"6.6.0\"\nresolved \"https://registry.yarnpkg.com/react-native-vector-icons/-/react-native-vector-icons-6.6.0.tgz#66cf004918eb05d90778d64bd42077c1800d481b\"\n@@ -13902,6 +14011,61 @@ unicode-property-aliases-ecmascript@^1.0.4:\nresolved \"https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz#a9cc6cc7ce63a0a3023fc99e341b94431d405a57\"\nintegrity sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw==\n+unimodules-app-loader@~1.0.0:\n+ version \"1.0.1\"\n+ resolved \"https://registry.yarnpkg.com/unimodules-app-loader/-/unimodules-app-loader-1.0.1.tgz#4358195cfa4d6026c71c7365362acf047f252bb0\"\n+ integrity sha512-GhPwdTp9WHRMRnM2ONQsHb0mciKU5tafohEX0+E4F7bSba89r+rJckWQnpDvHE7uyUaRtocLYcbk09vv2eg8ew==\n+\n+unimodules-barcode-scanner-interface@~5.1.0:\n+ version \"5.1.0\"\n+ resolved \"https://registry.yarnpkg.com/unimodules-barcode-scanner-interface/-/unimodules-barcode-scanner-interface-5.1.0.tgz#6d24322b6db556b21eca99a130673c7e07d86559\"\n+ integrity sha512-FUau0mm4sBOGmlekltY0iAimJ438w3rtWiv6hcjE77Map527aCH3GyjnZSw78raVxe598EXhWHviuwRxOGINYg==\n+\n+unimodules-camera-interface@~5.1.0:\n+ version \"5.1.0\"\n+ resolved \"https://registry.yarnpkg.com/unimodules-camera-interface/-/unimodules-camera-interface-5.1.0.tgz#ea43a8d05b7b1a9053e6b2281b428a1e80853661\"\n+ integrity sha512-uwBmZ3XS6vkdzRAmiDhUE/P7fafN7ufXoRuBDGoX/Q9kIiKg61D8HzTmhLMelvJFW6eCjoBJfh/zRyZ54qcjGg==\n+\n+unimodules-constants-interface@~5.1.0:\n+ version \"5.1.0\"\n+ resolved \"https://registry.yarnpkg.com/unimodules-constants-interface/-/unimodules-constants-interface-5.1.0.tgz#916a8203a887b53cdbcd80b63bc6fd56c85ccfd2\"\n+ integrity sha512-TlrqwtKt2G0QH4Fn1ko3tRtLX+eUGSnCBuu1TiAGlsQ5FM/1+AGuJNftHdUwZY1DncIAlw6lhNW+amv0hw5ocg==\n+\n+unimodules-face-detector-interface@~5.1.0:\n+ version \"5.1.0\"\n+ resolved \"https://registry.yarnpkg.com/unimodules-face-detector-interface/-/unimodules-face-detector-interface-5.1.0.tgz#56b4e8c238d8b38f7937f2eb87212d5f87c463f9\"\n+ integrity sha512-0qDA6j1WvPM98q32aKvRdFhgSa9Nu8lqNUlrgE740UTYsAmfQl8lM/r2TOuR1k3dVC14q33YvLizSOYM5FLhAw==\n+\n+unimodules-file-system-interface@~5.1.0:\n+ version \"5.1.0\"\n+ resolved \"https://registry.yarnpkg.com/unimodules-file-system-interface/-/unimodules-file-system-interface-5.1.0.tgz#adcba6d6dbb58d889175425dedcbb1501f498ab7\"\n+ integrity sha512-G2QXhEXY3uHuDD50MWI7C/nesbVlf2C0QHTs+fAt1VpmWYWfdDaeqgO67f/QRz8FH8xm3ul9XvgP6nA+P0xfIg==\n+\n+unimodules-font-interface@~5.1.0:\n+ version \"5.1.0\"\n+ resolved \"https://registry.yarnpkg.com/unimodules-font-interface/-/unimodules-font-interface-5.1.0.tgz#953c1eb6e1f221f0c7d427d7aba78cce599b4b27\"\n+ integrity sha512-ZKycNecNN0xxGIo9Db2n8RYU+ijlc+hzpE5acVSiIlmMjTsiOODRLkF++yKsZxglGXn/blgtBLrcTQr4jJV4MQ==\n+\n+unimodules-image-loader-interface@~5.1.0:\n+ version \"5.1.0\"\n+ resolved \"https://registry.yarnpkg.com/unimodules-image-loader-interface/-/unimodules-image-loader-interface-5.1.0.tgz#40eeecb1d9409b51595b559023230ce50485b626\"\n+ integrity sha512-yU1OPWMtZ9QcW5CxLE1DYWrpJGZ1hRGdoFG3vyk4syUS8QsCPR0HXqcI6KlTpI6wcLA0+HtS+1CmgJCMCUDd4w==\n+\n+unimodules-permissions-interface@~5.1.0:\n+ version \"5.1.0\"\n+ resolved \"https://registry.yarnpkg.com/unimodules-permissions-interface/-/unimodules-permissions-interface-5.1.0.tgz#146062ee5cde1f00f34ba2692efab5f0c6f55d02\"\n+ integrity sha512-3Mz9A4a+iYF57ZeE99nidRPNM7dX3dzTZRvRQyCP5+CvsEmGNlLTIbTQ7fxKECoe3I6cjw94gNSirxIbwb3lDg==\n+\n+unimodules-sensors-interface@~5.1.0:\n+ version \"5.1.0\"\n+ resolved \"https://registry.yarnpkg.com/unimodules-sensors-interface/-/unimodules-sensors-interface-5.1.0.tgz#2d8f5f15a8b00b3f0aab59c3ff474f39735d634f\"\n+ integrity sha512-v8nRFRHtl4jFI1aiAmWurPKDuvboSxj0qoqpy/IB3xkkzBfw4KsZQ1b1yomwNbv9cCqIkFxaNAOzyrvVZrz/dA==\n+\n+unimodules-task-manager-interface@~5.1.0:\n+ version \"5.1.0\"\n+ resolved \"https://registry.yarnpkg.com/unimodules-task-manager-interface/-/unimodules-task-manager-interface-5.1.0.tgz#49fe4431464faa576ba3453a1824030debbf8d35\"\n+ integrity sha512-t7FSWOdw4ev9SlqPzfw9rOKlFyryZbrcmjEr0n6HtPXqZ4NRfPqXtYSjoVWswGb3iGr3GPOIHZ/OQ6Z6StL1NA==\n+\nunion-value@^1.0.0:\nversion \"1.0.1\"\nresolved \"https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847\"\n@@ -14056,7 +14220,7 @@ url-parse-lax@^3.0.0:\ndependencies:\nprepend-http \"^2.0.0\"\n-url-parse@^1.4.3:\n+url-parse@^1.4.3, url-parse@^1.4.4:\nversion \"1.4.7\"\nresolved \"https://registry.yarnpkg.com/url-parse/-/url-parse-1.4.7.tgz#a8a83535e8c00a316e403a5db4ac1b9b853ae278\"\nintegrity sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==\n@@ -14154,6 +14318,11 @@ uuid@^3.0.1, uuid@^3.3.2, uuid@^3.3.3:\nresolved \"https://registry.yarnpkg.com/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866\"\nintegrity sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==\n+uuid@^3.4.0:\n+ version \"3.4.0\"\n+ resolved \"https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee\"\n+ integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==\n+\nv8-compile-cache@2.0.3:\nversion \"2.0.3\"\nresolved \"https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.0.3.tgz#00f7494d2ae2b688cfe2899df6ed2c54bef91dbe\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] react-native-unimodules
129,187
07.04.2020 16:29:24
14,400
054b413fec49781d613958d6f53d51f986ca896c
[native] expo-media-library
[ { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -13,6 +13,10 @@ PODS:\n- React-Core\n- UMCore\n- UMImageLoaderInterface\n+ - EXMediaLibrary (8.1.0):\n+ - UMCore\n+ - UMFileSystemInterface\n+ - UMPermissionsInterface\n- EXPermissions (8.1.0):\n- UMCore\n- UMPermissionsInterface\n@@ -345,6 +349,7 @@ DEPENDENCIES:\n- EXConstants (from `../../node_modules/expo-constants/ios`)\n- EXFileSystem (from `../../node_modules/expo-file-system/ios`)\n- EXImageLoader (from `../../node_modules/expo-image-loader/ios`)\n+ - EXMediaLibrary (from `../../node_modules/expo-media-library/ios`)\n- EXPermissions (from `../../node_modules/expo-permissions/ios`)\n- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)\n- FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`)\n@@ -437,6 +442,8 @@ EXTERNAL SOURCES:\n:path: \"../../node_modules/expo-file-system/ios\"\nEXImageLoader:\n:path: \"../../node_modules/expo-image-loader/ios\"\n+ EXMediaLibrary:\n+ :path: \"../../node_modules/expo-media-library/ios\"\nEXPermissions:\n:path: \"../../node_modules/expo-permissions/ios\"\nFBLazyVector:\n@@ -583,6 +590,7 @@ SPEC CHECKSUMS:\nEXConstants: 5304709b1bea70a4828f48ba4c7fc3ec3b2d9b17\nEXFileSystem: cf4232ba7c62dc49b78c2d36005f97b6fddf0b01\nEXImageLoader: 5ad6896fa1ef2ee814b551873cbf7a7baccc694a\n+ EXMediaLibrary: 02a13521d05ca381b08f7d745a9602569eade072\nEXPermissions: 24b97f734ce9172d245a5be38ad9ccfcb6135964\nFBLazyVector: aaeaf388755e4f29cd74acbc9e3b8da6d807c37f\nFBReactNativeSpec: 118d0d177724c2d67f08a59136eb29ef5943ec75\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal.xcodeproj/project.pbxproj", "new_path": "native/ios/SquadCal.xcodeproj/project.pbxproj", "diff": "\"${BUILT_PRODUCTS_DIR}/EXConstants/EXConstants.framework\",\n\"${BUILT_PRODUCTS_DIR}/EXFileSystem/EXFileSystem.framework\",\n\"${BUILT_PRODUCTS_DIR}/EXImageLoader/EXImageLoader.framework\",\n+ \"${BUILT_PRODUCTS_DIR}/EXMediaLibrary/EXMediaLibrary.framework\",\n\"${BUILT_PRODUCTS_DIR}/EXPermissions/EXPermissions.framework\",\n\"${BUILT_PRODUCTS_DIR}/FBReactNativeSpec/FBReactNativeSpec.framework\",\n\"${BUILT_PRODUCTS_DIR}/Folly/folly.framework\",\n\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/EXConstants.framework\",\n\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/EXFileSystem.framework\",\n\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/EXImageLoader.framework\",\n+ \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/EXMediaLibrary.framework\",\n\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/EXPermissions.framework\",\n\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBReactNativeSpec.framework\",\n\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/folly.framework\",\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"@react-native-community/cameraroll\": \"^1.5.2\",\n\"@react-native-community/netinfo\": \"^4.4.0\",\n\"base-64\": \"^0.1.0\",\n+ \"expo-media-library\": \"^8.1.0\",\n\"find-root\": \"^1.1.0\",\n\"hoist-non-react-statics\": \"^3.1.0\",\n\"invariant\": \"^2.2.4\",\n" }, { "change_type": "ADD", "old_path": null, "new_path": "patches/expo-media-library+8.1.0.patch", "diff": "+diff --git a/node_modules/expo-media-library/ios/EXMediaLibrary.podspec b/node_modules/expo-media-library/ios/EXMediaLibrary.podspec\n+index 7cc9e70..a5b5336 100644\n+--- a/node_modules/expo-media-library/ios/EXMediaLibrary.podspec\n++++ b/node_modules/expo-media-library/ios/EXMediaLibrary.podspec\n+@@ -18,4 +18,5 @@ Pod::Spec.new do |s|\n+\n+ s.dependency 'UMCore'\n+ s.dependency 'UMPermissionsInterface'\n++ s.dependency 'UMFileSystemInterface'\n+ end\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "@@ -5761,6 +5761,11 @@ expo-image-loader@~1.0.0:\nresolved \"https://registry.yarnpkg.com/expo-image-loader/-/expo-image-loader-1.0.1.tgz#a83e336768df4dfcb8909aebb6d8152e256d7a72\"\nintegrity sha512-v7ziP+UGj+LArEmP//XTaqi9iFWRa8LAShNoFwwnpPS9huM8q3I+P16xK+GTo+4bQa1pPSIFBUZ8KqwAc+k8mQ==\n+expo-media-library@^8.1.0:\n+ version \"8.1.0\"\n+ resolved \"https://registry.yarnpkg.com/expo-media-library/-/expo-media-library-8.1.0.tgz#f5d4b24819aa518e69d971f92b55c12f60c85ba5\"\n+ integrity sha512-2oO6UtV4akgX9o5Ok9BRwLh5NZzDk43QBW5RP/EHVSzuVn2yn7IXstmr9wnTl1BpqkPoV8u6w3g9EeU1I2Jljw==\n+\nexpo-permissions@~8.1.0:\nversion \"8.1.0\"\nresolved \"https://registry.yarnpkg.com/expo-permissions/-/expo-permissions-8.1.0.tgz#a7f2ee91ba76ce3a467e7b10adaa9ca5201b226f\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] expo-media-library
129,187
12.04.2020 18:57:13
14,400
e48542bda08479f1273164ef338ce1749e741bd9
[native] Patch expo-media-library on Android Fix orientation detection and don't require write permissions when browsing medial library
[ { "change_type": "MODIFY", "old_path": "patches/expo-media-library+8.1.0.patch", "new_path": "patches/expo-media-library+8.1.0.patch", "diff": "+diff --git a/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/GetAssets.java b/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/GetAssets.java\n+index fa7b518..6ff3f08 100644\n+--- a/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/GetAssets.java\n++++ b/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/GetAssets.java\n+@@ -1,6 +1,7 @@\n+ package expo.modules.medialibrary;\n+\n+ import android.content.Context;\n++import android.content.ContentResolver;\n+ import android.database.Cursor;\n+ import android.os.AsyncTask;\n+ import android.os.Bundle;\n+@@ -37,7 +38,8 @@ class GetAssets extends AsyncTask<Void, Void, Void> {\n+ final String order = getQueryInfo.getOrder();\n+ final int limit = getQueryInfo.getLimit();\n+ final int offset = getQueryInfo.getOffset();\n+- try (Cursor assets = mContext.getContentResolver().query(\n++ ContentResolver contentResolver = mContext.getContentResolver();\n++ try (Cursor assets = contentResolver.query(\n+ EXTERNAL_CONTENT,\n+ ASSET_PROJECTION,\n+ selection,\n+@@ -47,7 +49,7 @@ class GetAssets extends AsyncTask<Void, Void, Void> {\n+ mPromise.reject(ERROR_UNABLE_TO_LOAD, \"Could not get assets. Query returns null.\");\n+ } else {\n+ ArrayList<Bundle> assetsInfo = new ArrayList<>();\n+- putAssetsInfo(assets, assetsInfo, limit, offset, false);\n++ putAssetsInfo(contentResolver, assets, assetsInfo, limit, offset, false);\n+ response.putParcelableArrayList(\"assets\", assetsInfo);\n+ response.putBoolean(\"hasNextPage\", !assets.isAfterLast());\n+ response.putString(\"endCursor\", Integer.toString(assets.getPosition()));\n+diff --git a/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/MediaLibraryConstants.java b/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/MediaLibraryConstants.java\n+index 5e3eeaf..35d459c 100644\n+--- a/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/MediaLibraryConstants.java\n++++ b/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/MediaLibraryConstants.java\n+@@ -56,8 +56,8 @@ final class MediaLibraryConstants {\n+ put(SORT_BY_CREATION_TIME, MediaStore.Images.Media.DATE_TAKEN);\n+ put(SORT_BY_MODIFICATION_TIME, MediaStore.Images.Media.DATE_MODIFIED);\n+ put(SORT_BY_MEDIA_TYPE, MediaStore.Files.FileColumns.MEDIA_TYPE);\n+- put(SORT_BY_WIDTH, MediaStore.Images.Media.WIDTH);\n+- put(SORT_BY_HEIGHT, MediaStore.Images.Media.HEIGHT);\n++ put(SORT_BY_WIDTH, MediaStore.MediaColumns.WIDTH);\n++ put(SORT_BY_HEIGHT, MediaStore.MediaColumns.HEIGHT);\n+ put(SORT_BY_DURATION, MediaStore.Video.VideoColumns.DURATION);\n+ }\n+ };\n+@@ -70,8 +70,8 @@ final class MediaLibraryConstants {\n+ MediaStore.Files.FileColumns.DISPLAY_NAME,\n+ MediaStore.Images.Media.DATA,\n+ MediaStore.Files.FileColumns.MEDIA_TYPE,\n+- MediaStore.Images.Media.WIDTH,\n+- MediaStore.Images.Media.HEIGHT,\n++ MediaStore.MediaColumns.WIDTH,\n++ MediaStore.MediaColumns.HEIGHT,\n+ MediaStore.Images.Media.DATE_TAKEN,\n+ MediaStore.Images.Media.DATE_MODIFIED,\n+ MediaStore.Images.Media.LATITUDE,\n+diff --git a/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/MediaLibraryModule.java b/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/MediaLibraryModule.java\n+index bfe25f3..edde485 100644\n+--- a/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/MediaLibraryModule.java\n++++ b/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/MediaLibraryModule.java\n+@@ -164,7 +164,7 @@ public class MediaLibraryModule extends ExportedModule {\n+\n+ @ExpoMethod\n+ public void getAssetInfoAsync(String assetId, Promise promise) {\n+- if (isMissingPermissions()) {\n++ if (isMissingReadPermissions()) {\n+ promise.reject(ERROR_NO_PERMISSIONS, ERROR_NO_PERMISSIONS_MESSAGE);\n+ return;\n+ }\n+@@ -221,7 +221,7 @@ public class MediaLibraryModule extends ExportedModule {\n+\n+ @ExpoMethod\n+ public void getAssetsAsync(Map<String, Object> assetOptions, Promise promise) {\n+- if (isMissingPermissions()) {\n++ if (isMissingReadPermissions()) {\n+ promise.reject(ERROR_NO_PERMISSIONS, ERROR_NO_PERMISSIONS_MESSAGE);\n+ return;\n+ }\n+@@ -285,6 +285,15 @@ public class MediaLibraryModule extends ExportedModule {\n+ return !permissionsManager.hasGrantedPermissions(READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE);\n+ }\n+\n++ private boolean isMissingReadPermissions() {\n++ Permissions permissionsManager = mModuleRegistry.getModule(Permissions.class);\n++ if (permissionsManager == null) {\n++ return false;\n++ }\n++\n++ return !permissionsManager.hasGrantedPermissions(READ_EXTERNAL_STORAGE);\n++ }\n++\n+ private boolean isMissingWritePermission() {\n+ Permissions permissionsManager = mModuleRegistry.getModule(Permissions.class);\n+ if (permissionsManager == null) {\n+diff --git a/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/MediaLibraryUtils.java b/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/MediaLibraryUtils.java\n+index da5bd28..a881ed3 100644\n+--- a/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/MediaLibraryUtils.java\n++++ b/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/MediaLibraryUtils.java\n+@@ -1,14 +1,18 @@\n+ package expo.modules.medialibrary;\n+\n+ import android.content.Context;\n++import android.content.ContentResolver;\n++import android.content.res.AssetFileDescriptor;\n+ import android.database.Cursor;\n+ import android.graphics.BitmapFactory;\n+ import android.os.Bundle;\n++import android.media.MediaMetadataRetriever;\n+ import android.provider.MediaStore;\n+ import android.provider.MediaStore.Files;\n+ import android.provider.MediaStore.Images.Media;\n+ import androidx.exifinterface.media.ExifInterface;\n+ import android.text.TextUtils;\n++import android.net.Uri;\n+\n+ import java.io.File;\n+ import java.io.FileInputStream;\n+@@ -96,7 +100,8 @@ final class MediaLibraryUtils {\n+ }\n+\n+ static void queryAssetInfo(Context context, final String selection, final String[] selectionArgs, boolean fullInfo, Promise promise) {\n+- try (Cursor asset = context.getContentResolver().query(\n++ ContentResolver contentResolver = context.getContentResolver();\n++ try (Cursor asset = contentResolver.query(\n+ EXTERNAL_CONTENT,\n+ ASSET_PROJECTION,\n+ selection,\n+@@ -109,7 +114,7 @@ final class MediaLibraryUtils {\n+ if (asset.getCount() == 1) {\n+ asset.moveToFirst();\n+ ArrayList<Bundle> array = new ArrayList<>();\n+- putAssetsInfo(asset, array, 1, 0, fullInfo);\n++ putAssetsInfo(contentResolver, asset, array, 1, 0, fullInfo);\n+ // actually we want to return just the first item, but array.getMap returns ReadableMap\n+ // which is not compatible with promise.resolve and there is no simple solution to convert\n+ // ReadableMap to WritableMap so it's easier to return an array and pick the first item on JS side\n+@@ -126,7 +131,7 @@ final class MediaLibraryUtils {\n+ }\n+ }\n+\n+- static void putAssetsInfo(Cursor cursor, ArrayList<Bundle> response, int limit, int offset, boolean fullInfo) throws IOException {\n++ static void putAssetsInfo(ContentResolver contentResolver, Cursor cursor, ArrayList<Bundle> response, int limit, int offset, boolean fullInfo) throws IOException {\n+ final int idIndex = cursor.getColumnIndex(Media._ID);\n+ final int filenameIndex = cursor.getColumnIndex(Media.DISPLAY_NAME);\n+ final int mediaTypeIndex = cursor.getColumnIndex(Files.FileColumns.MEDIA_TYPE);\n+@@ -144,7 +149,7 @@ final class MediaLibraryUtils {\n+ for (int i = 0; i < limit && !cursor.isAfterLast(); i++) {\n+ String localUri = \"file://\" + cursor.getString(localUriIndex);\n+ int mediaType = cursor.getInt(mediaTypeIndex);\n+- int[] size = getSizeFromCursor(cursor, mediaType, localUriIndex);\n++ int[] size = getSizeFromCursor(contentResolver, cursor, mediaType, localUriIndex);\n+\n+ Bundle asset = new Bundle();\n+ asset.putString(\"id\", cursor.getString(idIndex));\n+@@ -213,25 +218,68 @@ final class MediaLibraryUtils {\n+ return MEDIA_TYPES.get(mediaType);\n+ }\n+\n+- static int[] getSizeFromCursor(Cursor cursor, int mediaType, int localUriIndex){\n++ static int[] getSizeFromCursor(ContentResolver contentResolver, Cursor cursor, int mediaType, int localUriIndex) {\n++ final String uri = cursor.getString(localUriIndex);\n++\n++ if (mediaType == Files.FileColumns.MEDIA_TYPE_VIDEO) {\n++ Uri photoUri = Uri.parse(\"file://\" + uri);\n++ try {\n++ AssetFileDescriptor photoDescriptor = contentResolver.openAssetFileDescriptor(photoUri, \"r\");\n++ MediaMetadataRetriever retriever = new MediaMetadataRetriever();\n++ try {\n++ retriever.setDataSource(photoDescriptor.getFileDescriptor());\n++ int videoWidth = Integer.parseInt(\n++ retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH)\n++ );\n++ int videoHeight = Integer.parseInt(\n++ retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT)\n++ );\n++ int videoOrientation = Integer.parseInt(\n++ retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_ROTATION)\n++ );\n++ return maybeRotateAssetSize(videoWidth, videoHeight, videoOrientation);\n++ } catch (NumberFormatException e) {\n++ } finally {\n++ retriever.release();\n++ photoDescriptor.close();\n++ }\n++ } catch (Exception e) {\n++ }\n++ }\n++\n++ final int widthIndex = cursor.getColumnIndex(MediaStore.MediaColumns.WIDTH);\n++ final int heightIndex = cursor.getColumnIndex(MediaStore.MediaColumns.HEIGHT);\n+ final int orientationIndex = cursor.getColumnIndex(Media.ORIENTATION);\n+- final int widthIndex = cursor.getColumnIndex(Media.WIDTH);\n+- final int heightIndex = cursor.getColumnIndex(Media.HEIGHT);\n+-\n+- int[] size;\n+- // If image doesn't have the required information, we can get them from Bitmap.Options\n+- if ((cursor.getType(widthIndex) == Cursor.FIELD_TYPE_NULL ||\n+- cursor.getType(heightIndex) == Cursor.FIELD_TYPE_NULL) &&\n+- mediaType == Files.FileColumns.MEDIA_TYPE_IMAGE) {\n++ int width = cursor.getInt(widthIndex);\n++ int height = cursor.getInt(heightIndex);\n++ int orientation = cursor.getInt(orientationIndex);\n++\n++ if (width <= 0 || height <= 0) {\n+ BitmapFactory.Options options = new BitmapFactory.Options();\n+ options.inJustDecodeBounds = true;\n++ BitmapFactory.decodeFile(uri, options);\n++ width = options.outWidth;\n++ height = options.outHeight;\n++ }\n+\n+- BitmapFactory.decodeFile(cursor.getString(localUriIndex), options);\n+- size = maybeRotateAssetSize(options.outWidth, options.outHeight, cursor.getInt(orientationIndex));\n+- } else {\n+- size = maybeRotateAssetSize(cursor.getInt(widthIndex), cursor.getInt(heightIndex), cursor.getInt(orientationIndex));\n++ try {\n++ ExifInterface exif = new ExifInterface(uri);\n++ int exifOrientation = exif.getAttributeInt(\n++ ExifInterface.TAG_ORIENTATION,\n++ ExifInterface.ORIENTATION_NORMAL\n++ );\n++ if (\n++ exifOrientation == ExifInterface.ORIENTATION_ROTATE_90 ||\n++ exifOrientation == ExifInterface.ORIENTATION_ROTATE_270 ||\n++ exifOrientation == ExifInterface.ORIENTATION_TRANSPOSE ||\n++ exifOrientation == ExifInterface.ORIENTATION_TRANSVERSE\n++ ) {\n++ orientation = 90;\n++ }\n++ } catch (IOException e) {\n+ }\n+- return size;\n++\n++ return maybeRotateAssetSize(width, height, orientation);\n+ }\n+\n+ static int[] maybeRotateAssetSize(int width, int height, int orientation) {\ndiff --git a/node_modules/expo-media-library/ios/EXMediaLibrary.podspec b/node_modules/expo-media-library/ios/EXMediaLibrary.podspec\nindex 7cc9e70..a5b5336 100644\n--- a/node_modules/expo-media-library/ios/EXMediaLibrary.podspec\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Patch expo-media-library on Android Fix orientation detection and don't require write permissions when browsing medial library
129,187
12.04.2020 18:57:54
14,400
f506ccfda2f4dd5467a8bc4388e3e2edc307107a
[native] Use expo-media-library instead of in MediaGalleryKeyboard
[ { "change_type": "MODIFY", "old_path": "native/media/media-gallery-keyboard.react.js", "new_path": "native/media/media-gallery-keyboard.react.js", "diff": "@@ -21,15 +21,11 @@ import {\nimport { KeyboardRegistry } from 'react-native-keyboard-input';\nimport invariant from 'invariant';\nimport { Provider } from 'react-redux';\n-// eslint-disable-next-line import/default\n-import CameraRoll from '@react-native-community/cameraroll';\nimport PropTypes from 'prop-types';\n+import * as MediaLibrary from 'expo-media-library';\nimport { connect } from 'lib/utils/redux-utils';\n-import {\n- mimeTypesToMediaTypes,\n- extensionFromFilename,\n-} from 'lib/utils/file-utils';\n+import { extensionFromFilename } from 'lib/utils/file-utils';\nimport { store } from '../redux/redux-setup';\nimport {\n@@ -196,20 +192,6 @@ class MediaGalleryKeyboard extends React.PureComponent<Props, State> {\n}\n}\n- static getPhotosQuery(after: ?string) {\n- const base = {};\n- base.first = 20;\n- base.assetType = 'All';\n- if (Platform.OS !== 'android') {\n- base.groupTypes = 'All';\n- }\n- if (after) {\n- base.after = after;\n- }\n- base.mimeTypes = Object.keys(mimeTypesToMediaTypes);\n- return base;\n- }\n-\nstatic compatibleURI(uri: string, filename: string) {\nconst extension = extensionFromFilename(filename);\nif (!extension) {\n@@ -230,9 +212,16 @@ class MediaGalleryKeyboard extends React.PureComponent<Props, State> {\nreturn;\n}\n}\n- const { edges, page_info } = await CameraRoll.getPhotos(\n- MediaGalleryKeyboard.getPhotosQuery(after),\n- );\n+ const {\n+ assets,\n+ endCursor,\n+ hasNextPage,\n+ } = await MediaLibrary.getAssetsAsync({\n+ first: 20,\n+ after,\n+ mediaType: [MediaLibrary.MediaType.photo, MediaLibrary.MediaType.video],\n+ sortBy: [MediaLibrary.SortBy.modificationTime],\n+ });\nlet firstRemoved = false,\nlastRemoved = false;\n@@ -242,18 +231,9 @@ class MediaGalleryKeyboard extends React.PureComponent<Props, State> {\n: [];\nconst existingURIs = new Set(mediaURIs);\nlet first = true;\n- const selections = edges\n- .map(({ node }) => {\n- const { height, width, filename, playableDuration } = node.image;\n- const isVideo =\n- (Platform.OS === 'android' &&\n- playableDuration !== null &&\n- playableDuration !== undefined) ||\n- (Platform.OS === 'ios' && node.type === 'video');\n- const uri = MediaGalleryKeyboard.compatibleURI(\n- node.image.uri,\n- filename,\n- );\n+ const selections = assets\n+ .map(({ height, width, uri, filename, mediaType, duration }) => {\n+ const isVideo = mediaType === MediaLibrary.MediaType.video;\nif (existingURIs.has(uri)) {\nif (first) {\n@@ -273,7 +253,7 @@ class MediaGalleryKeyboard extends React.PureComponent<Props, State> {\ndimensions: { height, width },\nuri,\nfilename,\n- playableDuration,\n+ playableDuration: duration,\n};\n} else {\nreturn {\n@@ -305,7 +285,7 @@ class MediaGalleryKeyboard extends React.PureComponent<Props, State> {\nthis.guardedSetState({\nselections: newSelections,\nerror: null,\n- cursor: page_info.has_next_page ? page_info.end_cursor : null,\n+ cursor: hasNextPage ? endCursor : null,\n});\n} catch (e) {\nthis.guardedSetState({\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Use expo-media-library instead of @react-native-community/cameraroll in MediaGalleryKeyboard
129,187
12.04.2020 19:14:51
14,400
f5fcb3dfaae113fd7c68aa10d477715d0fe33811
[native] Use expo-media-library instead of in saveImageIOS
[ { "change_type": "MODIFY", "old_path": "native/media/save-image.js", "new_path": "native/media/save-image.js", "diff": "import { Platform, PermissionsAndroid } from 'react-native';\nimport filesystem from 'react-native-fs';\n-// eslint-disable-next-line import/default\n-import CameraRoll from '@react-native-community/cameraroll';\nimport invariant from 'invariant';\n+import * as MediaLibrary from 'expo-media-library';\nimport { fileInfoFromData } from 'lib/utils/file-utils';\n@@ -84,7 +83,7 @@ async function saveImageAndroid(\n// On iOS, we save the image to the camera roll\nasync function saveImageIOS(mediaInfo: SaveImageInfo) {\n- const { uri, type } = mediaInfo;\n+ const { uri } = mediaInfo;\nlet tempFile;\nif (uri.startsWith('http')) {\n@@ -92,7 +91,7 @@ async function saveImageIOS(mediaInfo: SaveImageInfo) {\n}\nconst saveURI = tempFile ? `file://${tempFile}` : uri;\n- await CameraRoll.saveToCameraRoll(saveURI, type);\n+ await MediaLibrary.saveToLibraryAsync(saveURI);\nif (tempFile) {\nawait filesystem.unlink(tempFile);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Use expo-media-library instead of @react-native-community/cameraroll in saveImageIOS
129,187
12.04.2020 19:16:48
14,400
9b5c446d28f7322e012d3e6b20bd4cda068e0701
[native] Get rid of
[ { "change_type": "DELETE", "old_path": "native/flow-typed/npm/@react-native-community/cameraroll_vx.x.x.js", "new_path": null, "diff": "-// flow-typed signature: c814c9111a92314da2a7e685c7e61c29\n-// flow-typed version: <<STUB>>/@react-native-community/cameraroll_v^1.0.5/flow_v0.98.0\n-\n-/**\n- * This is an autogenerated libdef stub for:\n- *\n- * '@react-native-community/cameraroll'\n- *\n- * Fill this stub out by replacing all the `any` types.\n- *\n- * Once filled out, we encourage you to share your work with the\n- * community by sending a pull request to:\n- * https://github.com/flowtype/flow-typed\n- */\n-\n-declare module '@react-native-community/cameraroll' {\n- declare module.exports: any;\n-}\n-\n-/**\n- * We include stubs for each file inside this npm package in case you need to\n- * require those files directly. Feel free to delete any files that aren't\n- * needed.\n- */\n-declare module '@react-native-community/cameraroll/jest.setup' {\n- declare module.exports: any;\n-}\n-\n-declare module '@react-native-community/cameraroll/js/__mocks__/nativeInterface' {\n- declare module.exports: any;\n-}\n-\n-declare module '@react-native-community/cameraroll/js/__tests__/CameraRollTest' {\n- declare module.exports: any;\n-}\n-\n-declare module '@react-native-community/cameraroll/js/CameraRoll' {\n- declare module.exports: any;\n-}\n-\n-declare module '@react-native-community/cameraroll/js/nativeInterface' {\n- declare module.exports: any;\n-}\n-\n-// Filename aliases\n-declare module '@react-native-community/cameraroll/jest.setup.js' {\n- declare module.exports: $Exports<'@react-native-community/cameraroll/jest.setup'>;\n-}\n-declare module '@react-native-community/cameraroll/js/__mocks__/nativeInterface.js' {\n- declare module.exports: $Exports<'@react-native-community/cameraroll/js/__mocks__/nativeInterface'>;\n-}\n-declare module '@react-native-community/cameraroll/js/__tests__/CameraRollTest.js' {\n- declare module.exports: $Exports<'@react-native-community/cameraroll/js/__tests__/CameraRollTest'>;\n-}\n-declare module '@react-native-community/cameraroll/js/CameraRoll.js' {\n- declare module.exports: $Exports<'@react-native-community/cameraroll/js/CameraRoll'>;\n-}\n-declare module '@react-native-community/cameraroll/js/nativeInterface.js' {\n- declare module.exports: $Exports<'@react-native-community/cameraroll/js/nativeInterface'>;\n-}\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -225,8 +225,6 @@ PODS:\n- React\n- react-native-camera/RN (3.8.0):\n- React\n- - react-native-cameraroll (1.5.2):\n- - React\n- react-native-ffmpeg/min-lts (0.4.0):\n- mobile-ffmpeg-min (= 4.2.2.LTS)\n- React\n@@ -370,7 +368,6 @@ DEPENDENCIES:\n- React-jsinspector (from `../../node_modules/react-native/ReactCommon/jsinspector`)\n- react-native-background-upload (from `../../node_modules/react-native-background-upload`)\n- react-native-camera (from `../../node_modules/react-native-camera`)\n- - \"react-native-cameraroll (from `../../node_modules/@react-native-community/cameraroll`)\"\n- react-native-ffmpeg/min-lts (from `../../node_modules/react-native-ffmpeg/ios/react-native-ffmpeg.podspec`)\n- react-native-image-resizer (from `../../node_modules/react-native-image-resizer`)\n- react-native-in-app-message (from `../../node_modules/react-native-in-app-message`)\n@@ -480,8 +477,6 @@ EXTERNAL SOURCES:\n:path: \"../../node_modules/react-native-background-upload\"\nreact-native-camera:\n:path: \"../../node_modules/react-native-camera\"\n- react-native-cameraroll:\n- :path: \"../../node_modules/@react-native-community/cameraroll\"\nreact-native-ffmpeg:\n:podspec: \"../../node_modules/react-native-ffmpeg/ios/react-native-ffmpeg.podspec\"\nreact-native-image-resizer:\n@@ -611,7 +606,6 @@ SPEC CHECKSUMS:\nReact-jsinspector: fa0ecc501688c3c4c34f28834a76302233e29dc0\nreact-native-background-upload: 6e8ba7f41a6308231306bddc88f11da3b74c9de4\nreact-native-camera: 21cf4ed26cf432ceb1fae959aa6924943fd6f714\n- react-native-cameraroll: 4360c9faab50dc6844f56d222c2d0c7ef5f1fe92\nreact-native-ffmpeg: 35e303059e3c958cb74e271a45f9391d044f915a\nreact-native-image-resizer: 48eb06a18a6d0a632ffa162a51ca61a68fb5322f\nreact-native-in-app-message: f91de5009620af01456531118264c93e249b83ec\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal.xcodeproj/project.pbxproj", "new_path": "native/ios/SquadCal.xcodeproj/project.pbxproj", "diff": "\"${BUILT_PRODUCTS_DIR}/lottie-react-native/lottie_react_native.framework\",\n\"${BUILT_PRODUCTS_DIR}/react-native-background-upload/react_native_background_upload.framework\",\n\"${BUILT_PRODUCTS_DIR}/react-native-camera/react_native_camera.framework\",\n- \"${BUILT_PRODUCTS_DIR}/react-native-cameraroll/react_native_cameraroll.framework\",\n\"${BUILT_PRODUCTS_DIR}/react-native-image-resizer/react_native_image_resizer.framework\",\n\"${BUILT_PRODUCTS_DIR}/react-native-in-app-message/react_native_in_app_message.framework\",\n\"${BUILT_PRODUCTS_DIR}/react-native-mov-to-mp4/react_native_mov_to_mp4.framework\",\n\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/lottie_react_native.framework\",\n\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_background_upload.framework\",\n\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_camera.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_cameraroll.framework\",\n\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_image_resizer.framework\",\n\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_in_app_message.framework\",\n\"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_mov_to_mp4.framework\",\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"dependencies\": {\n\"@react-native-community/art\": \"^1.1.2\",\n\"@react-native-community/async-storage\": \"^1.6.1\",\n- \"@react-native-community/cameraroll\": \"^1.5.2\",\n\"@react-native-community/netinfo\": \"^4.4.0\",\n\"base-64\": \"^0.1.0\",\n\"expo-media-library\": \"^8.1.0\",\n" }, { "change_type": "DELETE", "old_path": "patches/@react-native-community+cameraroll+1.5.2.patch", "new_path": null, "diff": "-diff --git a/node_modules/@react-native-community/cameraroll/android/src/main/java/com/reactnativecommunity/cameraroll/CameraRollModule.java b/node_modules/@react-native-community/cameraroll/android/src/main/java/com/reactnativecommunity/cameraroll/CameraRollModule.java\n-index 63896c8..6e96331 100644\n---- a/node_modules/@react-native-community/cameraroll/android/src/main/java/com/reactnativecommunity/cameraroll/CameraRollModule.java\n-+++ b/node_modules/@react-native-community/cameraroll/android/src/main/java/com/reactnativecommunity/cameraroll/CameraRollModule.java\n-@@ -13,6 +13,7 @@ import android.content.Context;\n- import android.content.res.AssetFileDescriptor;\n- import android.database.Cursor;\n- import android.graphics.BitmapFactory;\n-+import android.media.ExifInterface;\n- import android.media.MediaMetadataRetriever;\n- import android.media.MediaScannerConnection;\n- import android.net.Uri;\n-@@ -521,13 +522,21 @@ public class CameraRollModule extends ReactContextBaseJavaModule {\n- retriever.setDataSource(photoDescriptor.getFileDescriptor());\n-\n- try {\n-- if (width <= 0 || height <= 0) {\n-- width =\n-- Integer.parseInt(\n-- retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH));\n-- height =\n-- Integer.parseInt(\n-- retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT));\n-+ int videoWidth = Integer.parseInt(\n-+ retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH)\n-+ );\n-+ int videoHeight = Integer.parseInt(\n-+ retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT)\n-+ );\n-+ int orientation = Integer.parseInt(\n-+ retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_ROTATION)\n-+ );\n-+ if (Math.abs(orientation) % 180 == 90) {\n-+ width = videoHeight;\n-+ height = videoWidth;\n-+ } else {\n-+ width = videoWidth;\n-+ height = videoHeight;\n- }\n- int timeInMillisec =\n- Integer.parseInt(\n-@@ -549,6 +558,24 @@ public class CameraRollModule extends ReactContextBaseJavaModule {\n- FLog.e(ReactConstants.TAG, \"Could not get video metadata for \" + photoUri.toString(), e);\n- return false;\n- }\n-+ } else {\n-+ try {\n-+ ExifInterface exif = new ExifInterface(photoUri.toString().substring(7));\n-+ int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);\n-+ if (\n-+ orientation == ExifInterface.ORIENTATION_ROTATE_90 ||\n-+ orientation == ExifInterface.ORIENTATION_ROTATE_270 ||\n-+ orientation == ExifInterface.ORIENTATION_TRANSPOSE ||\n-+ orientation == ExifInterface.ORIENTATION_TRANSVERSE\n-+ ) {\n-+ float oldHeight = height;\n-+ height = width;\n-+ width = oldHeight;\n-+ }\n-+ } catch (IOException e) {\n-+ FLog.e(ReactConstants.TAG, \"Could not get EXIF info for \" + photoUri.toString(), e);\n-+ return false;\n-+ }\n- }\n-\n- if (width <= 0 || height <= 0) {\n-diff --git a/node_modules/@react-native-community/cameraroll/ios/RNCCameraRollManager.m b/node_modules/@react-native-community/cameraroll/ios/RNCCameraRollManager.m\n-index 7170483..27158c9 100644\n---- a/node_modules/@react-native-community/cameraroll/ios/RNCCameraRollManager.m\n-+++ b/node_modules/@react-native-community/cameraroll/ios/RNCCameraRollManager.m\n-@@ -264,7 +264,7 @@ static void RCTResolvePromise(RCTPromiseResolveBlock resolve,\n-\n- // Predicate for fetching assets within a collection\n- PHFetchOptions *const assetFetchOptions = [RCTConvert PHFetchOptionsFromMediaType:mediaType fromTime:fromTime toTime:toTime];\n-- assetFetchOptions.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@\"creationDate\" ascending:NO]];\n-+ assetFetchOptions.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@\"modificationDate\" ascending:NO]];\n-\n- BOOL __block foundAfter = NO;\n- BOOL __block hasNextPage = NO;\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "resolved \"https://registry.yarnpkg.com/@react-native-community/async-storage/-/async-storage-1.6.2.tgz#a19ca7149c4dfe8216f2330e6b1ebfe2d075ef92\"\nintegrity sha512-EJGsbrHubK1mGxPjWB74AaHAd5m9I+Gg2RRPZzMK6org7QOU9WOBnIMFqoeVto3hKOaEPlk8NV74H6G34/2pZQ==\n-\"@react-native-community/cameraroll@^1.5.2\":\n- version \"1.5.2\"\n- resolved \"https://registry.yarnpkg.com/@react-native-community/cameraroll/-/cameraroll-1.5.2.tgz#6db66bd39816ef19051e024e44f31f4a8de5b3c1\"\n- integrity sha512-xrkrmcI5V8IzWoGQOqycs2YZRmGqASqZMDkjOzFFg6bCy95+OMquPnCmGdaUx1ONO1x6tsQSCv87xM/oL+9m/A==\n-\n\"@react-native-community/cli-debugger-ui@^3.0.0\":\nversion \"3.0.0\"\nresolved \"https://registry.yarnpkg.com/@react-native-community/cli-debugger-ui/-/cli-debugger-ui-3.0.0.tgz#d01d08d1e5ddc1633d82c7d84d48fff07bd39416\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Get rid of @react-native-community/cameraroll
129,187
12.04.2020 23:04:00
14,400
da4d50a01f7ad306997be3df235f172a3f4355d3
[native] Get rid of use_frameworks!
[ { "change_type": "MODIFY", "old_path": "native/ios/Podfile", "new_path": "native/ios/Podfile", "diff": "@@ -44,6 +44,5 @@ target 'SquadCal' do\n:commit => 'ba96cf1203f6ea749b7c3f4e921b15d577536253'\nuse_native_modules!\n- use_frameworks!\nuse_unimodules!(modules_paths: ['../..'])\nend\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -315,9 +315,9 @@ PODS:\n- React\n- RNVectorIcons (6.6.0):\n- React\n- - SDWebImage (5.5.2):\n- - SDWebImage/Core (= 5.5.2)\n- - SDWebImage/Core (5.5.2)\n+ - SDWebImage (5.7.2):\n+ - SDWebImage/Core (= 5.7.2)\n+ - SDWebImage/Core (5.7.2)\n- SDWebImageWebPCoder (0.2.5):\n- libwebp (~> 1.0)\n- SDWebImage/Core (~> 5.0)\n@@ -639,7 +639,7 @@ SPEC CHECKSUMS:\nRNReanimated: 6abbbae2e5e72609d85aabd92a982a94566885f1\nRNScreens: 000c9e6e31c9a483688943155107e4ca9394d37a\nRNVectorIcons: 0bb4def82230be1333ddaeee9fcba45f0b288ed4\n- SDWebImage: 4d5c027c935438f341ed33dbac53ff9f479922ca\n+ SDWebImage: d9ea4959d99c52276dfada481987018fcaea3d58\nSDWebImageWebPCoder: 947093edd1349d820c40afbd9f42acb6cdecd987\nSPTPersistentCache: df36ea46762d7cf026502bbb86a8b79d0080dff4\nUMAppLoader: 90273a65f9b1d789214e0c913dfcabc7a1b1590e\n@@ -657,6 +657,6 @@ SPEC CHECKSUMS:\nUMTaskManagerInterface: cb890c79c63885504ddc0efd7a7d01481760aca2\nYoga: f2a7cd4280bfe2cca5a7aed98ba0eb3d1310f18b\n-PODFILE CHECKSUM: cf021c38da91cadc7175ec6114a1ca99fe5d1d1e\n+PODFILE CHECKSUM: 2365922fe1d9a86a67ac9f4835b5760ec1bdbcbd\nCOCOAPODS: 1.9.1\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/ios/SquadCal-Bridging-Header.h", "diff": "+//\n+// Use this file to import your target's public headers that you would like to expose to Swift.\n+//\n+\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal.xcodeproj/project.pbxproj", "new_path": "native/ios/SquadCal.xcodeproj/project.pbxproj", "diff": "13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };\n13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };\n13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };\n+ 1A53F0D47E0E927C69B86A06 /* libPods-SquadCal.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D1B223F3AE00077DC21172C7 /* libPods-SquadCal.a */; };\n+ 7F26E81C24440D87004049C6 /* dummy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F26E81B24440D87004049C6 /* dummy.swift */; };\n7F761E602201141E001B6FB7 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F761E292201141E001B6FB7 /* JavaScriptCore.framework */; };\n7FB58ABE1E7F6BD500B4C1B1 /* Anaheim-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 7FB58ABB1E7F6BC600B4C1B1 /* Anaheim-Regular.ttf */; };\n7FB58AC01E7F6BD800B4C1B1 /* OpenSans-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 7FB58ABC1E7F6BC600B4C1B1 /* OpenSans-Regular.ttf */; };\n7FB58AC21E7F6BDB00B4C1B1 /* OpenSans-Semibold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 7FB58ABD1E7F6BC600B4C1B1 /* OpenSans-Semibold.ttf */; };\n- B142D461DA6DEBA783DF658F /* Pods_SquadCal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BECA2B0914281D4FAAD45B78 /* Pods_SquadCal.framework */; };\n/* End PBXBuildFile section */\n/* Begin PBXFileReference section */\n13B07FB61A68108700A75B9A /* Info.release.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.release.plist; path = SquadCal/Info.release.plist; sourceTree = \"<group>\"; };\n13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = SquadCal/main.m; sourceTree = \"<group>\"; };\n7EE5A7681B39319D3AF09109 /* Pods-SquadCal.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = \"Pods-SquadCal.release.xcconfig\"; path = \"Target Support Files/Pods-SquadCal/Pods-SquadCal.release.xcconfig\"; sourceTree = \"<group>\"; };\n+ 7F26E81B24440D87004049C6 /* dummy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = dummy.swift; sourceTree = \"<group>\"; };\n7F554F822332D58B007CB9F7 /* Info.debug.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.debug.plist; path = SquadCal/Info.debug.plist; sourceTree = \"<group>\"; };\n7F761E292201141E001B6FB7 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };\n7FB58ABB1E7F6BC600B4C1B1 /* Anaheim-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = \"Anaheim-Regular.ttf\"; sourceTree = \"<group>\"; };\n7FB58ABC1E7F6BC600B4C1B1 /* OpenSans-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = \"OpenSans-Regular.ttf\"; sourceTree = \"<group>\"; };\n7FB58ABD1E7F6BC600B4C1B1 /* OpenSans-Semibold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = \"OpenSans-Semibold.ttf\"; sourceTree = \"<group>\"; };\n+ 7FCEA2DC2444010B004017B1 /* SquadCal-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"SquadCal-Bridging-Header.h\"; sourceTree = \"<group>\"; };\n7FCFD8BD1E81B8DF00629B0E /* SquadCal.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = SquadCal.entitlements; path = SquadCal/SquadCal.entitlements; sourceTree = \"<group>\"; };\n8C0A50BD3E650F9A49DACD73 /* Pods-SquadCal.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = \"Pods-SquadCal.debug.xcconfig\"; path = \"Target Support Files/Pods-SquadCal/Pods-SquadCal.debug.xcconfig\"; sourceTree = \"<group>\"; };\n- BECA2B0914281D4FAAD45B78 /* Pods_SquadCal.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SquadCal.framework; sourceTree = BUILT_PRODUCTS_DIR; };\n+ D1B223F3AE00077DC21172C7 /* libPods-SquadCal.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libPods-SquadCal.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n/* End PBXFileReference section */\n/* Begin PBXFrameworksBuildPhase section */\nbuildActionMask = 2147483647;\nfiles = (\n7F761E602201141E001B6FB7 /* JavaScriptCore.framework in Frameworks */,\n- B142D461DA6DEBA783DF658F /* Pods_SquadCal.framework in Frameworks */,\n+ 1A53F0D47E0E927C69B86A06 /* libPods-SquadCal.a in Frameworks */,\n);\nrunOnlyForDeploymentPostprocessing = 0;\n};\n13B07FB61A68108700A75B9A /* Info.release.plist */,\n13B07FB11A68108700A75B9A /* LaunchScreen.xib */,\n13B07FB71A68108700A75B9A /* main.m */,\n+ 7FCEA2DC2444010B004017B1 /* SquadCal-Bridging-Header.h */,\n+ 7F26E81B24440D87004049C6 /* dummy.swift */,\n);\nname = SquadCal;\nsourceTree = \"<group>\";\nisa = PBXGroup;\nchildren = (\n7F761E292201141E001B6FB7 /* JavaScriptCore.framework */,\n- BECA2B0914281D4FAAD45B78 /* Pods_SquadCal.framework */,\n+ D1B223F3AE00077DC21172C7 /* libPods-SquadCal.a */,\n);\nname = Frameworks;\nsourceTree = \"<group>\";\n13B07F8C1A680F5B00A75B9A /* Frameworks */,\n13B07F8E1A680F5B00A75B9A /* Resources */,\n00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,\n- CC5FF6BDB10C85E53F3024F6 /* [CP] Embed Pods Frameworks */,\n+ 5BAD9F1C6839DB015414C665 /* [CP] Copy Pods Resources */,\n);\nbuildRules = (\n);\n83CBB9F71A601CBA00E9B192 /* Project object */ = {\nisa = PBXProject;\nattributes = {\n- LastUpgradeCheck = 610;\n+ LastUpgradeCheck = 1140;\nORGANIZATIONNAME = SquadCal;\nTargetAttributes = {\n13B07F861A680F5B00A75B9A = {\nDevelopmentTeam = 6BF4H9TU5U;\n+ LastSwiftMigration = 1140;\nProvisioningStyle = Automatic;\nSystemCapabilities = {\ncom.apple.BackgroundModes = {\nshellScript = \"diff \\\"${PODS_PODFILE_DIR_PATH}/Podfile.lock\\\" \\\"${PODS_ROOT}/Manifest.lock\\\" > /dev/null\\nif [ $? != 0 ] ; then\\n # print error to STDERR\\n echo \\\"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\\\" >&2\\n exit 1\\nfi\\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\\necho \\\"SUCCESS\\\" > \\\"${SCRIPT_OUTPUT_FILE_0}\\\"\\n\";\nshowEnvVarsInLog = 0;\n};\n- CC5FF6BDB10C85E53F3024F6 /* [CP] Embed Pods Frameworks */ = {\n+ 5BAD9F1C6839DB015414C665 /* [CP] Copy Pods Resources */ = {\nisa = PBXShellScriptBuildPhase;\nbuildActionMask = 2147483647;\nfiles = (\n);\ninputPaths = (\n- \"${PODS_ROOT}/Target Support Files/Pods-SquadCal/Pods-SquadCal-frameworks.sh\",\n- \"${BUILT_PRODUCTS_DIR}/1PasswordExtension/OnePasswordExtension.framework\",\n- \"${BUILT_PRODUCTS_DIR}/DVAssetLoaderDelegate/DVAssetLoaderDelegate.framework\",\n- \"${BUILT_PRODUCTS_DIR}/DoubleConversion/DoubleConversion.framework\",\n- \"${BUILT_PRODUCTS_DIR}/EXConstants/EXConstants.framework\",\n- \"${BUILT_PRODUCTS_DIR}/EXFileSystem/EXFileSystem.framework\",\n- \"${BUILT_PRODUCTS_DIR}/EXImageLoader/EXImageLoader.framework\",\n- \"${BUILT_PRODUCTS_DIR}/EXMediaLibrary/EXMediaLibrary.framework\",\n- \"${BUILT_PRODUCTS_DIR}/EXPermissions/EXPermissions.framework\",\n- \"${BUILT_PRODUCTS_DIR}/FBReactNativeSpec/FBReactNativeSpec.framework\",\n- \"${BUILT_PRODUCTS_DIR}/Folly/folly.framework\",\n- \"${BUILT_PRODUCTS_DIR}/RCTTypeSafety/RCTTypeSafety.framework\",\n- \"${BUILT_PRODUCTS_DIR}/RNCAsyncStorage/RNCAsyncStorage.framework\",\n- \"${BUILT_PRODUCTS_DIR}/RNExitApp/RNExitApp.framework\",\n- \"${BUILT_PRODUCTS_DIR}/RNFS/RNFS.framework\",\n- \"${BUILT_PRODUCTS_DIR}/RNFastImage/RNFastImage.framework\",\n- \"${BUILT_PRODUCTS_DIR}/RNGestureHandler/RNGestureHandler.framework\",\n- \"${BUILT_PRODUCTS_DIR}/RNKeychain/RNKeychain.framework\",\n- \"${BUILT_PRODUCTS_DIR}/RNReanimated/RNReanimated.framework\",\n- \"${BUILT_PRODUCTS_DIR}/RNScreens/RNScreens.framework\",\n- \"${BUILT_PRODUCTS_DIR}/RNVectorIcons/RNVectorIcons.framework\",\n- \"${BUILT_PRODUCTS_DIR}/React-Core/React.framework\",\n- \"${BUILT_PRODUCTS_DIR}/React-CoreModules/CoreModules.framework\",\n- \"${BUILT_PRODUCTS_DIR}/React-RCTActionSheet/RCTActionSheet.framework\",\n- \"${BUILT_PRODUCTS_DIR}/React-RCTAnimation/RCTAnimation.framework\",\n- \"${BUILT_PRODUCTS_DIR}/React-RCTBlob/RCTBlob.framework\",\n- \"${BUILT_PRODUCTS_DIR}/React-RCTImage/RCTImage.framework\",\n- \"${BUILT_PRODUCTS_DIR}/React-RCTLinking/RCTLinking.framework\",\n- \"${BUILT_PRODUCTS_DIR}/React-RCTNetwork/RCTNetwork.framework\",\n- \"${BUILT_PRODUCTS_DIR}/React-RCTSettings/RCTSettings.framework\",\n- \"${BUILT_PRODUCTS_DIR}/React-RCTText/RCTText.framework\",\n- \"${BUILT_PRODUCTS_DIR}/React-RCTVibration/RCTVibration.framework\",\n- \"${BUILT_PRODUCTS_DIR}/React-cxxreact/cxxreact.framework\",\n- \"${BUILT_PRODUCTS_DIR}/React-jsi/jsi.framework\",\n- \"${BUILT_PRODUCTS_DIR}/React-jsiexecutor/jsireact.framework\",\n- \"${BUILT_PRODUCTS_DIR}/React-jsinspector/jsinspector.framework\",\n- \"${BUILT_PRODUCTS_DIR}/ReactCommon/ReactCommon.framework\",\n- \"${BUILT_PRODUCTS_DIR}/ReactNativeART/ReactNativeART.framework\",\n- \"${BUILT_PRODUCTS_DIR}/ReactNativeDarkMode/ReactNativeDarkMode.framework\",\n- \"${BUILT_PRODUCTS_DIR}/ReactNativeKeyboardInput/ReactNativeKeyboardInput.framework\",\n- \"${BUILT_PRODUCTS_DIR}/ReactNativeKeyboardTrackingView/ReactNativeKeyboardTrackingView.framework\",\n- \"${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework\",\n- \"${BUILT_PRODUCTS_DIR}/SDWebImageWebPCoder/SDWebImageWebPCoder.framework\",\n- \"${BUILT_PRODUCTS_DIR}/SPTPersistentCache/SPTPersistentCache.framework\",\n- \"${BUILT_PRODUCTS_DIR}/UMAppLoader/UMAppLoader.framework\",\n- \"${BUILT_PRODUCTS_DIR}/UMCore/UMCore.framework\",\n- \"${BUILT_PRODUCTS_DIR}/UMPermissionsInterface/UMPermissionsInterface.framework\",\n- \"${BUILT_PRODUCTS_DIR}/UMReactNativeAdapter/UMReactNativeAdapter.framework\",\n- \"${BUILT_PRODUCTS_DIR}/Yoga/yoga.framework\",\n- \"${BUILT_PRODUCTS_DIR}/glog/glog.framework\",\n- \"${BUILT_PRODUCTS_DIR}/libwebp/libwebp.framework\",\n- \"${BUILT_PRODUCTS_DIR}/lottie-ios/Lottie.framework\",\n- \"${BUILT_PRODUCTS_DIR}/lottie-react-native/lottie_react_native.framework\",\n- \"${BUILT_PRODUCTS_DIR}/react-native-background-upload/react_native_background_upload.framework\",\n- \"${BUILT_PRODUCTS_DIR}/react-native-camera/react_native_camera.framework\",\n- \"${BUILT_PRODUCTS_DIR}/react-native-image-resizer/react_native_image_resizer.framework\",\n- \"${BUILT_PRODUCTS_DIR}/react-native-in-app-message/react_native_in_app_message.framework\",\n- \"${BUILT_PRODUCTS_DIR}/react-native-mov-to-mp4/react_native_mov_to_mp4.framework\",\n- \"${BUILT_PRODUCTS_DIR}/react-native-netinfo/react_native_netinfo.framework\",\n- \"${BUILT_PRODUCTS_DIR}/react-native-notifications/react_native_notifications.framework\",\n- \"${BUILT_PRODUCTS_DIR}/react-native-onepassword/react_native_onepassword.framework\",\n- \"${BUILT_PRODUCTS_DIR}/react-native-orientation-locker/react_native_orientation_locker.framework\",\n- \"${BUILT_PRODUCTS_DIR}/react-native-splash-screen/react_native_splash_screen.framework\",\n- );\n- name = \"[CP] Embed Pods Frameworks\";\n+ \"${PODS_ROOT}/Target Support Files/Pods-SquadCal/Pods-SquadCal-resources.sh\",\n+ \"${PODS_CONFIGURATION_BUILD_DIR}/1PasswordExtension/OnePasswordExtensionResources.bundle\",\n+ \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/AntDesign.ttf\",\n+ \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/Entypo.ttf\",\n+ \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf\",\n+ \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/Feather.ttf\",\n+ \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf\",\n+ \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Brands.ttf\",\n+ \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Regular.ttf\",\n+ \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Solid.ttf\",\n+ \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/Fontisto.ttf\",\n+ \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/Foundation.ttf\",\n+ \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/Ionicons.ttf\",\n+ \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf\",\n+ \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/MaterialIcons.ttf\",\n+ \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/Octicons.ttf\",\n+ \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/SimpleLineIcons.ttf\",\n+ \"${PODS_ROOT}/../../../node_modules/react-native-vector-icons/Fonts/Zocial.ttf\",\n+ );\n+ name = \"[CP] Copy Pods Resources\";\noutputPaths = (\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OnePasswordExtension.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DVAssetLoaderDelegate.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DoubleConversion.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/EXConstants.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/EXFileSystem.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/EXImageLoader.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/EXMediaLibrary.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/EXPermissions.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBReactNativeSpec.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/folly.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTTypeSafety.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNCAsyncStorage.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNExitApp.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNFS.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNFastImage.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNGestureHandler.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNKeychain.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNReanimated.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNScreens.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNVectorIcons.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/React.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CoreModules.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTActionSheet.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTAnimation.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTBlob.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTImage.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTLinking.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTNetwork.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTSettings.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTText.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTVibration.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/cxxreact.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/jsi.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/jsireact.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/jsinspector.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ReactCommon.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ReactNativeART.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ReactNativeDarkMode.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ReactNativeKeyboardInput.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ReactNativeKeyboardTrackingView.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImageWebPCoder.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SPTPersistentCache.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/UMAppLoader.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/UMCore.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/UMPermissionsInterface.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/UMReactNativeAdapter.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/yoga.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/glog.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libwebp.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Lottie.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/lottie_react_native.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_background_upload.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_camera.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_image_resizer.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_in_app_message.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_mov_to_mp4.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_netinfo.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_notifications.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_onepassword.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_orientation_locker.framework\",\n- \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_splash_screen.framework\",\n+ \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/OnePasswordExtensionResources.bundle\",\n+ \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AntDesign.ttf\",\n+ \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Entypo.ttf\",\n+ \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EvilIcons.ttf\",\n+ \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Feather.ttf\",\n+ \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome.ttf\",\n+ \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Brands.ttf\",\n+ \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Regular.ttf\",\n+ \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Solid.ttf\",\n+ \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Fontisto.ttf\",\n+ \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Foundation.ttf\",\n+ \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Ionicons.ttf\",\n+ \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MaterialCommunityIcons.ttf\",\n+ \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MaterialIcons.ttf\",\n+ \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Octicons.ttf\",\n+ \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SimpleLineIcons.ttf\",\n+ \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Zocial.ttf\",\n);\nrunOnlyForDeploymentPostprocessing = 0;\nshellPath = /bin/sh;\n- shellScript = \"\\\"${PODS_ROOT}/Target Support Files/Pods-SquadCal/Pods-SquadCal-frameworks.sh\\\"\\n\";\n+ shellScript = \"\\\"${PODS_ROOT}/Target Support Files/Pods-SquadCal/Pods-SquadCal-resources.sh\\\"\\n\";\nshowEnvVarsInLog = 0;\n};\n/* End PBXShellScriptBuildPhase section */\nbuildActionMask = 2147483647;\nfiles = (\n13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,\n+ 7F26E81C24440D87004049C6 /* dummy.swift in Sources */,\n13B07FC11A68108700A75B9A /* main.m in Sources */,\n);\nrunOnlyForDeploymentPostprocessing = 0;\nisa = XCBuildConfiguration;\nbaseConfigurationReference = 8C0A50BD3E650F9A49DACD73 /* Pods-SquadCal.debug.xcconfig */;\nbuildSettings = {\n- ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;\nASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\nCLANG_ENABLE_MODULES = YES;\nCODE_SIGN_ENTITLEMENTS = SquadCal/SquadCal.entitlements;\n);\nPRODUCT_BUNDLE_IDENTIFIER = org.squadcal.app;\nPRODUCT_NAME = SquadCal;\n+ SWIFT_OBJC_BRIDGING_HEADER = \"SquadCal-Bridging-Header.h\";\n+ SWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n+ SWIFT_VERSION = 5.0;\nTARGETED_DEVICE_FAMILY = 1;\nVERSIONING_SYSTEM = \"apple-generic\";\n};\nisa = XCBuildConfiguration;\nbaseConfigurationReference = 7EE5A7681B39319D3AF09109 /* Pods-SquadCal.release.xcconfig */;\nbuildSettings = {\n- ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;\nASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n+ CLANG_ENABLE_MODULES = YES;\nCODE_SIGN_ENTITLEMENTS = SquadCal/SquadCal.entitlements;\n\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\nCURRENT_PROJECT_VERSION = 1;\n);\nPRODUCT_BUNDLE_IDENTIFIER = org.squadcal.app;\nPRODUCT_NAME = SquadCal;\n+ SWIFT_OBJC_BRIDGING_HEADER = \"SquadCal-Bridging-Header.h\";\n+ SWIFT_VERSION = 5.0;\nTARGETED_DEVICE_FAMILY = 1;\nVERSIONING_SYSTEM = \"apple-generic\";\n};\nALWAYS_SEARCH_USER_PATHS = NO;\nCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\nCLANG_CXX_LIBRARY = \"libc++\";\n+ CLANG_ENABLE_MODULES = YES;\nCLANG_ENABLE_OBJC_ARC = YES;\nCLANG_WARN_BOOL_CONVERSION = YES;\nCLANG_WARN_CONSTANT_CONVERSION = YES;\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal.xcodeproj/xcshareddata/xcschemes/SquadCal-tvOS.xcscheme", "new_path": "native/ios/SquadCal.xcodeproj/xcshareddata/xcschemes/SquadCal-tvOS.xcscheme", "diff": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n- LastUpgradeVersion = \"0820\"\n+ LastUpgradeVersion = \"1140\"\nversion = \"1.3\">\n<BuildAction\nparallelizeBuildables = \"NO\"\nselectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\nselectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\nshouldUseLaunchSchemeArgsEnv = \"YES\">\n+ <MacroExpansion>\n+ <BuildableReference\n+ BuildableIdentifier = \"primary\"\n+ BlueprintIdentifier = \"2D02E47A1E0B4A5D006451C7\"\n+ BuildableName = \"SquadCal-tvOS.app\"\n+ BlueprintName = \"SquadCal-tvOS\"\n+ ReferencedContainer = \"container:SquadCal.xcodeproj\">\n+ </BuildableReference>\n+ </MacroExpansion>\n<Testables>\n<TestableReference\nskipped = \"NO\">\n</BuildableReference>\n</TestableReference>\n</Testables>\n- <MacroExpansion>\n- <BuildableReference\n- BuildableIdentifier = \"primary\"\n- BlueprintIdentifier = \"2D02E47A1E0B4A5D006451C7\"\n- BuildableName = \"SquadCal-tvOS.app\"\n- BlueprintName = \"SquadCal-tvOS\"\n- ReferencedContainer = \"container:SquadCal.xcodeproj\">\n- </BuildableReference>\n- </MacroExpansion>\n- <AdditionalOptions>\n- </AdditionalOptions>\n</TestAction>\n<LaunchAction\nbuildConfiguration = \"Debug\"\nReferencedContainer = \"container:SquadCal.xcodeproj\">\n</BuildableReference>\n</BuildableProductRunnable>\n- <AdditionalOptions>\n- </AdditionalOptions>\n</LaunchAction>\n<ProfileAction\nbuildConfiguration = \"Release\"\n" }, { "change_type": "MODIFY", "old_path": "native/ios/SquadCal.xcodeproj/xcshareddata/xcschemes/SquadCal.xcscheme", "new_path": "native/ios/SquadCal.xcodeproj/xcshareddata/xcschemes/SquadCal.xcscheme", "diff": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n- LastUpgradeVersion = \"0620\"\n+ LastUpgradeVersion = \"1140\"\nversion = \"1.3\">\n<BuildAction\nparallelizeBuildables = \"NO\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Get rid of use_frameworks!
129,187
12.04.2020 23:07:23
14,400
341bf73c60d8da5ebbdd2b26e9371663dc7113f3
[native] Delete tvOS scheme
[ { "change_type": "DELETE", "old_path": "native/ios/SquadCal.xcodeproj/xcshareddata/xcschemes/SquadCal-tvOS.xcscheme", "new_path": null, "diff": "-<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n-<Scheme\n- LastUpgradeVersion = \"1140\"\n- version = \"1.3\">\n- <BuildAction\n- parallelizeBuildables = \"NO\"\n- buildImplicitDependencies = \"YES\">\n- <BuildActionEntries>\n- <BuildActionEntry\n- buildForTesting = \"YES\"\n- buildForRunning = \"YES\"\n- buildForProfiling = \"YES\"\n- buildForArchiving = \"YES\"\n- buildForAnalyzing = \"YES\">\n- <BuildableReference\n- BuildableIdentifier = \"primary\"\n- BlueprintIdentifier = \"2D2A28121D9B038B00D4039D\"\n- BuildableName = \"libReact.a\"\n- BlueprintName = \"React-tvOS\"\n- ReferencedContainer = \"container:../node_modules/react-native/React/React.xcodeproj\">\n- </BuildableReference>\n- </BuildActionEntry>\n- <BuildActionEntry\n- buildForTesting = \"YES\"\n- buildForRunning = \"YES\"\n- buildForProfiling = \"YES\"\n- buildForArchiving = \"YES\"\n- buildForAnalyzing = \"YES\">\n- <BuildableReference\n- BuildableIdentifier = \"primary\"\n- BlueprintIdentifier = \"2D02E47A1E0B4A5D006451C7\"\n- BuildableName = \"SquadCal-tvOS.app\"\n- BlueprintName = \"SquadCal-tvOS\"\n- ReferencedContainer = \"container:SquadCal.xcodeproj\">\n- </BuildableReference>\n- </BuildActionEntry>\n- <BuildActionEntry\n- buildForTesting = \"YES\"\n- buildForRunning = \"YES\"\n- buildForProfiling = \"NO\"\n- buildForArchiving = \"NO\"\n- buildForAnalyzing = \"YES\">\n- <BuildableReference\n- BuildableIdentifier = \"primary\"\n- BlueprintIdentifier = \"2D02E48F1E0B4A5D006451C7\"\n- BuildableName = \"SquadCal-tvOSTests.xctest\"\n- BlueprintName = \"SquadCal-tvOSTests\"\n- ReferencedContainer = \"container:SquadCal.xcodeproj\">\n- </BuildableReference>\n- </BuildActionEntry>\n- </BuildActionEntries>\n- </BuildAction>\n- <TestAction\n- buildConfiguration = \"Debug\"\n- selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n- selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n- shouldUseLaunchSchemeArgsEnv = \"YES\">\n- <MacroExpansion>\n- <BuildableReference\n- BuildableIdentifier = \"primary\"\n- BlueprintIdentifier = \"2D02E47A1E0B4A5D006451C7\"\n- BuildableName = \"SquadCal-tvOS.app\"\n- BlueprintName = \"SquadCal-tvOS\"\n- ReferencedContainer = \"container:SquadCal.xcodeproj\">\n- </BuildableReference>\n- </MacroExpansion>\n- <Testables>\n- <TestableReference\n- skipped = \"NO\">\n- <BuildableReference\n- BuildableIdentifier = \"primary\"\n- BlueprintIdentifier = \"2D02E48F1E0B4A5D006451C7\"\n- BuildableName = \"SquadCal-tvOSTests.xctest\"\n- BlueprintName = \"SquadCal-tvOSTests\"\n- ReferencedContainer = \"container:SquadCal.xcodeproj\">\n- </BuildableReference>\n- </TestableReference>\n- </Testables>\n- </TestAction>\n- <LaunchAction\n- buildConfiguration = \"Debug\"\n- selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n- selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n- launchStyle = \"0\"\n- useCustomWorkingDirectory = \"NO\"\n- ignoresPersistentStateOnLaunch = \"NO\"\n- debugDocumentVersioning = \"YES\"\n- debugServiceExtension = \"internal\"\n- allowLocationSimulation = \"YES\">\n- <BuildableProductRunnable\n- runnableDebuggingMode = \"0\">\n- <BuildableReference\n- BuildableIdentifier = \"primary\"\n- BlueprintIdentifier = \"2D02E47A1E0B4A5D006451C7\"\n- BuildableName = \"SquadCal-tvOS.app\"\n- BlueprintName = \"SquadCal-tvOS\"\n- ReferencedContainer = \"container:SquadCal.xcodeproj\">\n- </BuildableReference>\n- </BuildableProductRunnable>\n- </LaunchAction>\n- <ProfileAction\n- buildConfiguration = \"Release\"\n- shouldUseLaunchSchemeArgsEnv = \"YES\"\n- savedToolIdentifier = \"\"\n- useCustomWorkingDirectory = \"NO\"\n- debugDocumentVersioning = \"YES\">\n- <BuildableProductRunnable\n- runnableDebuggingMode = \"0\">\n- <BuildableReference\n- BuildableIdentifier = \"primary\"\n- BlueprintIdentifier = \"2D02E47A1E0B4A5D006451C7\"\n- BuildableName = \"SquadCal-tvOS.app\"\n- BlueprintName = \"SquadCal-tvOS\"\n- ReferencedContainer = \"container:SquadCal.xcodeproj\">\n- </BuildableReference>\n- </BuildableProductRunnable>\n- </ProfileAction>\n- <AnalyzeAction\n- buildConfiguration = \"Debug\">\n- </AnalyzeAction>\n- <ArchiveAction\n- buildConfiguration = \"Release\"\n- revealArchiveInOrganizer = \"YES\">\n- </ArchiveAction>\n-</Scheme>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Delete tvOS scheme
129,187
13.04.2020 15:58:15
14,400
5d45a7f44b51738d8385d1b47372d2f31792ee04
[native] Reintroduce See
[ { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -225,6 +225,8 @@ PODS:\n- React\n- react-native-camera/RN (3.8.0):\n- React\n+ - react-native-cameraroll (1.5.2):\n+ - React\n- react-native-ffmpeg/min-lts (0.4.0):\n- mobile-ffmpeg-min (= 4.2.2.LTS)\n- React\n@@ -368,6 +370,7 @@ DEPENDENCIES:\n- React-jsinspector (from `../../node_modules/react-native/ReactCommon/jsinspector`)\n- react-native-background-upload (from `../../node_modules/react-native-background-upload`)\n- react-native-camera (from `../../node_modules/react-native-camera`)\n+ - \"react-native-cameraroll (from `../../node_modules/@react-native-community/cameraroll`)\"\n- react-native-ffmpeg/min-lts (from `../../node_modules/react-native-ffmpeg/ios/react-native-ffmpeg.podspec`)\n- react-native-image-resizer (from `../../node_modules/react-native-image-resizer`)\n- react-native-in-app-message (from `../../node_modules/react-native-in-app-message`)\n@@ -477,6 +480,8 @@ EXTERNAL SOURCES:\n:path: \"../../node_modules/react-native-background-upload\"\nreact-native-camera:\n:path: \"../../node_modules/react-native-camera\"\n+ react-native-cameraroll:\n+ :path: \"../../node_modules/@react-native-community/cameraroll\"\nreact-native-ffmpeg:\n:podspec: \"../../node_modules/react-native-ffmpeg/ios/react-native-ffmpeg.podspec\"\nreact-native-image-resizer:\n@@ -606,6 +611,7 @@ SPEC CHECKSUMS:\nReact-jsinspector: fa0ecc501688c3c4c34f28834a76302233e29dc0\nreact-native-background-upload: 6e8ba7f41a6308231306bddc88f11da3b74c9de4\nreact-native-camera: 21cf4ed26cf432ceb1fae959aa6924943fd6f714\n+ react-native-cameraroll: 4360c9faab50dc6844f56d222c2d0c7ef5f1fe92\nreact-native-ffmpeg: 35e303059e3c958cb74e271a45f9391d044f915a\nreact-native-image-resizer: 48eb06a18a6d0a632ffa162a51ca61a68fb5322f\nreact-native-in-app-message: f91de5009620af01456531118264c93e249b83ec\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"dependencies\": {\n\"@react-native-community/art\": \"^1.1.2\",\n\"@react-native-community/async-storage\": \"^1.6.1\",\n+ \"@react-native-community/cameraroll\": \"^1.5.2\",\n\"@react-native-community/netinfo\": \"^4.4.0\",\n\"base-64\": \"^0.1.0\",\n\"expo-media-library\": \"^8.1.0\",\n" }, { "change_type": "MODIFY", "old_path": "native/react-native.config.js", "new_path": "native/react-native.config.js", "diff": "@@ -8,5 +8,6 @@ module.exports = {\nios: null,\n},\n},\n+ '@react-native-community/cameraroll': { platforms: { android: null } },\n},\n};\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "resolved \"https://registry.yarnpkg.com/@react-native-community/async-storage/-/async-storage-1.6.2.tgz#a19ca7149c4dfe8216f2330e6b1ebfe2d075ef92\"\nintegrity sha512-EJGsbrHubK1mGxPjWB74AaHAd5m9I+Gg2RRPZzMK6org7QOU9WOBnIMFqoeVto3hKOaEPlk8NV74H6G34/2pZQ==\n+\"@react-native-community/cameraroll@^1.5.2\":\n+ version \"1.5.2\"\n+ resolved \"https://registry.yarnpkg.com/@react-native-community/cameraroll/-/cameraroll-1.5.2.tgz#6db66bd39816ef19051e024e44f31f4a8de5b3c1\"\n+ integrity sha512-xrkrmcI5V8IzWoGQOqycs2YZRmGqASqZMDkjOzFFg6bCy95+OMquPnCmGdaUx1ONO1x6tsQSCv87xM/oL+9m/A==\n+\n\"@react-native-community/cli-debugger-ui@^3.0.0\":\nversion \"3.0.0\"\nresolved \"https://registry.yarnpkg.com/@react-native-community/cli-debugger-ui/-/cli-debugger-ui-3.0.0.tgz#d01d08d1e5ddc1633d82c7d84d48fff07bd39416\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Reintroduce @react-native-community/cameraroll See https://github.com/expo/expo/issues/7826
129,187
13.04.2020 12:02:40
14,400
2011fb114178d25f8eaab3645ad62e12ed888309
[native] Reintrodude getCompatibleMediaURI in MediaGalleryKeyboard We should continue doing this just in case `expo-media-library` starts returning the `ph://` URLs, since uploading those URLs triggers undesired image preprocessing ahead of upload on iOS
[ { "change_type": "MODIFY", "old_path": "native/media/media-gallery-keyboard.react.js", "new_path": "native/media/media-gallery-keyboard.react.js", "diff": "@@ -192,14 +192,6 @@ class MediaGalleryKeyboard extends React.PureComponent<Props, State> {\n}\n}\n- static compatibleURI(uri: string, filename: string) {\n- const extension = extensionFromFilename(filename);\n- if (!extension) {\n- return uri;\n- }\n- return getCompatibleMediaURI(uri, extension);\n- }\n-\nasync fetchPhotos(after?: ?string) {\nif (this.fetchingPhotos) {\nreturn;\n@@ -232,8 +224,13 @@ class MediaGalleryKeyboard extends React.PureComponent<Props, State> {\nconst existingURIs = new Set(mediaURIs);\nlet first = true;\nconst selections = assets\n- .map(({ height, width, uri, filename, mediaType, duration }) => {\n+ .map(asset => {\n+ const { height, width, filename, mediaType, duration } = asset;\nconst isVideo = mediaType === MediaLibrary.MediaType.video;\n+ const uri = getCompatibleMediaURI(\n+ asset.uri,\n+ extensionFromFilename(filename),\n+ );\nif (existingURIs.has(uri)) {\nif (first) {\n" }, { "change_type": "MODIFY", "old_path": "native/utils/media-utils.js", "new_path": "native/utils/media-utils.js", "diff": "@@ -133,10 +133,10 @@ function blobToDataURI(blob: Blob): Promise<string> {\nfileReader.abort();\nreject(error);\n};\n- fileReader.onload = event => {\n+ fileReader.onload = () => {\ninvariant(\n- typeof fileReader.result === \"string\",\n- \"FileReader.readAsDataURL should result in string\",\n+ typeof fileReader.result === 'string',\n+ 'FileReader.readAsDataURL should result in string',\n);\nresolve(fileReader.result);\n};\n@@ -361,7 +361,10 @@ async function convertMedia(\nreturn finish();\n}\n-function getCompatibleMediaURI(uri: string, ext: string): string {\n+function getCompatibleMediaURI(uri: string, ext: ?string): string {\n+ if (!ext) {\n+ return uri;\n+ }\nif (!uri.startsWith('ph://') && !uri.startsWith('ph-upload://')) {\nreturn uri;\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Reintrodude getCompatibleMediaURI in MediaGalleryKeyboard We should continue doing this just in case `expo-media-library` starts returning the `ph://` URLs, since uploading those URLs triggers undesired image preprocessing ahead of upload on iOS
129,187
13.04.2020 12:05:15
14,400
5b7e754f6d97caf57d2391d1b91aea2a4b4b4fdd
Include mediaNativeID in MediaLibrarySelection
[ { "change_type": "MODIFY", "old_path": "lib/types/media-types.js", "new_path": "lib/types/media-types.js", "diff": "@@ -108,12 +108,14 @@ export type MediaLibrarySelection =\ndimensions: Dimensions,\nfilename: string,\nuri: string,\n+ mediaNativeID: string,\n|}\n| {|\nstep: 'video_library',\ndimensions: Dimensions,\nfilename: string,\nuri: string,\n+ mediaNativeID: string,\nplayableDuration: number,\n|};\n" }, { "change_type": "MODIFY", "old_path": "native/input/input-state-container.react.js", "new_path": "native/input/input-state-container.react.js", "diff": "@@ -466,6 +466,7 @@ class InputStateContainer extends React.PureComponent<Props, State> {\nuri: selection.uri,\ndimensions: selection.dimensions,\nfilename: selection.filename,\n+ mediaNativeID: selection.mediaNativeID,\n};\n} else if (selection.step === 'photo_capture') {\nmediaInfo = {\n@@ -480,6 +481,7 @@ class InputStateContainer extends React.PureComponent<Props, State> {\nuri: selection.uri,\ndimensions: selection.dimensions,\nfilename: selection.filename,\n+ mediaNativeID: selection.mediaNativeID,\n};\n} else {\ninvariant(false, `invalid selection ${JSON.stringify(selection)}`);\n" }, { "change_type": "MODIFY", "old_path": "native/media/media-gallery-keyboard.react.js", "new_path": "native/media/media-gallery-keyboard.react.js", "diff": "@@ -225,7 +225,7 @@ class MediaGalleryKeyboard extends React.PureComponent<Props, State> {\nlet first = true;\nconst selections = assets\n.map(asset => {\n- const { height, width, filename, mediaType, duration } = asset;\n+ const { id, height, width, filename, mediaType, duration } = asset;\nconst isVideo = mediaType === MediaLibrary.MediaType.video;\nconst uri = getCompatibleMediaURI(\nasset.uri,\n@@ -250,6 +250,7 @@ class MediaGalleryKeyboard extends React.PureComponent<Props, State> {\ndimensions: { height, width },\nuri,\nfilename,\n+ mediaNativeID: id,\nplayableDuration: duration,\n};\n} else {\n@@ -258,6 +259,7 @@ class MediaGalleryKeyboard extends React.PureComponent<Props, State> {\ndimensions: { height, width },\nuri,\nfilename,\n+ mediaNativeID: id,\n};\n}\n})\n" }, { "change_type": "MODIFY", "old_path": "native/utils/media-utils.js", "new_path": "native/utils/media-utils.js", "diff": "@@ -11,6 +11,7 @@ import { Image } from 'react-native';\nimport base64 from 'base-64';\nimport ImageResizer from 'react-native-image-resizer';\nimport invariant from 'invariant';\n+import * as MediaLibrary from 'expo-media-library';\nimport {\nfileInfoFromData,\n@@ -40,12 +41,14 @@ type ClientPhotoInfo = {|\nuri: string,\ndimensions: Dimensions,\nfilename: string,\n+ mediaNativeID?: string,\n|};\ntype ClientVideoInfo = {|\ntype: 'video',\nuri: string,\ndimensions: Dimensions,\nfilename: string,\n+ mediaNativeID?: string,\n|};\ntype ClientMediaInfo = ClientPhotoInfo | ClientVideoInfo;\n@@ -69,7 +72,7 @@ async function validateMedia(\nsteps: $ReadOnlyArray<MediaMissionStep>,\nresult: MediaMissionFailure | MediaValidationResult,\n|}> {\n- const { dimensions, uri, type, filename } = mediaInfo;\n+ const { dimensions, uri, type, filename, mediaNativeID } = mediaInfo;\nconst blobFetchStart = Date.now();\nlet blob, reportedMIME, reportedMediaType;\n@@ -103,6 +106,7 @@ async function validateMedia(\nuri,\ndimensions,\nfilename,\n+ mediaNativeID,\nblob,\n};\n} else {\n@@ -119,6 +123,7 @@ async function validateMedia(\nuri,\ndimensions,\nfilename,\n+ mediaNativeID,\nblob,\n};\n}\n@@ -239,6 +244,12 @@ async function convertMedia(\nshouldDisposePath = validationResult.uri !== uploadURI ? uploadURI : null;\nmime = 'video/mp4';\n} else if (validationResult.type === 'photo') {\n+ const { mediaNativeID } = validationResult;\n+ if (mediaNativeID) {\n+ const assetInfo = await MediaLibrary.getAssetInfoAsync(mediaNativeID);\n+ console.log(assetInfo.orientation);\n+ }\n+\nconst { type: reportedMIME, size } = validationResult.blob;\nif (\nreportedMIME === 'image/heic' ||\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Include mediaNativeID in MediaLibrarySelection
129,187
13.04.2020 17:30:42
14,400
bfcc95f0d0981e828b49f27e27ffb5baa4c894f4
[native] expo-image-manipulator
[ { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -13,6 +13,10 @@ PODS:\n- React-Core\n- UMCore\n- UMImageLoaderInterface\n+ - EXImageManipulator (8.1.0):\n+ - UMCore\n+ - UMFileSystemInterface\n+ - UMImageLoaderInterface\n- EXMediaLibrary (8.1.0):\n- UMCore\n- UMFileSystemInterface\n@@ -349,6 +353,7 @@ DEPENDENCIES:\n- EXConstants (from `../../node_modules/expo-constants/ios`)\n- EXFileSystem (from `../../node_modules/expo-file-system/ios`)\n- EXImageLoader (from `../../node_modules/expo-image-loader/ios`)\n+ - EXImageManipulator (from `../../node_modules/expo-image-manipulator/ios`)\n- EXMediaLibrary (from `../../node_modules/expo-media-library/ios`)\n- EXPermissions (from `../../node_modules/expo-permissions/ios`)\n- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)\n@@ -442,6 +447,8 @@ EXTERNAL SOURCES:\n:path: \"../../node_modules/expo-file-system/ios\"\nEXImageLoader:\n:path: \"../../node_modules/expo-image-loader/ios\"\n+ EXImageManipulator:\n+ :path: \"../../node_modules/expo-image-manipulator/ios\"\nEXMediaLibrary:\n:path: \"../../node_modules/expo-media-library/ios\"\nEXPermissions:\n@@ -590,6 +597,7 @@ SPEC CHECKSUMS:\nEXConstants: 5304709b1bea70a4828f48ba4c7fc3ec3b2d9b17\nEXFileSystem: cf4232ba7c62dc49b78c2d36005f97b6fddf0b01\nEXImageLoader: 5ad6896fa1ef2ee814b551873cbf7a7baccc694a\n+ EXImageManipulator: 97f61d14c292714d66884e83697e794f8cefe0b0\nEXMediaLibrary: 02a13521d05ca381b08f7d745a9602569eade072\nEXPermissions: 24b97f734ce9172d245a5be38ad9ccfcb6135964\nFBLazyVector: aaeaf388755e4f29cd74acbc9e3b8da6d807c37f\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"@react-native-community/cameraroll\": \"^1.5.2\",\n\"@react-native-community/netinfo\": \"^4.4.0\",\n\"base-64\": \"^0.1.0\",\n+ \"expo-image-manipulator\": \"^8.1.0\",\n\"expo-media-library\": \"^8.1.0\",\n\"find-root\": \"^1.1.0\",\n\"hoist-non-react-statics\": \"^3.1.0\",\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "@@ -5761,6 +5761,11 @@ expo-image-loader@~1.0.0:\nresolved \"https://registry.yarnpkg.com/expo-image-loader/-/expo-image-loader-1.0.1.tgz#a83e336768df4dfcb8909aebb6d8152e256d7a72\"\nintegrity sha512-v7ziP+UGj+LArEmP//XTaqi9iFWRa8LAShNoFwwnpPS9huM8q3I+P16xK+GTo+4bQa1pPSIFBUZ8KqwAc+k8mQ==\n+expo-image-manipulator@^8.1.0:\n+ version \"8.1.0\"\n+ resolved \"https://registry.yarnpkg.com/expo-image-manipulator/-/expo-image-manipulator-8.1.0.tgz#63ae66e1a65e5be8c6ee7036fe88d53af551853f\"\n+ integrity sha512-ephPXtzEx32Js1SQ1B2IXdpi4Gn34DIMQGAOwrwOPfUuWXQX9jGxyX3tktIGMmQ7lHueVr0a8zdh6ME0YGHjkw==\n+\nexpo-media-library@^8.1.0:\nversion \"8.1.0\"\nresolved \"https://registry.yarnpkg.com/expo-media-library/-/expo-media-library-8.1.0.tgz#f5d4b24819aa518e69d971f92b55c12f60c85ba5\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] expo-image-manipulator
129,187
13.04.2020 18:09:13
14,400
a691c44bfb175092e0ca2e102bff6f87800276d1
[native] Don't fetch exif info twice in expo-media-library on Android side
[ { "change_type": "MODIFY", "old_path": "patches/expo-media-library+8.1.0.patch", "new_path": "patches/expo-media-library+8.1.0.patch", "diff": "@@ -94,7 +94,7 @@ index bfe25f3..edde485 100644\nPermissions permissionsManager = mModuleRegistry.getModule(Permissions.class);\nif (permissionsManager == null) {\ndiff --git a/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/MediaLibraryUtils.java b/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/MediaLibraryUtils.java\n-index da5bd28..a881ed3 100644\n+index da5bd28..7d70a64 100644\n--- a/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/MediaLibraryUtils.java\n+++ b/node_modules/expo-media-library/android/src/main/java/expo/modules/medialibrary/MediaLibraryUtils.java\n@@ -144,21 +144,42 @@ index da5bd28..a881ed3 100644\nfinal int idIndex = cursor.getColumnIndex(Media._ID);\nfinal int filenameIndex = cursor.getColumnIndex(Media.DISPLAY_NAME);\nfinal int mediaTypeIndex = cursor.getColumnIndex(Files.FileColumns.MEDIA_TYPE);\n-@@ -144,7 +149,7 @@ final class MediaLibraryUtils {\n+@@ -142,9 +147,16 @@ final class MediaLibraryUtils {\n+ return;\n+ }\nfor (int i = 0; i < limit && !cursor.isAfterLast(); i++) {\n- String localUri = \"file://\" + cursor.getString(localUriIndex);\n+- String localUri = \"file://\" + cursor.getString(localUriIndex);\n++ String path = cursor.getString(localUriIndex);\n++ String localUri = \"file://\" + path;\nint mediaType = cursor.getInt(mediaTypeIndex);\n- int[] size = getSizeFromCursor(cursor, mediaType, localUriIndex);\n-+ int[] size = getSizeFromCursor(contentResolver, cursor, mediaType, localUriIndex);\n++\n++ ExifInterface exifInterface = null;\n++ if (mediaType == Files.FileColumns.MEDIA_TYPE_IMAGE) {\n++ exifInterface = new ExifInterface(path);\n++ }\n++\n++ int[] size = getSizeFromCursor(contentResolver, exifInterface, cursor, mediaType, localUriIndex);\nBundle asset = new Bundle();\nasset.putString(\"id\", cursor.getString(idIndex));\n-@@ -213,25 +218,68 @@ final class MediaLibraryUtils {\n+@@ -159,8 +171,8 @@ final class MediaLibraryUtils {\n+ asset.putString(\"albumId\", cursor.getString(albumIdIndex));\n+\n+ if (fullInfo) {\n+- if (mediaType == Files.FileColumns.MEDIA_TYPE_IMAGE) {\n+- getExifFullInfo(cursor, asset);\n++ if (exifInterface != null) {\n++ getExifFullInfo(exifInterface, asset);\n+ }\n+\n+ asset.putString(\"localUri\", localUri);\n+@@ -213,25 +225,66 @@ final class MediaLibraryUtils {\nreturn MEDIA_TYPES.get(mediaType);\n}\n- static int[] getSizeFromCursor(Cursor cursor, int mediaType, int localUriIndex){\n-+ static int[] getSizeFromCursor(ContentResolver contentResolver, Cursor cursor, int mediaType, int localUriIndex) {\n++ static int[] getSizeFromCursor(ContentResolver contentResolver, ExifInterface exifInterface, Cursor cursor, int mediaType, int localUriIndex) {\n+ final String uri = cursor.getString(localUriIndex);\n+\n+ if (mediaType == Files.FileColumns.MEDIA_TYPE_VIDEO) {\n@@ -214,9 +235,8 @@ index da5bd28..a881ed3 100644\n- size = maybeRotateAssetSize(options.outWidth, options.outHeight, cursor.getInt(orientationIndex));\n- } else {\n- size = maybeRotateAssetSize(cursor.getInt(widthIndex), cursor.getInt(heightIndex), cursor.getInt(orientationIndex));\n-+ try {\n-+ ExifInterface exif = new ExifInterface(uri);\n-+ int exifOrientation = exif.getAttributeInt(\n++ if (exifInterface != null) {\n++ int exifOrientation = exifInterface.getAttributeInt(\n+ ExifInterface.TAG_ORIENTATION,\n+ ExifInterface.ORIENTATION_NORMAL\n+ );\n@@ -228,7 +248,6 @@ index da5bd28..a881ed3 100644\n+ ) {\n+ orientation = 90;\n+ }\n-+ } catch (IOException e) {\n}\n- return size;\n+\n@@ -236,6 +255,17 @@ index da5bd28..a881ed3 100644\n}\nstatic int[] maybeRotateAssetSize(int width, int height, int orientation) {\n+@@ -265,9 +318,7 @@ final class MediaLibraryUtils {\n+ return TextUtils.join(\",\", result);\n+ }\n+\n+- static void getExifFullInfo(Cursor cursor, Bundle response) throws IOException {\n+- File input = new File(cursor.getString(cursor.getColumnIndex(Media.DATA)));\n+- ExifInterface exifInterface = new ExifInterface(input.getPath());\n++ static void getExifFullInfo(ExifInterface exifInterface, Bundle response) {\n+ Bundle exifMap = new Bundle();\n+ for (String[] tagInfo : exifTags) {\n+ String name = tagInfo[1];\ndiff --git a/node_modules/expo-media-library/ios/EXMediaLibrary.podspec b/node_modules/expo-media-library/ios/EXMediaLibrary.podspec\nindex 7cc9e70..a5b5336 100644\n--- a/node_modules/expo-media-library/ios/EXMediaLibrary.podspec\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Don't fetch exif info twice in expo-media-library on Android side
129,187
13.04.2020 18:09:55
14,400
1787f289fea32fef69d41ce5344d657dd3090c05
[native] Use expo-image-manipulator instead of ImageResizer
[ { "change_type": "MODIFY", "old_path": "lib/types/media-types.js", "new_path": "lib/types/media-types.js", "diff": "@@ -163,14 +163,19 @@ export type MediaMissionStep =\nsize: ?number,\n|}\n| {|\n- step: 'photo_resize_transcode',\n+ step: 'exif_fetch',\nsuccess: boolean,\ntime: number, // ms\n+ orientation: ?number,\n+ |}\n+ | {|\n+ step: 'photo_manipulation',\n+ success: boolean,\n+ time: number, // ms\n+ manipulation: Object,\nnewMIME: ?string,\nnewDimensions: ?Dimensions,\nnewURI: ?string,\n- newPath: ?string,\n- newName: ?string,\n|}\n| {|\nstep: 'video_copy',\n@@ -221,7 +226,7 @@ export type MediaMissionStep =\nexport type MediaMissionFailure =\n| {|\nsuccess: false,\n- reason: 'too_large_cant_downscale',\n+ reason: 'photo_manipulation_failed',\nsize: number, // in bytes\n|}\n| {|\n@@ -297,14 +302,19 @@ export const mediaMissionPropType = PropTypes.shape({\nsize: PropTypes.number,\n}),\nPropTypes.shape({\n- step: PropTypes.oneOf(['photo_resize_transcode']).isRequired,\n+ step: PropTypes.oneOf(['exif_fetch']).isRequired,\nsuccess: PropTypes.bool.isRequired,\ntime: PropTypes.number.isRequired,\n+ orientation: PropTypes.number,\n+ }),\n+ PropTypes.shape({\n+ step: PropTypes.oneOf(['photo_manipulation']).isRequired,\n+ success: PropTypes.bool.isRequired,\n+ time: PropTypes.number.isRequired,\n+ manipulation: PropTypes.object.isRequired,\nnewMIME: PropTypes.string,\nnewDimensions: dimensionsPropType,\nnewURI: PropTypes.string,\n- newPath: PropTypes.string,\n- newName: PropTypes.string,\n}),\nPropTypes.shape({\nstep: PropTypes.oneOf(['video_copy']).isRequired,\n@@ -367,7 +377,7 @@ export const mediaMissionPropType = PropTypes.shape({\n}),\nPropTypes.shape({\nsuccess: PropTypes.oneOf([false]).isRequired,\n- reason: PropTypes.oneOf(['too_large_cant_downscale']).isRequired,\n+ reason: PropTypes.oneOf(['photo_manipulation_failed']).isRequired,\nsize: PropTypes.number.isRequired,\n}),\nPropTypes.shape({\n" }, { "change_type": "MODIFY", "old_path": "native/utils/media-utils.js", "new_path": "native/utils/media-utils.js", "diff": "@@ -7,16 +7,16 @@ import type {\nMediaMissionFailure,\n} from 'lib/types/media-types';\n-import { Image } from 'react-native';\n+import { Image, Platform } from 'react-native';\nimport base64 from 'base-64';\n-import ImageResizer from 'react-native-image-resizer';\nimport invariant from 'invariant';\nimport * as MediaLibrary from 'expo-media-library';\n+import * as ImageManipulator from 'expo-image-manipulator';\nimport {\nfileInfoFromData,\nmimeTypesToMediaTypes,\n- stripExtension,\n+ pathFromURI,\n} from 'lib/utils/file-utils';\nimport { transcodeVideo } from './video-utils';\n@@ -204,7 +204,6 @@ async function convertMedia(\nlet steps = [];\nlet uploadURI = validationResult.uri,\ndimensions = validationResult.dimensions,\n- shouldDisposePath = null,\nname = validationResult.filename,\nmime = null,\nmediaType = validationResult.type;\n@@ -216,6 +215,8 @@ async function convertMedia(\nmime,\n\"if we're finishing successfully we should have a MIME type\",\n);\n+ const shouldDisposePath =\n+ validationResult.uri !== uploadURI ? pathFromURI(uploadURI) : null;\nreturn {\nsteps,\nresult: {\n@@ -240,58 +241,95 @@ async function convertMedia(\nreturn finish(transcodeResult);\n}\nuploadURI = transcodeResult.uri;\n- name = transcodeResult.filename;\n- shouldDisposePath = validationResult.uri !== uploadURI ? uploadURI : null;\nmime = 'video/mp4';\n} else if (validationResult.type === 'photo') {\n+ const { type: reportedMIME, size } = validationResult.blob;\n+ const needsCompression = reportedMIME === 'image/heic' || size > 5e6;\n+ let needsProcessing = false;\n+ const transforms = [];\n+\nconst { mediaNativeID } = validationResult;\nif (mediaNativeID) {\n+ let orientation = undefined;\n+ let exifFetchSuccess = false;\n+ const exifFetchStart = Date.now();\n+ try {\nconst assetInfo = await MediaLibrary.getAssetInfoAsync(mediaNativeID);\n- console.log(assetInfo.orientation);\n+ if (Platform.OS === 'ios') {\n+ orientation = assetInfo.orientation;\n+ } else {\n+ orientation = assetInfo.exif && assetInfo.exif.Orientation;\n}\n-\n- const { type: reportedMIME, size } = validationResult.blob;\n+ exifFetchSuccess = true;\n+ } catch {}\n+ steps.push({\n+ step: 'exif_fetch',\n+ success: exifFetchSuccess,\n+ time: Date.now() - exifFetchStart,\n+ orientation,\n+ });\nif (\n- reportedMIME === 'image/heic' ||\n- size > 5e6 ||\n- (size > 5e5 && (dimensions.width > 3000 || dimensions.height > 2000))\n+ orientation === 2 ||\n+ orientation === 4 ||\n+ orientation === 5 ||\n+ orientation === 7\n) {\n+ transforms.push({ flip: ImageManipulator.FlipType.Horizontal });\n+ }\n+ if (orientation === 3 || orientation === 4) {\n+ transforms.push({ rotate: 180 });\n+ } else if (orientation === 5 || orientation === 6) {\n+ transforms.push({ rotate: -90 });\n+ } else if (orientation === 7 || orientation === 8) {\n+ transforms.push({ rotate: 90 });\n+ }\n+ }\n+\n+ // The dimensions we have are actually the post-rotation dimensions\n+ if (size > 5e5 && (dimensions.width > 3000 || dimensions.height > 2000)) {\n+ if (dimensions.width / dimensions.height > 1.5) {\n+ transforms.push({ width: 3000 });\n+ } else {\n+ transforms.push({ height: 2000 });\n+ }\n+ }\n+\n+ if (needsCompression || needsProcessing || transforms.length > 0) {\n+ const format =\n+ reportedMIME === 'image/png'\n+ ? ImageManipulator.SaveFormat.PNG\n+ : ImageManipulator.SaveFormat.JPEG;\n+ const compress = needsCompression ? 0.92 : 1;\n+ const saveConfig = { format, compress };\n+ let photoResizeSuccess = false;\nconst photoResizeStart = Date.now();\ntry {\n- const compressFormat = reportedMIME === 'image/png' ? 'PNG' : 'JPEG';\n- const compressQuality = size > 5e6 ? 92 : 100;\n- const { uri: resizedURI, path } = await ImageResizer.createResizedImage(\n+ const manipulationResult = await ImageManipulator.manipulateAsync(\nuploadURI,\n- 3000,\n- 2000,\n- compressFormat,\n- compressQuality,\n+ transforms,\n+ saveConfig,\n);\n- uploadURI = resizedURI;\n- if (reportedMIME === 'image/png' && !name.endsWith('.png')) {\n- name = `${stripExtension(name)}.png`;\n- } else if (reportedMIME !== 'image/png' && !name.endsWith('.jpg')) {\n- name = `${stripExtension(name)}.jpg`;\n- }\n- shouldDisposePath = path;\n+ photoResizeSuccess = true;\n+ uploadURI = manipulationResult.uri;\n+ dimensions = {\n+ width: manipulationResult.width,\n+ height: manipulationResult.height,\n+ };\nmime = reportedMIME === 'image/png' ? 'image/png' : 'image/jpeg';\n- dimensions = await getDimensions(resizedURI);\n- } catch (e) {}\n- const success = uploadURI !== validationResult.uri;\n+ } catch {}\nsteps.push({\n- step: 'photo_resize_transcode',\n- success,\n+ step: 'photo_manipulation',\n+ manipulation: { transforms, saveConfig },\n+ success: photoResizeSuccess,\ntime: Date.now() - photoResizeStart,\n- newMIME: success ? mime : null,\n- newDimensions: success ? dimensions : null,\n- newURI: success ? uploadURI : null,\n- newPath: success ? shouldDisposePath : null,\n- newName: success ? name : null,\n+ newMIME: photoResizeSuccess ? mime : null,\n+ newDimensions: photoResizeSuccess ? dimensions : null,\n+ newURI: photoResizeSuccess ? uploadURI : null,\n});\n- if (!success) {\n+ if (!photoResizeSuccess) {\nreturn finish({\nsuccess: false,\n- reason: 'too_large_cant_downscale',\n+ reason: 'photo_manipulation_failed',\nsize,\n});\n}\n@@ -425,5 +463,6 @@ export {\nblobToDataURI,\ndataURIToIntArray,\nprocessMedia,\n+ getDimensions,\ngetCompatibleMediaURI,\n};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Use expo-image-manipulator instead of ImageResizer
129,187
13.04.2020 18:10:54
14,400
848859185ab5cc1d04c00fdfc23a053819ca5a3d
[native] ImageManipulator automatically rotates/flips images based on exif data
[ { "change_type": "MODIFY", "old_path": "native/utils/media-utils.js", "new_path": "native/utils/media-utils.js", "diff": "@@ -268,20 +268,8 @@ async function convertMedia(\ntime: Date.now() - exifFetchStart,\norientation,\n});\n- if (\n- orientation === 2 ||\n- orientation === 4 ||\n- orientation === 5 ||\n- orientation === 7\n- ) {\n- transforms.push({ flip: ImageManipulator.FlipType.Horizontal });\n- }\n- if (orientation === 3 || orientation === 4) {\n- transforms.push({ rotate: 180 });\n- } else if (orientation === 5 || orientation === 6) {\n- transforms.push({ rotate: -90 });\n- } else if (orientation === 7 || orientation === 8) {\n- transforms.push({ rotate: 90 });\n+ if (orientation && orientation > 1) {\n+ needsProcessing = true;\n}\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] ImageManipulator automatically rotates/flips images based on exif data
129,187
13.04.2020 18:14:37
14,400
244c27acdfae316ffbd67ff78e3bbb2bd4a8f986
[native] Get rid of react-native-image-resizer
[ { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -234,8 +234,6 @@ PODS:\n- react-native-ffmpeg/min-lts (0.4.0):\n- mobile-ffmpeg-min (= 4.2.2.LTS)\n- React\n- - react-native-image-resizer (1.0.1):\n- - React\n- react-native-in-app-message (1.0.2):\n- React\n- react-native-mov-to-mp4 (0.2.2):\n@@ -377,7 +375,6 @@ DEPENDENCIES:\n- react-native-camera (from `../../node_modules/react-native-camera`)\n- \"react-native-cameraroll (from `../../node_modules/@react-native-community/cameraroll`)\"\n- react-native-ffmpeg/min-lts (from `../../node_modules/react-native-ffmpeg/ios/react-native-ffmpeg.podspec`)\n- - react-native-image-resizer (from `../../node_modules/react-native-image-resizer`)\n- react-native-in-app-message (from `../../node_modules/react-native-in-app-message`)\n- react-native-mov-to-mp4 (from `../../node_modules/react-native-mov-to-mp4`)\n- \"react-native-netinfo (from `../../node_modules/@react-native-community/netinfo`)\"\n@@ -491,8 +488,6 @@ EXTERNAL SOURCES:\n:path: \"../../node_modules/@react-native-community/cameraroll\"\nreact-native-ffmpeg:\n:podspec: \"../../node_modules/react-native-ffmpeg/ios/react-native-ffmpeg.podspec\"\n- react-native-image-resizer:\n- :path: \"../../node_modules/react-native-image-resizer\"\nreact-native-in-app-message:\n:path: \"../../node_modules/react-native-in-app-message\"\nreact-native-mov-to-mp4:\n@@ -621,7 +616,6 @@ SPEC CHECKSUMS:\nreact-native-camera: 21cf4ed26cf432ceb1fae959aa6924943fd6f714\nreact-native-cameraroll: 4360c9faab50dc6844f56d222c2d0c7ef5f1fe92\nreact-native-ffmpeg: 35e303059e3c958cb74e271a45f9391d044f915a\n- react-native-image-resizer: 48eb06a18a6d0a632ffa162a51ca61a68fb5322f\nreact-native-in-app-message: f91de5009620af01456531118264c93e249b83ec\nreact-native-mov-to-mp4: bfdafbd4ec9bd9290c779360810d1edae1f29310\nreact-native-netinfo: 6bb847e64f45a2d69c6173741111cfd95c669301\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"react-native-fs\": \"2.15.2\",\n\"react-native-gesture-handler\": \"^1.6.1\",\n\"react-native-hyperlink\": \"git+https://git@github.com/ashoat/react-native-hyperlink.git#both\",\n- \"react-native-image-resizer\": \"^1.0.1\",\n\"react-native-in-app-message\": \"^1.0.2\",\n\"react-native-keyboard-input\": \"^6.0.0\",\n\"react-native-keychain\": \"^4.0.0\",\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "@@ -11651,11 +11651,6 @@ react-native-gesture-handler@^1.6.1:\nlinkify-it \"^1.2.0\"\nmdurl \"^1.0.0\"\n-react-native-image-resizer@^1.0.1:\n- version \"1.0.1\"\n- resolved \"https://registry.yarnpkg.com/react-native-image-resizer/-/react-native-image-resizer-1.0.1.tgz#e9eeb7f81596ffc490f822897952b046c07ee95c\"\n- integrity sha512-upBF/9TIs4twg19dSkSaDW/MzMpNbysEXtPuapu3GqvOuGIYHKQ30v6httDn7rIb6uCcNIWL1BwZJM2cDt/C9Q==\n-\nreact-native-in-app-message@^1.0.2:\nversion \"1.0.2\"\nresolved \"https://registry.yarnpkg.com/react-native-in-app-message/-/react-native-in-app-message-1.0.2.tgz#e971c039bcd0e238306f73fbea43fc866aa94a69\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Get rid of react-native-image-resizer
129,187
13.04.2020 18:23:36
14,400
180e604bdf8a3c6c3a9ea6fa1cf0d307b517f7c8
[native] Hide YellowBox warning about ForceTouchGestureHandler caused by react-native-in-app-message
[ { "change_type": "MODIFY", "old_path": "native/push/push-handler.react.js", "new_path": "native/push/push-handler.react.js", "diff": "@@ -83,6 +83,7 @@ import { replaceWithThreadActionType } from '../navigation/action-types';\nYellowBox.ignoreWarnings([\n'Require cycle: ../node_modules/react-native-firebase',\n+ 'ForceTouchGestureHandler is not available', // react-native-in-app-message\n]);\nconst msInDay = 24 * 60 * 60 * 1000;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Hide YellowBox warning about ForceTouchGestureHandler caused by react-native-in-app-message
129,187
14.04.2020 19:08:24
14,400
033939ef3ffa0c738ba72cc61fdde3b31e6619a6
[server] Use dimensions from client if provided when saving uploads
[ { "change_type": "MODIFY", "old_path": "server/src/creators/upload-creator.js", "new_path": "server/src/creators/upload-creator.js", "diff": "// @flow\n-import type { MediaType, UploadMultimediaResult } from 'lib/types/media-types';\n+import type {\n+ MediaType,\n+ UploadMultimediaResult,\n+ Dimensions,\n+} from 'lib/types/media-types';\nimport type { Viewer } from '../session/viewer';\nimport crypto from 'crypto';\n-import sizeOf from 'buffer-image-size';\nimport { ServerError } from 'lib/utils/errors';\nimport { shimUploadURI } from 'lib/shared/media-utils';\n@@ -13,19 +16,12 @@ import { dbQuery, SQL } from '../database';\nimport createIDs from './id-creator';\nimport { getUploadURL } from '../fetchers/upload-fetchers';\n-function uploadExtras(upload: UploadInput) {\n- if (upload.mediaType !== 'photo') {\n- return null;\n- }\n- const { height, width } = sizeOf(upload.buffer);\n- return JSON.stringify({ height, width });\n-}\n-\nexport type UploadInput = {|\nname: string,\nmime: string,\nmediaType: MediaType,\nbuffer: Buffer,\n+ dimensions: Dimensions,\n|};\nasync function createUploads(\nviewer: Viewer,\n@@ -46,7 +42,7 @@ async function createUploads(\nuploadInfo.buffer,\nsecret,\nDate.now(),\n- uploadExtras(uploadInfo),\n+ JSON.stringify(uploadInfo.dimensions),\n]);\nconst insertQuery = SQL`\n" }, { "change_type": "MODIFY", "old_path": "server/src/uploads/media-utils.js", "new_path": "server/src/uploads/media-utils.js", "diff": "// @flow\nimport type { UploadInput } from '../creators/upload-creator';\n+import type { Dimensions } from 'lib/types/media-types';\nimport sharp from 'sharp';\n+import sizeOf from 'buffer-image-size';\nimport { fileInfoFromData } from 'lib/utils/file-utils';\n@@ -10,9 +12,15 @@ const fiveMegabytes = 5 * 1024 * 1024;\nconst allowedMimeTypes = new Set(['image/png', 'image/jpeg', 'image/gif']);\n+function getDimensions(buffer: Buffer): Dimensions {\n+ const { height, width } = sizeOf(buffer);\n+ return { height, width };\n+}\n+\nasync function validateAndConvert(\ninitialBuffer: Buffer,\ninitialName: string,\n+ inputDimensions: ?Dimensions,\nsize: number, // in bytes\n): Promise<?UploadInput> {\nconst { mime, mediaType, name } = fileInfoFromData(\n@@ -28,11 +36,15 @@ async function validateAndConvert(\nreturn null;\n}\nif (size < fiveMegabytes && (mime === 'image/png' || mime === 'image/jpeg')) {\n+ const dimensions = inputDimensions\n+ ? inputDimensions\n+ : getDimensions(initialBuffer);\nreturn {\nmime,\nmediaType,\nname,\nbuffer: initialBuffer,\n+ dimensions,\n};\n}\n@@ -62,11 +74,16 @@ async function validateAndConvert(\nif (!convertedMIME || !convertedMediaType || !convertedName) {\nreturn null;\n}\n+\n+ const dimensions = inputDimensions\n+ ? inputDimensions\n+ : getDimensions(convertedBuffer);\nreturn {\nmime: convertedMIME,\nmediaType: convertedMediaType,\nname: convertedName,\nbuffer: convertedBuffer,\n+ dimensions,\n};\n}\n" }, { "change_type": "MODIFY", "old_path": "server/src/uploads/uploads.js", "new_path": "server/src/uploads/uploads.js", "diff": "@@ -5,6 +5,7 @@ import type { $Request } from 'express';\nimport type {\nUploadMultimediaResult,\nUploadDeletionRequest,\n+ Dimensions,\n} from 'lib/types/media-types';\nimport multer from 'multer';\n@@ -44,11 +45,25 @@ async function multimediaUploadResponder(\nif (overrideFilename && typeof overrideFilename !== 'string') {\nthrow new ServerError('invalid_parameters');\n}\n+\n+ const overrideHeight =\n+ files.length === 1 && body.height ? parseInt(body.height) : null;\n+ const overrideWidth =\n+ files.length === 1 && body.width ? parseInt(body.width) : null;\n+ if (!!overrideHeight !== !!overrideWidth) {\n+ throw new ServerError('invalid_parameters');\n+ }\n+ const overrideDimensions: ?Dimensions =\n+ overrideHeight && overrideWidth\n+ ? { height: overrideHeight, width: overrideWidth }\n+ : null;\n+\nconst validationResults = await Promise.all(\nfiles.map(({ buffer, size, originalname }) =>\nvalidateAndConvert(\nbuffer,\noverrideFilename ? overrideFilename : originalname,\n+ overrideDimensions,\nsize,\n),\n),\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[server] Use dimensions from client if provided when saving uploads
129,187
14.04.2020 23:44:03
14,400
bf45a0a6bfa6010bf9090e13e26b6e53fbccbc00
Client sends Dimensions on media upload
[ { "change_type": "MODIFY", "old_path": "lib/actions/upload-actions.js", "new_path": "lib/actions/upload-actions.js", "diff": "// @flow\nimport type { FetchJSON } from '../utils/fetch-json';\n-import type { UploadMultimediaResult } from '../types/media-types';\n+import type { UploadMultimediaResult, Dimensions } from '../types/media-types';\nimport type { UploadBlob } from '../utils/upload-blob';\nexport type MultimediaUploadCallbacks = $Shape<{|\n@@ -13,6 +13,7 @@ export type MultimediaUploadCallbacks = $Shape<{|\nasync function uploadMultimedia(\nfetchJSON: FetchJSON,\nmultimedia: Object,\n+ dimensions: Dimensions,\ncallbacks?: MultimediaUploadCallbacks,\n): Promise<UploadMultimediaResult> {\nconst onProgress = callbacks && callbacks.onProgress;\n@@ -20,7 +21,11 @@ async function uploadMultimedia(\nconst uploadBlob = callbacks && callbacks.uploadBlob;\nconst response = await fetchJSON(\n'upload_multimedia',\n- { multimedia: [multimedia] },\n+ {\n+ multimedia: [multimedia],\n+ height: dimensions.height.toString(),\n+ width: dimensions.width.toString(),\n+ },\n{\nonProgress,\nabortHandler,\n" }, { "change_type": "MODIFY", "old_path": "lib/utils/upload-blob.js", "new_path": "lib/utils/upload-blob.js", "diff": "@@ -34,7 +34,7 @@ function uploadBlob(\n}\nfor (let key in input) {\n- if (key === 'multimedia') {\n+ if (key === 'multimedia' || key === 'cookie' || key === 'sessionID') {\ncontinue;\n}\nconst value = input[key];\n" }, { "change_type": "MODIFY", "old_path": "native/input/input-state-container.react.js", "new_path": "native/input/input-state-container.react.js", "diff": "@@ -11,6 +11,7 @@ import type {\nMediaSelection,\nMediaMissionResult,\nMediaMission,\n+ Dimensions,\n} from 'lib/types/media-types';\nimport {\nmessageTypes,\n@@ -88,6 +89,7 @@ type Props = {|\n// async functions that hit server APIs\nuploadMultimedia: (\nmultimedia: Object,\n+ dimensions: Dimensions,\ncallbacks: MultimediaUploadCallbacks,\n) => Promise<UploadMultimediaResult>,\nsendMultimediaMessage: (\n@@ -521,6 +523,7 @@ class InputStateContainer extends React.PureComponent<Props, State> {\ntry {\nuploadResult = await this.props.uploadMultimedia(\n{ uri: uploadURI, name, type: mime },\n+ selection.dimensions,\n{\nonProgress: (percent: number) =>\nthis.setProgress(localMessageID, localID, percent),\n@@ -632,6 +635,28 @@ class InputStateContainer extends React.PureComponent<Props, State> {\ntypeof type === 'string',\n'InputStateContainer.uploadBlob sent incorrect input',\n);\n+\n+ const parameters = {};\n+ parameters.cookie = cookie;\n+ parameters.filename = name;\n+\n+ for (let key in input) {\n+ if (\n+ key === 'multimedia' ||\n+ key === 'cookie' ||\n+ key === 'sessionID' ||\n+ key === 'filename'\n+ ) {\n+ continue;\n+ }\n+ const value = input[key];\n+ invariant(\n+ typeof value === 'string',\n+ 'blobUpload calls can only handle string values for non-multimedia keys',\n+ );\n+ parameters[key] = value;\n+ }\n+\nlet path = uri;\nif (Platform.OS === 'android') {\nconst resolvedPath = pathFromURI(uri);\n@@ -647,10 +672,7 @@ class InputStateContainer extends React.PureComponent<Props, State> {\nAccept: 'application/json',\n},\nfield: 'multimedia',\n- parameters: {\n- cookie,\n- filename: name,\n- },\n+ parameters,\n});\nif (options && options.abortHandler) {\noptions.abortHandler(() => {\n" }, { "change_type": "MODIFY", "old_path": "web/chat/chat-input-state-container.react.js", "new_path": "web/chat/chat-input-state-container.react.js", "diff": "// @flow\nimport type { AppState } from '../redux-setup';\n-import type { UploadMultimediaResult } from 'lib/types/media-types';\n+import type { UploadMultimediaResult, Dimensions } from 'lib/types/media-types';\nimport type {\nDispatchActionPayload,\nDispatchActionPromise,\n@@ -63,6 +63,7 @@ type Props = {|\n// async functions that hit server APIs\nuploadMultimedia: (\nmultimedia: Object,\n+ dimensions: Dimensions,\ncallbacks: MultimediaUploadCallbacks,\n) => Promise<UploadMultimediaResult>,\ndeleteUpload: (id: string) => Promise<void>,\n@@ -411,12 +412,16 @@ class ChatInputStateContainer extends React.PureComponent<Props, State> {\nasync uploadFile(threadID: string, upload: PendingMultimediaUpload) {\nlet result;\ntry {\n- result = await this.props.uploadMultimedia(upload.file, {\n+ result = await this.props.uploadMultimedia(\n+ upload.file,\n+ upload.dimensions,\n+ {\nonProgress: (percent: number) =>\nthis.setProgress(threadID, upload.localID, percent),\nabortHandler: (abort: () => void) =>\nthis.handleAbortCallback(threadID, upload.localID, abort),\n- });\n+ },\n+ );\n} catch (e) {\nthis.handleUploadFailure(threadID, upload.localID, e);\nreturn;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Client sends Dimensions on media upload
129,187
15.04.2020 11:29:00
14,400
1b8f72ec2b2abd7966630390d61869f8920bea5a
[native] Get rid of react-native-mov-to-mp4 Apparently has the potential to significantly upscale videos. Produces results that are more than 10x larger than `ffmpeg`, and is only slightly faster
[ { "change_type": "MODIFY", "old_path": "native/ios/Podfile.lock", "new_path": "native/ios/Podfile.lock", "diff": "@@ -236,8 +236,6 @@ PODS:\n- React\n- react-native-in-app-message (1.0.2):\n- React\n- - react-native-mov-to-mp4 (0.2.2):\n- - React\n- react-native-netinfo (4.4.0):\n- React\n- react-native-notifications (1.1.19):\n@@ -376,7 +374,6 @@ DEPENDENCIES:\n- \"react-native-cameraroll (from `../../node_modules/@react-native-community/cameraroll`)\"\n- react-native-ffmpeg/min-lts (from `../../node_modules/react-native-ffmpeg/ios/react-native-ffmpeg.podspec`)\n- react-native-in-app-message (from `../../node_modules/react-native-in-app-message`)\n- - react-native-mov-to-mp4 (from `../../node_modules/react-native-mov-to-mp4`)\n- \"react-native-netinfo (from `../../node_modules/@react-native-community/netinfo`)\"\n- react-native-notifications (from `../../node_modules/react-native-notifications`)\n- react-native-onepassword (from `../../node_modules/react-native-onepassword`)\n@@ -490,8 +487,6 @@ EXTERNAL SOURCES:\n:podspec: \"../../node_modules/react-native-ffmpeg/ios/react-native-ffmpeg.podspec\"\nreact-native-in-app-message:\n:path: \"../../node_modules/react-native-in-app-message\"\n- react-native-mov-to-mp4:\n- :path: \"../../node_modules/react-native-mov-to-mp4\"\nreact-native-netinfo:\n:path: \"../../node_modules/@react-native-community/netinfo\"\nreact-native-notifications:\n@@ -617,7 +612,6 @@ SPEC CHECKSUMS:\nreact-native-cameraroll: 4360c9faab50dc6844f56d222c2d0c7ef5f1fe92\nreact-native-ffmpeg: 35e303059e3c958cb74e271a45f9391d044f915a\nreact-native-in-app-message: f91de5009620af01456531118264c93e249b83ec\n- react-native-mov-to-mp4: bfdafbd4ec9bd9290c779360810d1edae1f29310\nreact-native-netinfo: 6bb847e64f45a2d69c6173741111cfd95c669301\nreact-native-notifications: bb042206ac7eab9323d528c780b3d6fe796c1f5e\nreact-native-onepassword: 5b2b7f425f9db40932703e65d350b78cbc598047\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"react-native-in-app-message\": \"^1.0.2\",\n\"react-native-keyboard-input\": \"^6.0.0\",\n\"react-native-keychain\": \"^4.0.0\",\n- \"react-native-mov-to-mp4\": \"git+https://git@github.com/taltultc/react-native-mov-to-mp4.git#d040c5aad736dd7a4bf1836836a1d62d6ab0d030\",\n\"react-native-notifications\": \"git+https://git@github.com/ashoat/react-native-notifications.git\",\n\"react-native-onepassword\": \"git+https://git@github.com/DriveWealth/react-native-onepassword.git#aed794d8c6f0f2560b62a0012449abf6f1b3576c\",\n\"react-native-orientation-locker\": \"^1.1.6\",\n" }, { "change_type": "MODIFY", "old_path": "native/utils/video-utils.js", "new_path": "native/utils/video-utils.js", "diff": "@@ -8,7 +8,7 @@ import type {\nimport filesystem from 'react-native-fs';\nimport { RNFFmpeg } from 'react-native-ffmpeg';\n-import { NativeModules, Platform } from 'react-native';\n+import { Platform } from 'react-native';\nimport invariant from 'invariant';\nimport {\n@@ -17,8 +17,6 @@ import {\nextensionFromFilename,\n} from 'lib/utils/file-utils';\n-const MovToMp4 = NativeModules.movToMp4;\n-\nif (!__DEV__) {\nRNFFmpeg.disableLogs();\nRNFFmpeg.disableStatistics();\n@@ -109,55 +107,6 @@ async function transcodeVideo<InputInfo: TranscodeVideoInfo>(\nreturn finish();\n}\n- // Next, if we're on iOS we'll try using native libraries to transcode\n- // We special-case iOS because Android doesn't usually need to transcode\n- // iOS defaults to HEVC since iOS 11\n- if (Platform.OS === 'ios') {\n- const iosNativeTranscodeStart = Date.now();\n- try {\n- const [iosNativeTranscodedURI] = await MovToMp4.convertMovToMp4(\n- path,\n- `iostranscode.${Date.now()}.${filename}`,\n- );\n- const iosNativeTranscodedPath = pathFromURI(iosNativeTranscodedURI);\n- invariant(\n- iosNativeTranscodedPath,\n- 'react-native-mov-to-mp4 should return a file:/// uri, not ' +\n- iosNativeTranscodedURI,\n- );\n- createdPaths.push(iosNativeTranscodedPath);\n- const iosTranscodeProbeStep = await checkVideoCodec(\n- iosNativeTranscodedPath,\n- );\n- if (iosTranscodeProbeStep.success) {\n- path = iosNativeTranscodedPath;\n- steps.push({\n- step: 'video_ios_native_transcode',\n- success: true,\n- time: Date.now() - iosNativeTranscodeStart,\n- newPath: path,\n- });\n- steps.push(iosTranscodeProbeStep);\n- return finish();\n- } else {\n- steps.push({\n- step: 'video_ios_native_transcode',\n- success: false,\n- time: Date.now() - iosNativeTranscodeStart,\n- newPath: iosNativeTranscodedPath,\n- });\n- steps.push(iosTranscodeProbeStep);\n- }\n- } catch (e) {\n- steps.push({\n- step: 'video_ios_native_transcode',\n- success: false,\n- time: Date.now() - iosNativeTranscodeStart,\n- newPath: null,\n- });\n- }\n- }\n-\n// This tells ffmpeg to use the hardware-accelerated encoders. Since we're\n// using the min-lts builds of react-native-ffmpeg we actually don't need\n// to specify this, but we would if we were using any build that provides\n" }, { "change_type": "MODIFY", "old_path": "yarn.lock", "new_path": "yarn.lock", "diff": "@@ -11674,10 +11674,6 @@ react-native-keychain@^4.0.0:\nresolved \"https://registry.yarnpkg.com/react-native-keychain/-/react-native-keychain-4.0.1.tgz#c332f5d9aaf597255ae6ea4ca7d5c84a24684a1d\"\nintegrity sha512-AqQp4Hib9y5DP5es5umEAhxKG7L0bA8cHNFhvlqs6oUcbUoKtXmhLDo3wzvnCF+bm8DXpGhvkU6P0LkfO0AgPQ==\n-\"react-native-mov-to-mp4@git+https://git@github.com/taltultc/react-native-mov-to-mp4.git#d040c5aad736dd7a4bf1836836a1d62d6ab0d030\":\n- version \"0.2.2\"\n- resolved \"git+https://git@github.com/taltultc/react-native-mov-to-mp4.git#d040c5aad736dd7a4bf1836836a1d62d6ab0d030\"\n-\n\"react-native-notifications@git+https://git@github.com/ashoat/react-native-notifications.git\":\nversion \"1.1.19\"\nresolved \"git+https://git@github.com/ashoat/react-native-notifications.git#6f741c582bcf19fd4151f2b18d48d55d3da157e9\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Get rid of react-native-mov-to-mp4 Apparently has the potential to significantly upscale videos. Produces results that are more than 10x larger than `ffmpeg`, and is only slightly faster
129,187
15.04.2020 16:57:44
14,400
e7ee5c7aa13eda7d1673dd24c23e16aed983e0dd
Catch exceptions in native checkVideoCodec
[ { "change_type": "MODIFY", "old_path": "lib/types/media-types.js", "new_path": "lib/types/media-types.js", "diff": "@@ -96,6 +96,7 @@ export type UploadDeletionRequest = {|\nexport type VideoProbeMediaMissionStep = {|\nstep: 'video_probe',\nsuccess: boolean,\n+ exceptionMessage: ?string,\ntime: number, // ms\npath: string,\next: ?string,\n@@ -327,6 +328,7 @@ export const mediaMissionPropType = PropTypes.shape({\nPropTypes.shape({\nstep: PropTypes.oneOf(['video_probe']).isRequired,\nsuccess: PropTypes.bool.isRequired,\n+ exceptionMessage: PropTypes.string,\ntime: PropTypes.number.isRequired,\npath: PropTypes.string.isRequired,\next: PropTypes.string,\n" }, { "change_type": "MODIFY", "old_path": "native/media/video-utils.js", "new_path": "native/media/video-utils.js", "diff": "@@ -86,7 +86,7 @@ async function processVideo(\nconst start = Date.now();\ntry {\nconst { rc } = await RNFFmpeg.execute(\n- `-i ${path} -c:v ${codec} ${ffmpegResultPath}`,\n+ `-i ${path} -c:v ${codec} -c:a copy ${ffmpegResultPath}`,\n);\nsuccess = rc === 0;\nif (success) {\n@@ -143,19 +143,34 @@ async function processVideo(\nasync function checkVideoCodec(\npath: string,\n): Promise<VideoProbeMediaMissionStep> {\n- const probeStart = Date.now();\nconst ext = extensionFromFilename(path);\n- let success = ext === 'mp4' || ext === 'mov';\n- let codec;\n- if (success) {\n+\n+ let codec,\n+ success = false,\n+ exceptionMessage;\n+ const start = Date.now();\n+ if (ext === 'mp4' || ext === 'mov') {\n+ try {\nconst videoInfo = await RNFFmpeg.getMediaInformation(path);\ncodec = getVideoCodec(videoInfo);\nsuccess = codec === 'h264';\n+ } catch (e) {\n+ if (\n+ e &&\n+ typeof e === 'object' &&\n+ e.message &&\n+ typeof e.message === 'string'\n+ ) {\n+ exceptionMessage = e.message;\n+ }\n}\n+ }\n+\nreturn {\nstep: 'video_probe',\nsuccess,\n- time: Date.now() - probeStart,\n+ exceptionMessage,\n+ time: Date.now() - start,\npath,\next,\ncodec,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Catch exceptions in native checkVideoCodec
129,187
15.04.2020 17:15:00
14,400
2332746270e2f6094c554ce198cab9cbecfab806
Record when MediaMission begins on native
[ { "change_type": "MODIFY", "old_path": "lib/types/media-types.js", "new_path": "lib/types/media-types.js", "diff": "@@ -110,6 +110,9 @@ export type MediaLibrarySelection =\nfilename: string,\nuri: string,\nmediaNativeID: string,\n+ selectTime: number, // ms timestamp\n+ sendTime: number, // ms timestamp\n+ retries: number,\n|}\n| {|\nstep: 'video_library',\n@@ -117,6 +120,9 @@ export type MediaLibrarySelection =\nfilename: string,\nuri: string,\nmediaNativeID: string,\n+ selectTime: number, // ms timestamp\n+ sendTime: number, // ms timestamp\n+ retries: number,\nplayableDuration: number,\n|};\n@@ -125,6 +131,10 @@ const photoLibrarySelectionPropType = PropTypes.shape({\ndimensions: dimensionsPropType.isRequired,\nfilename: PropTypes.string.isRequired,\nuri: PropTypes.string.isRequired,\n+ mediaNativeID: PropTypes.string.isRequired,\n+ selectTime: PropTypes.number.isRequired,\n+ sendTime: PropTypes.number.isRequired,\n+ retries: PropTypes.number.isRequired,\n});\nconst videoLibrarySelectionPropType = PropTypes.shape({\n@@ -132,6 +142,10 @@ const videoLibrarySelectionPropType = PropTypes.shape({\ndimensions: dimensionsPropType.isRequired,\nfilename: PropTypes.string.isRequired,\nuri: PropTypes.string.isRequired,\n+ mediaNativeID: PropTypes.string.isRequired,\n+ selectTime: PropTypes.number.isRequired,\n+ sendTime: PropTypes.number.isRequired,\n+ retries: PropTypes.number.isRequired,\nplayableDuration: PropTypes.number.isRequired,\n});\n@@ -146,6 +160,9 @@ export type PhotoCapture = {|\ndimensions: Dimensions,\nfilename: string,\nuri: string,\n+ selectTime: number, // ms timestamp\n+ sendTime: number, // ms timestamp\n+ retries: number,\n|};\nexport type MediaSelection = MediaLibrarySelection | PhotoCapture;\n@@ -287,6 +304,9 @@ export const mediaMissionPropType = PropTypes.shape({\ndimensions: dimensionsPropType.isRequired,\nfilename: PropTypes.string.isRequired,\nuri: PropTypes.string.isRequired,\n+ selectTime: PropTypes.number.isRequired,\n+ sendTime: PropTypes.number.isRequired,\n+ retries: PropTypes.number.isRequired,\n}),\nPropTypes.shape({\nstep: PropTypes.oneOf(['compare_blob_mime_to_media_type']).isRequired,\n" }, { "change_type": "MODIFY", "old_path": "native/input/input-state-container.react.js", "new_path": "native/input/input-state-container.react.js", "diff": "@@ -445,9 +445,8 @@ class InputStateContainer extends React.PureComponent<Props, State> {\nlocalMessageID: string,\nselectionWithID: SelectionWithID,\n): Promise<?string> {\n- const start = Date.now();\n-\nconst { localID, selection } = selectionWithID;\n+ const start = selection.sendTime;\nlet steps = [selection],\nserverID;\nconst finish = (result: MediaMissionResult, errorMessage: ?string) => {\n@@ -829,13 +828,27 @@ class InputStateContainer extends React.PureComponent<Props, State> {\n},\n}));\n+ const now = Date.now();\nconst selectionsWithIDs = retryMedia.map(singleMedia => {\nconst { id, localMediaSelection } = singleMedia;\ninvariant(\nlocalMediaSelection,\n'localMediaSelection should be set on locally created Media',\n);\n- return { selection: localMediaSelection, localID: id };\n+ const retries = localMediaSelection.retries\n+ ? localMediaSelection.retries + 1\n+ : 1;\n+\n+ // We switch for Flow\n+ let selection;\n+ if (localMediaSelection.step === 'photo_capture') {\n+ selection = { ...localMediaSelection, sendTime: now, retries };\n+ } else if (localMediaSelection.step === 'photo_library') {\n+ selection = { ...localMediaSelection, sendTime: now, retries };\n+ } else {\n+ selection = { ...localMediaSelection, sendTime: now, retries };\n+ }\n+ return { selection, localID: id };\n});\nawait this.uploadFiles(localMessageID, selectionsWithIDs);\n" }, { "change_type": "MODIFY", "old_path": "native/media/camera-modal.react.js", "new_path": "native/media/camera-modal.react.js", "diff": "@@ -807,7 +807,9 @@ class CameraModal extends React.PureComponent<Props, State> {\nthis.camera = camera;\n};\n- closeButtonRef = (closeButton: ?React.ElementRef<typeof TouchableOpacity>) => {\n+ closeButtonRef = (\n+ closeButton: ?React.ElementRef<typeof TouchableOpacity>,\n+ ) => {\nthis.closeButton = (closeButton: any);\n};\n@@ -824,7 +826,9 @@ class CameraModal extends React.PureComponent<Props, State> {\n});\n};\n- photoButtonRef = (photoButton: ?React.ElementRef<typeof TouchableOpacity>) => {\n+ photoButtonRef = (\n+ photoButton: ?React.ElementRef<typeof TouchableOpacity>,\n+ ) => {\nthis.photoButton = (photoButton: any);\n};\n@@ -841,7 +845,9 @@ class CameraModal extends React.PureComponent<Props, State> {\n});\n};\n- switchCameraButtonRef = (switchCameraButton: ?React.ElementRef<typeof TouchableOpacity>) => {\n+ switchCameraButtonRef = (\n+ switchCameraButton: ?React.ElementRef<typeof TouchableOpacity>,\n+ ) => {\nthis.switchCameraButton = (switchCameraButton: any);\n};\n@@ -858,7 +864,9 @@ class CameraModal extends React.PureComponent<Props, State> {\n});\n};\n- flashButtonRef = (flashButton: ?React.ElementRef<typeof TouchableOpacity>) => {\n+ flashButtonRef = (\n+ flashButton: ?React.ElementRef<typeof TouchableOpacity>,\n+ ) => {\nthis.flashButton = (flashButton: any);\n};\n@@ -913,12 +921,16 @@ class CameraModal extends React.PureComponent<Props, State> {\n`unable to parse filename out of react-native-camera URI ${uri}`,\n);\n+ const now = Date.now();\nconst pendingPhotoCapture = {\nstep: 'photo_capture',\nuri,\ndimensions: { width, height },\nfilename,\n- time: Date.now() - startTime,\n+ time: now - startTime,\n+ selectTime: now,\n+ sendTime: now,\n+ retries: 0,\n};\nthis.setState({\n" }, { "change_type": "MODIFY", "old_path": "native/media/media-gallery-keyboard.react.js", "new_path": "native/media/media-gallery-keyboard.react.js", "diff": "@@ -252,6 +252,9 @@ class MediaGalleryKeyboard extends React.PureComponent<Props, State> {\nfilename,\nmediaNativeID: id,\nplayableDuration: duration,\n+ selectTime: 0,\n+ sendTime: 0,\n+ retries: 0,\n};\n} else {\nreturn {\n@@ -260,6 +263,9 @@ class MediaGalleryKeyboard extends React.PureComponent<Props, State> {\nuri,\nfilename,\nmediaNativeID: id,\n+ selectTime: 0,\n+ sendTime: 0,\n+ retries: 0,\n};\n}\n})\n@@ -485,7 +491,21 @@ class MediaGalleryKeyboard extends React.PureComponent<Props, State> {\nreturn;\n}\nthis.mediaSelected = true;\n- KeyboardRegistry.onItemSelected(mediaGalleryKeyboardName, selections);\n+\n+ const now = Date.now();\n+ const timeProps = {\n+ selectTime: now,\n+ sendTime: now,\n+ };\n+ const selectionsWithTime = selections.map(selection => ({\n+ ...selection,\n+ ...timeProps,\n+ }));\n+\n+ KeyboardRegistry.onItemSelected(\n+ mediaGalleryKeyboardName,\n+ selectionsWithTime,\n+ );\n}\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Record when MediaMission begins on native
129,187
15.04.2020 17:32:35
14,400
14bcc747bd2e5b4efef4c678086990045ebced60
Record userTime and totalTime in MediaMission
[ { "change_type": "MODIFY", "old_path": "lib/types/media-types.js", "new_path": "lib/types/media-types.js", "diff": "@@ -233,7 +233,7 @@ export type MediaMissionStep =\n| {|\nstep: 'upload',\nsuccess: boolean,\n- time: number,\n+ time: number, // ms\n|}\n| {|\nstep: 'processing_exception',\n@@ -284,13 +284,13 @@ export type MediaMissionFailure =\nmessage: ?string,\n|};\n-export type MediaMissionResult =\n- | MediaMissionFailure\n- | {| success: true, totalTime: number |};\n+export type MediaMissionResult = MediaMissionFailure | {| success: true |};\nexport type MediaMission = {|\nsteps: MediaMissionStep[],\nresult: MediaMissionResult,\n+ userTime: number,\n+ totalTime: number,\n|};\nexport const mediaMissionPropType = PropTypes.shape({\n@@ -392,7 +392,6 @@ export const mediaMissionPropType = PropTypes.shape({\nresult: PropTypes.oneOfType([\nPropTypes.shape({\nsuccess: PropTypes.oneOf([true]).isRequired,\n- totalTime: PropTypes.number.isRequired,\n}),\nPropTypes.shape({\nsuccess: PropTypes.oneOf([false]).isRequired,\n@@ -436,4 +435,6 @@ export const mediaMissionPropType = PropTypes.shape({\nmessage: PropTypes.string,\n}),\n]),\n+ userTime: PropTypes.number.isRequired,\n+ totalTime: PropTypes.number.isRequired,\n});\n" }, { "change_type": "MODIFY", "old_path": "native/input/input-state-container.react.js", "new_path": "native/input/input-state-container.react.js", "diff": "@@ -448,17 +448,23 @@ class InputStateContainer extends React.PureComponent<Props, State> {\nconst { localID, selection } = selectionWithID;\nconst start = selection.sendTime;\nlet steps = [selection],\n- serverID;\n- const finish = (result: MediaMissionResult, errorMessage: ?string) => {\n- if (errorMessage) {\n- this.handleUploadFailure(localMessageID, localID, errorMessage);\n- }\n+ serverID,\n+ userTime,\n+ errorMessage;\n+ const finish = (result: MediaMissionResult) => {\n+ const totalTime = Date.now() - start;\n+ userTime = userTime ? userTime : totalTime;\nthis.queueMediaMissionReport(\n{ localID, localMessageID, serverID },\n- { steps, result },\n+ { steps, result, totalTime, userTime },\n);\nreturn errorMessage;\n};\n+ const fail = (message: string) => {\n+ errorMessage = message;\n+ this.handleUploadFailure(localMessageID, localID, message);\n+ userTime = Date.now() - start;\n+ };\nlet mediaInfo;\nif (selection.step === 'photo_library') {\n@@ -496,17 +502,21 @@ class InputStateContainer extends React.PureComponent<Props, State> {\n);\nsteps = [...steps, ...processSteps];\nif (!processResult.success) {\n- return finish(processResult, 'processing failed');\n+ fail('processing failed');\n+ return finish(processResult);\n}\nprocessedMedia = processResult;\n} catch (e) {\nconst message = e && e.message ? e.message : 'processing threw';\nconst time = Date.now() - processingStart;\nsteps.push({ step: 'processing_exception', time, message });\n- return finish(\n- { success: false, reason: 'processing_exception', time, message },\n+ fail(message);\n+ return finish({\n+ success: false,\n+ reason: 'processing_exception',\n+ time,\nmessage,\n- );\n+ });\n}\nconst {\n@@ -518,7 +528,7 @@ class InputStateContainer extends React.PureComponent<Props, State> {\n} = processedMedia;\nconst uploadStart = Date.now();\n- let uploadResult, message, mediaMissionResult;\n+ let uploadResult, mediaMissionResult;\ntry {\nuploadResult = await this.props.uploadMultimedia(\n{ uri: uploadURI, name, type: mime },\n@@ -529,9 +539,9 @@ class InputStateContainer extends React.PureComponent<Props, State> {\nuploadBlob: this.uploadBlob,\n},\n);\n- mediaMissionResult = { success: true, totalTime: Date.now() - start };\n+ mediaMissionResult = { success: true };\n} catch (e) {\n- message = 'upload failed';\n+ fail('upload failed');\nmediaMissionResult = {\nsuccess: false,\nreason: 'http_upload_failed',\n@@ -551,6 +561,7 @@ class InputStateContainer extends React.PureComponent<Props, State> {\nlocalMediaCreationInfo: undefined,\n},\n});\n+ userTime = Date.now() - start;\n}\nsteps.push({\nstep: 'upload',\n@@ -559,7 +570,7 @@ class InputStateContainer extends React.PureComponent<Props, State> {\n});\nif (!shouldDisposePath) {\n- return finish(mediaMissionResult, message);\n+ return finish(mediaMissionResult);\n}\nlet disposeSuccess = false;\nconst disposeStart = Date.now();\n@@ -573,7 +584,7 @@ class InputStateContainer extends React.PureComponent<Props, State> {\ntime: disposeStart - Date.now(),\npath: shouldDisposePath,\n});\n- return finish(mediaMissionResult, message);\n+ return finish(mediaMissionResult);\n}\nsetProgress(\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Record userTime and totalTime in MediaMission
129,187
15.04.2020 17:42:17
14,400
7fef7a8b0537d05b477d7bbd6354219932000203
Record exceptions from native uploadFile in MediaMission
[ { "change_type": "MODIFY", "old_path": "lib/types/media-types.js", "new_path": "lib/types/media-types.js", "diff": "@@ -227,18 +227,20 @@ export type MediaMissionStep =\n| {|\nstep: 'dispose_uploaded_local_file',\nsuccess: boolean,\n+ exceptionMessage: ?string,\ntime: number, // ms\npath: string,\n|}\n| {|\nstep: 'upload',\nsuccess: boolean,\n+ exceptionMessage: ?string,\ntime: number, // ms\n|}\n| {|\nstep: 'processing_exception',\ntime: number,\n- message: ?string,\n+ exceptionMessage: ?string,\n|};\nexport type MediaMissionFailure =\n@@ -271,7 +273,7 @@ export type MediaMissionFailure =\n| {|\nsuccess: false,\nreason: 'http_upload_failed',\n- message: ?string,\n+ exceptionMessage: ?string,\n|}\n| {|\nsuccess: false,\n@@ -281,7 +283,7 @@ export type MediaMissionFailure =\nsuccess: false,\nreason: 'processing_exception',\ntime: number,\n- message: ?string,\n+ exceptionMessage: ?string,\n|};\nexport type MediaMissionResult = MediaMissionFailure | {| success: true |};\n@@ -374,18 +376,20 @@ export const mediaMissionPropType = PropTypes.shape({\nPropTypes.shape({\nstep: PropTypes.oneOf(['dispose_uploaded_local_file']).isRequired,\nsuccess: PropTypes.bool.isRequired,\n+ exceptionMessage: PropTypes.string,\ntime: PropTypes.number.isRequired,\npath: PropTypes.string.isRequired,\n}),\nPropTypes.shape({\nstep: PropTypes.oneOf(['upload']).isRequired,\nsuccess: PropTypes.bool.isRequired,\n+ exceptionMessage: PropTypes.string,\ntime: PropTypes.number.isRequired,\n}),\nPropTypes.shape({\nstep: PropTypes.oneOf(['processing_exception']).isRequired,\nsuccess: PropTypes.bool.isRequired,\n- message: PropTypes.string,\n+ exceptionMessage: PropTypes.string,\n}),\n]),\n).isRequired,\n@@ -422,7 +426,7 @@ export const mediaMissionPropType = PropTypes.shape({\nPropTypes.shape({\nsuccess: PropTypes.oneOf([false]).isRequired,\nreason: PropTypes.oneOf(['http_upload_failed']).isRequired,\n- message: PropTypes.string,\n+ exceptionMessage: PropTypes.string,\n}),\nPropTypes.shape({\nsuccess: PropTypes.oneOf([false]).isRequired,\n@@ -432,7 +436,7 @@ export const mediaMissionPropType = PropTypes.shape({\nsuccess: PropTypes.oneOf([false]).isRequired,\nreason: PropTypes.oneOf(['processing_exception']).isRequired,\ntime: PropTypes.number.isRequired,\n- message: PropTypes.string,\n+ exceptionMessage: PropTypes.string,\n}),\n]),\nuserTime: PropTypes.number.isRequired,\n" }, { "change_type": "MODIFY", "old_path": "native/input/input-state-container.react.js", "new_path": "native/input/input-state-container.react.js", "diff": "@@ -507,15 +507,29 @@ class InputStateContainer extends React.PureComponent<Props, State> {\n}\nprocessedMedia = processResult;\n} catch (e) {\n- const message = e && e.message ? e.message : 'processing threw';\n+ let processExceptionMessage;\n+ if (\n+ e &&\n+ typeof e === 'object' &&\n+ e.message &&\n+ typeof e.message === 'string'\n+ ) {\n+ processExceptionMessage = e.message;\n+ }\nconst time = Date.now() - processingStart;\n- steps.push({ step: 'processing_exception', time, message });\n- fail(message);\n+ steps.push({\n+ step: 'processing_exception',\n+ time,\n+ exceptionMessage: processExceptionMessage,\n+ });\n+ fail(\n+ processExceptionMessage ? processExceptionMessage : 'processing threw',\n+ );\nreturn finish({\nsuccess: false,\nreason: 'processing_exception',\ntime,\n- message,\n+ exceptionMessage: processExceptionMessage,\n});\n}\n@@ -528,7 +542,7 @@ class InputStateContainer extends React.PureComponent<Props, State> {\n} = processedMedia;\nconst uploadStart = Date.now();\n- let uploadResult, mediaMissionResult;\n+ let uploadExceptionMessage, uploadResult, mediaMissionResult;\ntry {\nuploadResult = await this.props.uploadMultimedia(\n{ uri: uploadURI, name, type: mime },\n@@ -541,13 +555,22 @@ class InputStateContainer extends React.PureComponent<Props, State> {\n);\nmediaMissionResult = { success: true };\n} catch (e) {\n+ if (\n+ e &&\n+ typeof e === 'object' &&\n+ e.message &&\n+ typeof e.message === 'string'\n+ ) {\n+ uploadExceptionMessage = e.message;\n+ }\nfail('upload failed');\nmediaMissionResult = {\nsuccess: false,\nreason: 'http_upload_failed',\n- message: e && e.message ? e.message : undefined,\n+ exceptionMessage: uploadExceptionMessage,\n};\n}\n+\nif (uploadResult) {\nserverID = uploadResult.id;\nthis.props.dispatchActionPayload(updateMultimediaMessageMediaActionType, {\n@@ -566,24 +589,39 @@ class InputStateContainer extends React.PureComponent<Props, State> {\nsteps.push({\nstep: 'upload',\nsuccess: !!uploadResult,\n+ exceptionMessage: uploadExceptionMessage,\ntime: Date.now() - uploadStart,\n});\nif (!shouldDisposePath) {\nreturn finish(mediaMissionResult);\n}\n- let disposeSuccess = false;\n+\n+ let disposeSuccess = false,\n+ disposeExceptionMessage;\nconst disposeStart = Date.now();\ntry {\nawait filesystem.unlink(shouldDisposePath);\ndisposeSuccess = true;\n- } catch (e) {}\n+ } catch (e) {\n+ if (\n+ e &&\n+ typeof e === 'object' &&\n+ e.message &&\n+ typeof e.message === 'string'\n+ ) {\n+ disposeExceptionMessage = e.message;\n+ }\n+ }\n+\nsteps.push({\nstep: 'dispose_uploaded_local_file',\nsuccess: disposeSuccess,\n+ exceptionMessage: disposeExceptionMessage,\ntime: disposeStart - Date.now(),\npath: shouldDisposePath,\n});\n+\nreturn finish(mediaMissionResult);\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Record exceptions from native uploadFile in MediaMission
129,187
15.04.2020 19:39:14
14,400
530fa1cd98df70ae2f242eb16cd76ace48c342f5
[native] Convert all images we can't handle
[ { "change_type": "MODIFY", "old_path": "native/media/image-utils.js", "new_path": "native/media/image-utils.js", "diff": "@@ -32,8 +32,10 @@ async function processImage(\nconst { fileSize, orientation } = input;\n- const needsProcessing = orientation && orientation > 1;\n- const needsCompression = mime === 'image/heic' || fileSize > 5e6;\n+ const unsupportedMIME = mime !== 'image/png' && mime !== 'image/jpeg';\n+ const needsProcessing = unsupportedMIME || (orientation && orientation > 1);\n+ const needsCompression =\n+ fileSize > 5e6 || (unsupportedMIME && fileSize > 3e6);\nconst transforms = [];\n// The dimensions we have are actually the post-rotation dimensions\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Convert all images we can't handle
129,187
15.04.2020 19:42:14
14,400
e9c364957e87470f02f908b7e31dbe1cdd5ec50d
Extract readableFilename from fileInfoFromData
[ { "change_type": "MODIFY", "old_path": "lib/types/media-types.js", "new_path": "lib/types/media-types.js", "diff": "@@ -222,7 +222,6 @@ export type MediaMissionStep =\nuri: string,\ndetectedMIME: ?string,\ndetectedMediaType: ?string,\n- newName: ?string,\n|}\n| {|\nstep: 'dispose_uploaded_local_file',\n@@ -235,6 +234,7 @@ export type MediaMissionStep =\nstep: 'upload',\nsuccess: boolean,\nexceptionMessage: ?string,\n+ filename: string,\ntime: number, // ms\n|}\n| {|\n@@ -371,7 +371,6 @@ export const mediaMissionPropType = PropTypes.shape({\nuri: PropTypes.string.isRequired,\ndetectedMIME: PropTypes.string,\ndetectedMediaType: mediaTypePropType,\n- newName: PropTypes.string,\n}),\nPropTypes.shape({\nstep: PropTypes.oneOf(['dispose_uploaded_local_file']).isRequired,\n@@ -384,6 +383,7 @@ export const mediaMissionPropType = PropTypes.shape({\nstep: PropTypes.oneOf(['upload']).isRequired,\nsuccess: PropTypes.bool.isRequired,\nexceptionMessage: PropTypes.string,\n+ filename: PropTypes.string.isRequired,\ntime: PropTypes.number.isRequired,\n}),\nPropTypes.shape({\n" }, { "change_type": "MODIFY", "old_path": "lib/utils/file-utils.js", "new_path": "lib/utils/file-utils.js", "diff": "@@ -4,46 +4,57 @@ import type { MediaType } from '../types/media-types';\nimport fileType from 'file-type';\n+const mimeTypesToMediaTypes = Object.freeze({\n+ 'image/png': 'photo',\n+ 'image/jpeg': 'photo',\n+ 'image/gif': 'photo',\n+ 'image/heic': 'photo',\n+ 'video/mp4': 'video',\n+ 'video/quicktime': 'video',\n+});\n+\n+const mimeTypesToExtensions = Object.freeze({\n+ 'image/png': 'png',\n+ 'image/jpeg': 'jpg',\n+ 'image/gif': 'gif',\n+ 'image/heic': 'heic',\n+ 'video/mp4': 'mp4',\n+ 'video/quicktime': 'mp4',\n+});\n+\ntype FileInfo = {|\nmime: ?string,\nmediaType: ?MediaType,\n- name: ?string,\n|};\n-function fileInfoFromData(\n- data: Uint8Array | Buffer,\n- fileName: string,\n-): FileInfo {\n+function fileInfoFromData(data: Uint8Array | Buffer): FileInfo {\nconst fileTypeResult = fileType(data);\nif (!fileTypeResult) {\n- return { mime: null, mediaType: null, name: null };\n+ return { mime: null, mediaType: null };\n}\n- const { ext, mime } = fileTypeResult;\n+ const { mime } = fileTypeResult;\nconst mediaType = mimeTypesToMediaTypes[mime];\n- if (!mediaType) {\n- return { mime, mediaType, name: null };\n+ return { mime, mediaType };\n}\n- let [readableFileName] = fileName.split('.');\n- if (!readableFileName) {\n- readableFileName = Math.random()\n+\n+function replaceExtension(filename: string, ext: string): string {\n+ const lastIndex = filename.lastIndexOf('.');\n+ let name = lastIndex >= 0 ? filename.substring(0, lastIndex) : filename;\n+ if (!name) {\n+ name = Math.random()\n.toString(36)\n.slice(-5);\n}\nconst maxReadableLength = 255 - ext.length - 1;\n- const fixedFileName = `${readableFileName.substring(\n- 0,\n- maxReadableLength,\n- )}.${ext}`;\n- return { name: fixedFileName, mime, mediaType };\n+ return `${name.substring(0, maxReadableLength)}.${ext}`;\n}\n-const mimeTypesToMediaTypes = {\n- 'image/png': 'photo',\n- 'image/jpeg': 'photo',\n- 'image/gif': 'photo',\n- 'image/heic': 'photo',\n- 'video/mp4': 'video',\n- 'video/quicktime': 'video',\n-};\n+function readableFilename(filename: string, mime: string): ?string {\n+ const ext = mimeTypesToExtensions[mime];\n+ if (!ext) {\n+ return null;\n+ }\n+ return replaceExtension(filename, ext);\n+}\nconst extRegex = /\\.([0-9a-z]+)$/i;\nfunction extensionFromFilename(filename: string): ?string {\n@@ -58,15 +69,6 @@ function extensionFromFilename(filename: string): ?string {\nreturn match.toLowerCase();\n}\n-const stripExtensionRegex = /(.*)\\.[^.]+$/;\n-function stripExtension(filename: string): string {\n- const matches = filename.match(stripExtensionRegex);\n- if (!matches) {\n- return filename;\n- }\n- return matches[1] ? matches[1] : filename;\n-}\n-\nconst pathRegex = /^file:\\/\\/(.*)$/;\nfunction pathFromURI(uri: string): ?string {\nconst matches = uri.match(pathRegex);\n@@ -87,9 +89,10 @@ function filenameFromPathOrURI(pathOrURI: string): ?string {\nexport {\nfileInfoFromData,\n+ replaceExtension,\n+ readableFilename,\nmimeTypesToMediaTypes,\nextensionFromFilename,\n- stripExtension,\npathFromURI,\nfilenameFromPathOrURI,\n};\n" }, { "change_type": "MODIFY", "old_path": "native/input/input-state-container.react.js", "new_path": "native/input/input-state-container.react.js", "diff": "@@ -536,7 +536,7 @@ class InputStateContainer extends React.PureComponent<Props, State> {\nconst {\nuploadURI,\nshouldDisposePath,\n- name,\n+ filename,\nmime,\nmediaType,\n} = processedMedia;\n@@ -545,7 +545,7 @@ class InputStateContainer extends React.PureComponent<Props, State> {\nlet uploadExceptionMessage, uploadResult, mediaMissionResult;\ntry {\nuploadResult = await this.props.uploadMultimedia(\n- { uri: uploadURI, name, type: mime },\n+ { uri: uploadURI, name: filename, type: mime },\nselection.dimensions,\n{\nonProgress: (percent: number) =>\n@@ -590,6 +590,7 @@ class InputStateContainer extends React.PureComponent<Props, State> {\nstep: 'upload',\nsuccess: !!uploadResult,\nexceptionMessage: uploadExceptionMessage,\n+ filename,\ntime: Date.now() - uploadStart,\n});\n" }, { "change_type": "MODIFY", "old_path": "native/media/media-utils.js", "new_path": "native/media/media-utils.js", "diff": "@@ -15,6 +15,7 @@ import {\nfileInfoFromData,\nmimeTypesToMediaTypes,\npathFromURI,\n+ readableFilename,\n} from 'lib/utils/file-utils';\nimport { promiseAll } from 'lib/utils/promises';\n@@ -160,7 +161,7 @@ type MediaResult = {|\nsuccess: true,\nuploadURI: string,\nshouldDisposePath: ?string,\n- name: string,\n+ filename: string,\nmime: string,\nmediaType: MediaType,\ndimensions: Dimensions,\n@@ -176,7 +177,6 @@ async function processMedia(\nlet initialURI = null,\nuploadURI = null,\ndimensions = mediaInput.dimensions,\n- filename = mediaInput.filename,\nmime = null,\nmediaType = mediaInput.type;\nconst finish = (failure?: MediaMissionFailure) => {\n@@ -189,13 +189,15 @@ async function processMedia(\n);\nconst shouldDisposePath =\ninitialURI !== uploadURI ? pathFromURI(uploadURI) : null;\n+ const filename = readableFilename(mediaInput.filename, mime);\n+ invariant(filename, `could not construct filename for ${mime}`);\nreturn {\nsteps,\nresult: {\nsuccess: true,\nuploadURI,\nshouldDisposePath,\n- name: filename,\n+ filename,\nmime,\nmediaType,\ndimensions,\n@@ -246,7 +248,7 @@ async function processMedia(\nif (mediaInput.type === 'video') {\nconst { steps: videoSteps, result: videoResult } = await processVideo({\nuri: initialURI,\n- filename,\n+ filename: mediaInput.filename,\n});\nsteps.push(...videoSteps);\nif (!videoResult.success) {\n@@ -254,7 +256,6 @@ async function processMedia(\n}\nuploadURI = videoResult.uri;\nmime = videoResult.mime;\n- filename = videoResult.filename;\n} else if (mediaInput.type === 'photo') {\nif (!mime) {\nreturn finish({\n@@ -301,11 +302,9 @@ async function processMedia(\nconst dataURI = await blobToDataURI(blobResponse.blob);\nconst intArray = dataURIToIntArray(dataURI);\n- const fileDetectionResult = fileInfoFromData(intArray, filename);\n+ const fileDetectionResult = fileInfoFromData(intArray);\nconst fileDetectionSuccess =\n- !!fileDetectionResult.name &&\n- !!fileDetectionResult.mime &&\n- fileDetectionResult.mediaType === mediaType;\n+ !!fileDetectionResult.mime && fileDetectionResult.mediaType === mediaType;\nsteps.push({\nstep: 'final_file_data_analysis',\n@@ -314,11 +313,7 @@ async function processMedia(\nuri: uploadURI,\ndetectedMIME: fileDetectionResult.mime,\ndetectedMediaType: fileDetectionResult.mediaType,\n- newName: fileDetectionResult.name,\n});\n- if (fileDetectionResult.name) {\n- filename = fileDetectionResult.name;\n- }\nif (fileDetectionResult.mime) {\nmime = fileDetectionResult.mime;\n}\n" }, { "change_type": "MODIFY", "old_path": "native/media/save-image.js", "new_path": "native/media/save-image.js", "diff": "@@ -5,7 +5,7 @@ import filesystem from 'react-native-fs';\nimport invariant from 'invariant';\nimport * as MediaLibrary from 'expo-media-library';\n-import { fileInfoFromData } from 'lib/utils/file-utils';\n+import { fileInfoFromData, readableFilename } from 'lib/utils/file-utils';\nimport { blobToDataURI, dataURIToIntArray } from './media-utils';\nimport { displayActionResultModal } from '../navigation/action-result-modal';\n@@ -109,8 +109,11 @@ async function saveToDisk(uri: string, directory: string) {\nconst intArray = dataURIToIntArray(dataURI);\nconst fileName = blob.data.name ? blob.data.name : '';\n- const { name } = fileInfoFromData(intArray, fileName);\n- invariant(name, 'unsupported media type');\n+ const { mime } = fileInfoFromData(intArray);\n+ invariant(mime, `unsupported media type in saveToDisk`);\n+\n+ const name = readableFilename(fileName, mime);\n+ invariant(name, `unsupported mime type ${mime} in saveToDisk`);\nconst filePath = `${directory}/${name}`;\nawait filesystem.writeFile(filePath, base64, 'base64');\n" }, { "change_type": "MODIFY", "old_path": "native/media/video-utils.js", "new_path": "native/media/video-utils.js", "diff": "@@ -13,8 +13,8 @@ import invariant from 'invariant';\nimport {\npathFromURI,\n- stripExtension,\nextensionFromFilename,\n+ replaceExtension,\n} from 'lib/utils/file-utils';\nimport { getUUID } from 'lib/utils/uuid';\n@@ -31,7 +31,6 @@ type ProcessVideoResponse = {|\nsuccess: true,\nuri: string,\nmime: string,\n- filename: string,\n|};\nasync function processVideo(\ninput: ProcessVideoInfo,\n@@ -41,13 +40,6 @@ async function processVideo(\n|}> {\nconst steps = [];\n- let filename = input.filename;\n- if (extensionFromFilename(filename) === 'mov') {\n- // iOS uses the proprietary QuickTime container format (.mov),\n- // which is generally compatible with .mp4\n- filename = `${stripExtension(filename)}.mp4`;\n- }\n-\nconst path = pathFromURI(input.uri);\ninvariant(path, `could not extract path from ${input.uri}`);\n@@ -61,7 +53,6 @@ async function processVideo(\nsuccess: true,\nuri: input.uri,\nmime: 'video/mp4',\n- filename,\n},\n};\n}\n@@ -75,9 +66,10 @@ async function processVideo(\nandroid: 'h264_mediacodec',\ndefault: 'h264',\n});\n- const ffmpegResultPath = `${\n- filesystem.TemporaryDirectoryPath\n- }transcode.${getUUID()}.${filename}`;\n+ const directory = filesystem.TemporaryDirectoryPath;\n+ const mp4Name = replaceExtension(input.filename, 'mp4');\n+ const uuid = getUUID();\n+ const ffmpegResultPath = `${directory}transcode.${uuid}.${mp4Name}`;\nlet returnCode,\nnewPath,\n@@ -135,7 +127,6 @@ async function processVideo(\nsuccess: true,\nuri: `file://${ffmpegResultPath}`,\nmime: 'video/mp4',\n- filename,\n},\n};\n}\n" }, { "change_type": "MODIFY", "old_path": "server/src/uploads/media-utils.js", "new_path": "server/src/uploads/media-utils.js", "diff": "@@ -5,8 +5,9 @@ import type { Dimensions } from 'lib/types/media-types';\nimport sharp from 'sharp';\nimport sizeOf from 'buffer-image-size';\n+import invariant from 'invariant';\n-import { fileInfoFromData } from 'lib/utils/file-utils';\n+import { fileInfoFromData, readableFilename } from 'lib/utils/file-utils';\nconst fiveMegabytes = 5 * 1024 * 1024;\n@@ -23,11 +24,8 @@ async function validateAndConvert(\ninputDimensions: ?Dimensions,\nsize: number, // in bytes\n): Promise<?UploadInput> {\n- const { mime, mediaType, name } = fileInfoFromData(\n- initialBuffer,\n- initialName,\n- );\n- if (!mime || !mediaType || !name) {\n+ const { mime, mediaType } = fileInfoFromData(initialBuffer);\n+ if (!mime || !mediaType) {\nreturn null;\n}\n@@ -39,6 +37,8 @@ async function validateAndConvert(\nconst dimensions = inputDimensions\n? inputDimensions\n: getDimensions(initialBuffer);\n+ const name = readableFilename(initialName, mime);\n+ invariant(name, `should be able to construct filename for ${mime}`);\nreturn {\nmime,\nmediaType,\n@@ -69,9 +69,13 @@ async function validateAndConvert(\nconst {\nmime: convertedMIME,\nmediaType: convertedMediaType,\n- name: convertedName,\n- } = fileInfoFromData(convertedBuffer, initialName);\n- if (!convertedMIME || !convertedMediaType || !convertedName) {\n+ } = fileInfoFromData(convertedBuffer);\n+ if (!convertedMIME || !convertedMediaType) {\n+ return null;\n+ }\n+\n+ const convertedName = readableFilename(initialName, convertedMIME);\n+ if (!convertedName) {\nreturn null;\n}\n" }, { "change_type": "MODIFY", "old_path": "web/utils/media-utils.js", "new_path": "web/utils/media-utils.js", "diff": "import type { MediaType, Dimensions } from 'lib/types/media-types';\n-import { fileInfoFromData } from 'lib/utils/file-utils';\n+import { fileInfoFromData, readableFilename } from 'lib/utils/file-utils';\nimport invariant from 'invariant';\nfunction blobToArrayBuffer(blob: Blob): Promise<ArrayBuffer> {\n@@ -12,10 +12,10 @@ function blobToArrayBuffer(blob: Blob): Promise<ArrayBuffer> {\nfileReader.abort();\nreject(error);\n};\n- fileReader.onload = event => {\n+ fileReader.onload = () => {\ninvariant(\nfileReader.result instanceof ArrayBuffer,\n- \"FileReader.readAsArrayBuffer should result in ArrayBuffer\",\n+ 'FileReader.readAsArrayBuffer should result in ArrayBuffer',\n);\nresolve(fileReader.result);\n};\n@@ -30,10 +30,10 @@ function getPhotoDimensions(blob: File): Promise<Dimensions> {\nfileReader.abort();\nreject(error);\n};\n- fileReader.onload = event => {\n+ fileReader.onload = () => {\ninvariant(\n- typeof fileReader.result === \"string\",\n- \"FileReader.readAsDataURL should result in string\",\n+ typeof fileReader.result === 'string',\n+ 'FileReader.readAsDataURL should result in string',\n);\nresolve(fileReader.result);\n};\n@@ -49,11 +49,12 @@ type FileValidationResult = {|\n|};\nasync function validateFile(file: File): Promise<?FileValidationResult> {\nconst arrayBuffer = await blobToArrayBuffer(file);\n- const { name, mime, mediaType } = fileInfoFromData(\n- new Uint8Array(arrayBuffer),\n- file.name,\n- );\n- if (!name || !mime || !mediaType || !allowedMimeTypes.has(mime)) {\n+ const { mime, mediaType } = fileInfoFromData(new Uint8Array(arrayBuffer));\n+ if (!mime || !mediaType || !allowedMimeTypes.has(mime)) {\n+ return null;\n+ }\n+ const name = readableFilename(file.name, mime);\n+ if (!name) {\nreturn null;\n}\nlet dimensions = null;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Extract readableFilename from fileInfoFromData
129,187
15.04.2020 20:01:28
14,400
eb5254d50ec4f6fb3c93ae95b4cde79250b62283
Rework native blob data analysis on media upload
[ { "change_type": "MODIFY", "old_path": "lib/types/media-types.js", "new_path": "lib/types/media-types.js", "diff": "@@ -103,6 +103,16 @@ export type VideoProbeMediaMissionStep = {|\ncodec: ?string,\n|};\n+export type BlobDataAnalysisMediaMissionStep = {|\n+ step: 'blob_data_analysis',\n+ success: boolean,\n+ exceptionMessage: ?string,\n+ time: number, // ms\n+ uri: string,\n+ detectedMIME: ?string,\n+ detectedMediaType: ?MediaType,\n+|};\n+\nexport type MediaLibrarySelection =\n| {|\nstep: 'photo_library',\n@@ -215,14 +225,7 @@ export type MediaMissionStep =\nreturnCode: ?number,\nnewPath: ?string,\n|}\n- | {|\n- step: 'final_file_data_analysis',\n- success: boolean,\n- time: number, // ms\n- uri: string,\n- detectedMIME: ?string,\n- detectedMediaType: ?string,\n- |}\n+ | BlobDataAnalysisMediaMissionStep\n| {|\nstep: 'dispose_uploaded_local_file',\nsuccess: boolean,\n@@ -264,7 +267,7 @@ export type MediaMissionFailure =\n|}\n| {|\nsuccess: false,\n- reason: 'file_data_detected_mime_issue',\n+ reason: 'blob_data_mime_type_mismatch',\nreportedMIME: string,\nreportedMediaType: MediaType,\ndetectedMIME: ?string,\n@@ -365,8 +368,9 @@ export const mediaMissionPropType = PropTypes.shape({\nnewPath: PropTypes.string,\n}),\nPropTypes.shape({\n- step: PropTypes.oneOf(['final_file_data_analysis']).isRequired,\n+ step: PropTypes.oneOf(['blob_data_analysis']).isRequired,\nsuccess: PropTypes.bool.isRequired,\n+ exceptionMessage: PropTypes.string,\ntime: PropTypes.number.isRequired,\nuri: PropTypes.string.isRequired,\ndetectedMIME: PropTypes.string,\n@@ -417,7 +421,7 @@ export const mediaMissionPropType = PropTypes.shape({\n}),\nPropTypes.shape({\nsuccess: PropTypes.oneOf([false]).isRequired,\n- reason: PropTypes.oneOf(['file_data_detected_mime_issue']).isRequired,\n+ reason: PropTypes.oneOf(['blob_data_mime_type_mismatch']).isRequired,\nreportedMIME: PropTypes.string.isRequired,\nreportedMediaType: mediaTypePropType.isRequired,\ndetectedMIME: PropTypes.string,\n" }, { "change_type": "MODIFY", "old_path": "native/media/media-utils.js", "new_path": "native/media/media-utils.js", "diff": "@@ -5,6 +5,7 @@ import type {\nMediaType,\nMediaMissionStep,\nMediaMissionFailure,\n+ BlobDataAnalysisMediaMissionStep,\n} from 'lib/types/media-types';\nimport { Image } from 'react-native';\n@@ -98,6 +99,38 @@ async function fetchBlob(\nreturn { steps: [compareTypesStep], result };\n}\n+async function checkBlobData(\n+ uploadURI: string,\n+ blob: ReactNativeBlob,\n+ expectedMIME: string,\n+): Promise<BlobDataAnalysisMediaMissionStep> {\n+ let mime, mediaType, exceptionMessage;\n+ const start = Date.now();\n+ try {\n+ const dataURI = await blobToDataURI(blob);\n+ const intArray = dataURIToIntArray(dataURI);\n+ ({ mime, mediaType } = fileInfoFromData(intArray));\n+ } catch (e) {\n+ if (\n+ e &&\n+ typeof e === 'object' &&\n+ e.message &&\n+ typeof e.message === 'string'\n+ ) {\n+ exceptionMessage = e.message;\n+ }\n+ }\n+ return {\n+ step: 'blob_data_analysis',\n+ success: !!mime && mime === expectedMIME,\n+ exceptionMessage,\n+ time: Date.now() - start,\n+ uri: uploadURI,\n+ detectedMIME: mime,\n+ detectedMediaType: mediaType,\n+ };\n+}\n+\nfunction blobToDataURI(blob: Blob): Promise<string> {\nconst fileReader = new FileReader();\nreturn new Promise((resolve, reject) => {\n@@ -155,7 +188,7 @@ type MediaInput = {|\ntype MediaProcessConfig = $Shape<{|\ninitial_blob_check: boolean,\nfinal_blob_check: boolean,\n- final_file_data_analysis: boolean,\n+ blob_data_analysis: boolean,\n|}>;\ntype MediaResult = {|\nsuccess: true,\n@@ -285,10 +318,7 @@ async function processMedia(\nif (blobResponse && uploadURI !== initialURI) {\nblobResponse = null;\n}\n- if (\n- !blobResponse &&\n- (config.final_blob_check || config.final_file_data_analysis)\n- ) {\n+ if (!blobResponse && (config.final_blob_check || config.blob_data_analysis)) {\nconst { steps: blobSteps, result: blobResult } = await fetchBlob(\nuploadURI,\nmediaType,\n@@ -297,35 +327,22 @@ async function processMedia(\nblobResponse = blobResult;\n}\n- if (blobResponse && config.final_file_data_analysis) {\n- const fileDataDetectionStart = Date.now();\n- const dataURI = await blobToDataURI(blobResponse.blob);\n- const intArray = dataURIToIntArray(dataURI);\n-\n- const fileDetectionResult = fileInfoFromData(intArray);\n- const fileDetectionSuccess =\n- !!fileDetectionResult.mime && fileDetectionResult.mediaType === mediaType;\n-\n- steps.push({\n- step: 'final_file_data_analysis',\n- success: fileDetectionSuccess,\n- time: Date.now() - fileDataDetectionStart,\n- uri: uploadURI,\n- detectedMIME: fileDetectionResult.mime,\n- detectedMediaType: fileDetectionResult.mediaType,\n- });\n- if (fileDetectionResult.mime) {\n- mime = fileDetectionResult.mime;\n- }\n-\n- if (mediaType === 'photo' && !fileDetectionSuccess) {\n+ if (blobResponse && config.blob_data_analysis) {\n+ const blobDataCheckStep = await checkBlobData(\n+ uploadURI,\n+ blobResponse.blob,\n+ mime,\n+ );\n+ steps.push(blobDataCheckStep);\n+ const { detectedMIME, detectedMediaType } = blobDataCheckStep;\n+ if (!blobDataCheckStep.success) {\nreturn finish({\nsuccess: false,\n- reason: 'file_data_detected_mime_issue',\n+ reason: 'blob_data_mime_type_mismatch',\nreportedMIME: mime,\nreportedMediaType: mediaType,\n- detectedMIME: fileDetectionResult.mime,\n- detectedMediaType: fileDetectionResult.mediaType,\n+ detectedMIME,\n+ detectedMediaType,\n});\n}\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Rework native blob data analysis on media upload
129,187
15.04.2020 20:18:02
14,400
29a83c4a6f04eb5f0976c4649154018b07e8a8d5
[native] Compare final blob MIME to reported MIME if final_blob_check specified
[ { "change_type": "MODIFY", "old_path": "native/media/media-utils.js", "new_path": "native/media/media-utils.js", "diff": "@@ -263,17 +263,15 @@ async function processMedia(\nblobResponse = blobResult;\n}\nif (blobResponse) {\n- if (blobResponse.reportedMIME) {\n- mime = blobResponse.reportedMIME;\n+ const { reportedMIME, reportedMediaType } = blobResponse;\n+ if (reportedMIME) {\n+ mime = reportedMIME;\n}\n- if (\n- blobResponse.reportedMediaType &&\n- blobResponse.reportedMediaType !== mediaType\n- ) {\n+ if (reportedMediaType && reportedMediaType !== mediaType) {\nreturn finish({\nsuccess: false,\nreason: 'blob_reported_mime_issue',\n- mime: blobResponse.reportedMIME,\n+ mime: reportedMIME,\n});\n}\n}\n@@ -325,6 +323,14 @@ async function processMedia(\n);\nsteps.push(...blobSteps);\nblobResponse = blobResult;\n+ const reportedMIME = blobResponse && blobResponse.reportedMIME;\n+ if (config.final_blob_check && reportedMIME && reportedMIME !== mime) {\n+ return finish({\n+ success: false,\n+ reason: 'blob_reported_mime_issue',\n+ mime: reportedMIME,\n+ });\n+ }\n}\nif (blobResponse && config.blob_data_analysis) {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Compare final blob MIME to reported MIME if final_blob_check specified
129,187
15.04.2020 20:21:24
14,400
2d7fe51a022a25e152d4b1e1d2a59f23ea9625cf
[native] Do extra checks during media upload in dev mode or if isStaff
[ { "change_type": "MODIFY", "old_path": "native/input/input-state-container.react.js", "new_path": "native/input/input-state-container.react.js", "diff": "@@ -61,6 +61,7 @@ import {\ncombineLoadingStatuses,\n} from 'lib/selectors/loading-selectors';\nimport { pathFromURI } from 'lib/utils/file-utils';\n+import { isStaff } from 'lib/shared/user-utils';\nimport {\nInputStateContext,\n@@ -499,6 +500,7 @@ class InputStateContainer extends React.PureComponent<Props, State> {\ntry {\nconst { result: processResult, steps: processSteps } = await processMedia(\nmediaInfo,\n+ this.mediaProcessConfig(),\n);\nsteps = [...steps, ...processSteps];\nif (!processResult.success) {\n@@ -626,6 +628,18 @@ class InputStateContainer extends React.PureComponent<Props, State> {\nreturn finish(mediaMissionResult);\n}\n+ mediaProcessConfig() {\n+ const { viewerID } = this.props;\n+ if (__DEV__ || (viewerID && isStaff(viewerID))) {\n+ return {\n+ initialBlobCheck: true,\n+ finalBlobCheck: true,\n+ blobDataAnalysis: true,\n+ };\n+ }\n+ return {};\n+ }\n+\nsetProgress(\nlocalMessageID: string,\nlocalUploadID: string,\n" }, { "change_type": "MODIFY", "old_path": "native/media/media-utils.js", "new_path": "native/media/media-utils.js", "diff": "@@ -176,8 +176,6 @@ function dataURIToIntArray(dataURI: string): Uint8Array {\nreturn stringToIntArray(data);\n}\n-const defaultConfig = Object.freeze({});\n-\ntype MediaInput = {|\ntype: MediaType,\nuri: string,\n@@ -186,9 +184,9 @@ type MediaInput = {|\nmediaNativeID?: string,\n|};\ntype MediaProcessConfig = $Shape<{|\n- initial_blob_check: boolean,\n- final_blob_check: boolean,\n- blob_data_analysis: boolean,\n+ initialBlobCheck: boolean,\n+ finalBlobCheck: boolean,\n+ blobDataAnalysis: boolean,\n|}>;\ntype MediaResult = {|\nsuccess: true,\n@@ -201,7 +199,7 @@ type MediaResult = {|\n|};\nasync function processMedia(\nmediaInput: MediaInput,\n- config: MediaProcessConfig = defaultConfig,\n+ config: MediaProcessConfig,\n): Promise<{|\nsteps: $ReadOnlyArray<MediaMissionStep>,\nresult: MediaMissionFailure | MediaResult,\n@@ -243,7 +241,7 @@ async function processMedia(\nmediaInput.uri,\nmediaInput.mediaNativeID,\n);\n- if (mediaInput.type === 'photo' || config.initial_blob_check) {\n+ if (mediaInput.type === 'photo' || config.initialBlobCheck) {\npromises.fetchBlobResponse = fetchBlob(mediaInput.uri, mediaType);\n}\nconst { fileInfoResponse, fetchBlobResponse } = await promiseAll(promises);\n@@ -316,7 +314,7 @@ async function processMedia(\nif (blobResponse && uploadURI !== initialURI) {\nblobResponse = null;\n}\n- if (!blobResponse && (config.final_blob_check || config.blob_data_analysis)) {\n+ if (!blobResponse && (config.finalBlobCheck || config.blobDataAnalysis)) {\nconst { steps: blobSteps, result: blobResult } = await fetchBlob(\nuploadURI,\nmediaType,\n@@ -324,7 +322,7 @@ async function processMedia(\nsteps.push(...blobSteps);\nblobResponse = blobResult;\nconst reportedMIME = blobResponse && blobResponse.reportedMIME;\n- if (config.final_blob_check && reportedMIME && reportedMIME !== mime) {\n+ if (config.finalBlobCheck && reportedMIME && reportedMIME !== mime) {\nreturn finish({\nsuccess: false,\nreason: 'blob_reported_mime_issue',\n@@ -333,7 +331,7 @@ async function processMedia(\n}\n}\n- if (blobResponse && config.blob_data_analysis) {\n+ if (blobResponse && config.blobDataAnalysis) {\nconst blobDataCheckStep = await checkBlobData(\nuploadURI,\nblobResponse.blob,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Do extra checks during media upload in dev mode or if isStaff
129,187
15.04.2020 20:43:24
14,400
88514565630e8632d544c6a01aa6b636592c7c21
[native] Reduce JPEG compression factor
[ { "change_type": "MODIFY", "old_path": "native/media/image-utils.js", "new_path": "native/media/image-utils.js", "diff": "@@ -58,7 +58,7 @@ async function processImage(\nmime === 'image/png'\n? ImageManipulator.SaveFormat.PNG\n: ImageManipulator.SaveFormat.JPEG;\n- const compress = needsCompression ? 0.92 : 1;\n+ const compress = needsCompression ? 0.83 : 0.92;\nconst saveConfig = { format, compress };\nlet success = false,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Reduce JPEG compression factor
129,187
15.04.2020 21:09:31
14,400
e2ed1e7d20c627b675164e58f8dba6b3be6d1be4
[native] Ask for camera roll permissions on iOS `@react-native-community/cameraroll` did this automatically, but we need to do it with `expo-media-library`
[ { "change_type": "MODIFY", "old_path": "native/media/media-gallery-keyboard.react.js", "new_path": "native/media/media-gallery-keyboard.react.js", "diff": "@@ -198,12 +198,10 @@ class MediaGalleryKeyboard extends React.PureComponent<Props, State> {\n}\nthis.fetchingPhotos = true;\ntry {\n- if (Platform.OS === 'android') {\n- const hasPermission = await this.getAndroidPermissions();\n+ const hasPermission = await this.getPermissions();\nif (!hasPermission) {\nreturn;\n}\n- }\nconst {\nassets,\nendCursor,\n@@ -301,14 +299,19 @@ class MediaGalleryKeyboard extends React.PureComponent<Props, State> {\nthis.fetchingPhotos = false;\n}\n- async getAndroidPermissions(): Promise<boolean> {\n- const granted = await getAndroidPermission(\n+ async getPermissions(): Promise<boolean> {\n+ let granted;\n+ if (Platform.OS === 'android') {\n+ granted = await getAndroidPermission(\nPermissionsAndroid.PERMISSIONS.READ_EXTERNAL_STORAGE,\n{\ntitle: 'Access Your Photos',\nmessage: 'Requesting access to your external storage',\n},\n);\n+ } else {\n+ ({ granted } = await MediaLibrary.requestPermissionsAsync());\n+ }\nif (!granted) {\nthis.guardedSetState({ error: \"don't have permission :(\" });\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Ask for camera roll permissions on iOS `@react-native-community/cameraroll` did this automatically, but we need to do it with `expo-media-library`
129,187
15.04.2020 21:18:25
14,400
1d29ee87092814fc5309c1d6bdd177b797d38c19
[native] Don't fetch asset info if unnecessary
[ { "change_type": "MODIFY", "old_path": "native/media/file-utils.js", "new_path": "native/media/file-utils.js", "diff": "import type {\nMediaMissionStep,\nMediaMissionFailure,\n+ MediaType,\n} from 'lib/types/media-types';\nimport { Platform } from 'react-native';\n@@ -105,6 +106,7 @@ type FetchFileInfoResult = {|\n|};\nasync function fetchFileInfo(\ninputURI: string,\n+ mediaType: MediaType,\nmediaNativeID: ?string,\n): Promise<{|\nsteps: $ReadOnlyArray<MediaMissionStep>,\n@@ -114,7 +116,9 @@ async function fetchFileInfo(\nlet uri = inputURI,\norientation;\n- if (mediaNativeID) {\n+ const needsLocalURI = !pathFromURI(inputURI);\n+ const needsOrientation = mediaType === 'photo';\n+ if (mediaNativeID && (needsLocalURI || needsOrientation)) {\nconst {\nsteps: assetInfoSteps,\nresult: assetInfoResult,\n" }, { "change_type": "MODIFY", "old_path": "native/media/media-utils.js", "new_path": "native/media/media-utils.js", "diff": "@@ -239,6 +239,7 @@ async function processMedia(\nconst promises = {};\npromises.fileInfoResponse = fetchFileInfo(\nmediaInput.uri,\n+ mediaInput.type,\nmediaInput.mediaNativeID,\n);\nif (mediaInput.type === 'photo' || config.initialBlobCheck) {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Don't fetch asset info if unnecessary
129,187
15.04.2020 21:30:06
14,400
a5ec02294090f009655e95422504aaa186b1dee1
Make sure ffmpeg reports an mp4 on native
[ { "change_type": "MODIFY", "old_path": "lib/types/media-types.js", "new_path": "lib/types/media-types.js", "diff": "@@ -101,6 +101,7 @@ export type VideoProbeMediaMissionStep = {|\npath: string,\next: ?string,\ncodec: ?string,\n+ format: ?string,\n|};\nexport type BlobDataAnalysisMediaMissionStep = {|\n@@ -358,6 +359,7 @@ export const mediaMissionPropType = PropTypes.shape({\npath: PropTypes.string.isRequired,\next: PropTypes.string,\ncodec: PropTypes.string,\n+ format: PropTypes.string,\n}),\nPropTypes.shape({\nstep: PropTypes.oneOf(['video_ffmpeg_transcode']).isRequired,\n" }, { "change_type": "MODIFY", "old_path": "native/media/video-utils.js", "new_path": "native/media/video-utils.js", "diff": "@@ -137,6 +137,7 @@ async function checkVideoCodec(\nconst ext = extensionFromFilename(path);\nlet codec,\n+ format,\nsuccess = false,\nexceptionMessage;\nconst start = Date.now();\n@@ -144,7 +145,8 @@ async function checkVideoCodec(\ntry {\nconst videoInfo = await RNFFmpeg.getMediaInformation(path);\ncodec = getVideoCodec(videoInfo);\n- success = codec === 'h264';\n+ format = videoInfo.format.split(',');\n+ success = codec === 'h264' && format.includes('mp4');\n} catch (e) {\nif (\ne &&\n@@ -165,6 +167,7 @@ async function checkVideoCodec(\npath,\next,\ncodec,\n+ format,\n};\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Make sure ffmpeg reports an mp4 on native
129,187
15.04.2020 21:39:10
14,400
30dce69b80d9a7bf0f1d02fdf3bba953c978ab3b
[native] Kill initialBlobCheck We can only do this for photos anyways since iOS videos need the `localURI` or else they treat it like a photo
[ { "change_type": "MODIFY", "old_path": "native/input/input-state-container.react.js", "new_path": "native/input/input-state-container.react.js", "diff": "@@ -632,7 +632,6 @@ class InputStateContainer extends React.PureComponent<Props, State> {\nconst { viewerID } = this.props;\nif (__DEV__ || (viewerID && isStaff(viewerID))) {\nreturn {\n- initialBlobCheck: true,\nfinalBlobCheck: true,\nblobDataAnalysis: true,\n};\n" }, { "change_type": "MODIFY", "old_path": "native/media/media-utils.js", "new_path": "native/media/media-utils.js", "diff": "@@ -184,7 +184,6 @@ type MediaInput = {|\nmediaNativeID?: string,\n|};\ntype MediaProcessConfig = $Shape<{|\n- initialBlobCheck: boolean,\nfinalBlobCheck: boolean,\nblobDataAnalysis: boolean,\n|}>;\n@@ -242,7 +241,7 @@ async function processMedia(\nmediaInput.type,\nmediaInput.mediaNativeID,\n);\n- if (mediaInput.type === 'photo' || config.initialBlobCheck) {\n+ if (mediaInput.type === 'photo') {\npromises.fetchBlobResponse = fetchBlob(mediaInput.uri, mediaType);\n}\nconst { fileInfoResponse, fetchBlobResponse } = await promiseAll(promises);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Kill initialBlobCheck We can only do this for photos anyways since iOS videos need the `localURI` or else they treat it like a photo
129,187
15.04.2020 21:50:44
14,400
68000e1d5b66cfddd274acfeb4dd6473f5cc7ac7
[native] Add a final file size check to the MediaMission report
[ { "change_type": "MODIFY", "old_path": "native/input/input-state-container.react.js", "new_path": "native/input/input-state-container.react.js", "diff": "@@ -69,6 +69,7 @@ import {\n} from './input-state';\nimport { processMedia } from '../media/media-utils';\nimport { displayActionResultModal } from '../navigation/action-result-modal';\n+import { fetchFileSize } from '../media/file-utils';\nlet nextLocalUploadID = 0;\ntype SelectionWithID = {|\n@@ -600,6 +601,11 @@ class InputStateContainer extends React.PureComponent<Props, State> {\nreturn finish(mediaMissionResult);\n}\n+ // If shouldDisposePath is set, uploadURI represents a new file whose size\n+ // hasn't been checked. Let's add the file size to our MediaMission report\n+ const { steps: fileSizeSteps } = await fetchFileSize(uploadURI);\n+ steps.push(...fileSizeSteps);\n+\nlet disposeSuccess = false,\ndisposeExceptionMessage;\nconst disposeStart = Date.now();\n" }, { "change_type": "MODIFY", "old_path": "native/media/file-utils.js", "new_path": "native/media/file-utils.js", "diff": "@@ -160,4 +160,4 @@ async function fetchFileInfo(\n};\n}\n-export { fetchFileInfo };\n+export { fetchFileInfo, fetchFileSize };\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Add a final file size check to the MediaMission report
129,187
16.04.2020 19:26:39
14,400
e8962932f6df2805b8d31fc35a09f46a3c1d023b
blob-utils.js for native
[ { "change_type": "MODIFY", "old_path": "lib/utils/file-utils.js", "new_path": "lib/utils/file-utils.js", "diff": "@@ -22,11 +22,11 @@ const mimeTypesToExtensions = Object.freeze({\n'video/quicktime': 'mp4',\n});\n-type FileInfo = {|\n+export type FileDataInfo = {|\nmime: ?string,\nmediaType: ?MediaType,\n|};\n-function fileInfoFromData(data: Uint8Array | Buffer): FileInfo {\n+function fileInfoFromData(data: Uint8Array | Buffer): FileDataInfo {\nconst fileTypeResult = fileType(data);\nif (!fileTypeResult) {\nreturn { mime: null, mediaType: null };\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/media/blob-utils.js", "diff": "+// @flow\n+\n+import type { MediaType, MediaMissionStep } from 'lib/types/media-types';\n+\n+import base64 from 'base-64';\n+import invariant from 'invariant';\n+\n+import {\n+ fileInfoFromData,\n+ mimeTypesToMediaTypes,\n+ type FileDataInfo,\n+} from 'lib/utils/file-utils';\n+\n+export type ReactNativeBlob = Blob & {\n+ data: { type: string, name: string, size: number },\n+};\n+\n+// Processes the contents of the blob, looking at \"magic numbers\" to determine\n+// MIME type\n+async function getBlobDataInfo(blob: ReactNativeBlob): Promise<FileDataInfo> {\n+ const dataURI = await blobToDataURI(blob);\n+ const intArray = dataURIToIntArray(dataURI);\n+ return fileInfoFromData(intArray);\n+}\n+\n+function blobToDataURI(blob: Blob): Promise<string> {\n+ const fileReader = new FileReader();\n+ return new Promise((resolve, reject) => {\n+ fileReader.onerror = error => {\n+ fileReader.abort();\n+ reject(error);\n+ };\n+ fileReader.onload = () => {\n+ invariant(\n+ typeof fileReader.result === 'string',\n+ 'FileReader.readAsDataURL should result in string',\n+ );\n+ resolve(fileReader.result);\n+ };\n+ fileReader.readAsDataURL(blob);\n+ });\n+}\n+\n+function dataURIToIntArray(dataURI: string): Uint8Array {\n+ const uri = dataURI.replace(/\\r?\\n/g, '');\n+\n+ const firstComma = uri.indexOf(',');\n+ if (firstComma <= 4) {\n+ throw new TypeError('malformed data-URI');\n+ }\n+\n+ const meta = uri.substring(5, firstComma).split(';');\n+ const base64Encoded = meta.some(metum => metum === 'base64');\n+\n+ let data = unescape(uri.substring(firstComma + 1));\n+ if (base64Encoded) {\n+ data = base64.decode(data);\n+ }\n+\n+ return stringToIntArray(data);\n+}\n+\n+function stringToIntArray(str: string): Uint8Array {\n+ const array = new Uint8Array(str.length);\n+ for (let i = 0; i < str.length; i++) {\n+ array[i] = str.charCodeAt(i);\n+ }\n+ return array;\n+}\n+\n+type FetchBlobResponse = {|\n+ blob: ReactNativeBlob,\n+ reportedMIME: ?string,\n+ reportedMediaType: ?string,\n+|};\n+async function fetchBlob(\n+ uri: string,\n+ type: MediaType,\n+): Promise<{|\n+ steps: $ReadOnlyArray<MediaMissionStep>,\n+ result: ?FetchBlobResponse,\n+|}> {\n+ const blobFetchStart = Date.now();\n+ let blob, reportedMIME, reportedMediaType, exceptionMessage;\n+ try {\n+ blob = await getBlobFromURI(uri, type);\n+ reportedMIME =\n+ uri.startsWith('ph://') && blob.type === 'application/octet-stream'\n+ ? 'video/quicktime'\n+ : blob.type;\n+ reportedMediaType = mimeTypesToMediaTypes[reportedMIME];\n+ } catch (e) {\n+ if (\n+ e &&\n+ typeof e === 'object' &&\n+ e.message &&\n+ typeof e.message === 'string'\n+ ) {\n+ exceptionMessage = e.message;\n+ }\n+ }\n+\n+ const compareTypesStep = {\n+ step: 'compare_blob_mime_to_media_type',\n+ type,\n+ success: type === reportedMediaType,\n+ exceptionMessage,\n+ time: Date.now() - blobFetchStart,\n+ blobFetched: !!blob,\n+ blobMIME: blob ? blob.type : null,\n+ reportedMIME,\n+ blobName: blob && blob.data ? blob.data.name : null,\n+ size: blob ? blob.size : null,\n+ };\n+\n+ if (!blob) {\n+ return { steps: [compareTypesStep], result: null };\n+ }\n+\n+ const result = {\n+ blob,\n+ reportedMIME,\n+ reportedMediaType,\n+ };\n+ return { steps: [compareTypesStep], result };\n+}\n+\n+async function getBlobFromURI(\n+ uri: string,\n+ type: MediaType,\n+): Promise<ReactNativeBlob> {\n+ // React Native always resolves FBMediaKit's ph:// scheme as an image so that\n+ // the Image component can render thumbnails of videos. In order to force\n+ // fetch() to return a blob of the video, we need to use the ph-upload://\n+ // scheme. https://git.io/Jerlh\n+ const fbMediaKitURL = uri.startsWith('ph://');\n+ const fixedURI =\n+ fbMediaKitURL && type === 'video' ? uri.replace(/^ph:/, 'ph-upload:') : uri;\n+ const response = await fetch(fixedURI);\n+ return await response.blob();\n+}\n+\n+export { getBlobDataInfo, blobToDataURI, dataURIToIntArray, fetchBlob };\n" }, { "change_type": "MODIFY", "old_path": "native/media/media-utils.js", "new_path": "native/media/media-utils.js", "diff": "@@ -9,95 +9,15 @@ import type {\n} from 'lib/types/media-types';\nimport { Image } from 'react-native';\n-import base64 from 'base-64';\nimport invariant from 'invariant';\n-import {\n- fileInfoFromData,\n- mimeTypesToMediaTypes,\n- pathFromURI,\n- readableFilename,\n-} from 'lib/utils/file-utils';\n+import { pathFromURI, readableFilename } from 'lib/utils/file-utils';\nimport { promiseAll } from 'lib/utils/promises';\nimport { fetchFileInfo } from './file-utils';\nimport { processVideo } from './video-utils';\nimport { processImage } from './image-utils';\n-\n-type ReactNativeBlob = Blob & {\n- data: { type: string, name: string, size: number },\n-};\n-async function getBlobFromURI(\n- uri: string,\n- type: MediaType,\n-): Promise<ReactNativeBlob> {\n- // React Native always resolves FBMediaKit's ph:// scheme as an image so that\n- // the Image component can render thumbnails of videos. In order to force\n- // fetch() to return a blob of the video, we need to use the ph-upload://\n- // scheme. https://git.io/Jerlh\n- const fbMediaKitURL = uri.startsWith('ph://');\n- const fixedURI =\n- fbMediaKitURL && type === 'video' ? uri.replace(/^ph:/, 'ph-upload:') : uri;\n- const response = await fetch(fixedURI);\n- return await response.blob();\n-}\n-\n-type FetchBlobResponse = {|\n- blob: ReactNativeBlob,\n- reportedMIME: ?string,\n- reportedMediaType: ?string,\n-|};\n-async function fetchBlob(\n- uri: string,\n- type: MediaType,\n-): Promise<{|\n- steps: $ReadOnlyArray<MediaMissionStep>,\n- result: ?FetchBlobResponse,\n-|}> {\n- const blobFetchStart = Date.now();\n- let blob, reportedMIME, reportedMediaType, exceptionMessage;\n- try {\n- blob = await getBlobFromURI(uri, type);\n- reportedMIME =\n- uri.startsWith('ph://') && blob.type === 'application/octet-stream'\n- ? 'video/quicktime'\n- : blob.type;\n- reportedMediaType = mimeTypesToMediaTypes[reportedMIME];\n- } catch (e) {\n- if (\n- e &&\n- typeof e === 'object' &&\n- e.message &&\n- typeof e.message === 'string'\n- ) {\n- exceptionMessage = e.message;\n- }\n- }\n-\n- const compareTypesStep = {\n- step: 'compare_blob_mime_to_media_type',\n- type,\n- success: type === reportedMediaType,\n- exceptionMessage,\n- time: Date.now() - blobFetchStart,\n- blobFetched: !!blob,\n- blobMIME: blob ? blob.type : null,\n- reportedMIME,\n- blobName: blob && blob.data ? blob.data.name : null,\n- size: blob ? blob.size : null,\n- };\n-\n- if (!blob) {\n- return { steps: [compareTypesStep], result: null };\n- }\n-\n- const result = {\n- blob,\n- reportedMIME,\n- reportedMediaType,\n- };\n- return { steps: [compareTypesStep], result };\n-}\n+import { getBlobDataInfo, fetchBlob, type ReactNativeBlob } from './blob-utils';\nasync function checkBlobData(\nuploadURI: string,\n@@ -107,9 +27,7 @@ async function checkBlobData(\nlet mime, mediaType, exceptionMessage;\nconst start = Date.now();\ntry {\n- const dataURI = await blobToDataURI(blob);\n- const intArray = dataURIToIntArray(dataURI);\n- ({ mime, mediaType } = fileInfoFromData(intArray));\n+ ({ mime, mediaType } = await getBlobDataInfo(blob));\n} catch (e) {\nif (\ne &&\n@@ -131,51 +49,6 @@ async function checkBlobData(\n};\n}\n-function blobToDataURI(blob: Blob): Promise<string> {\n- const fileReader = new FileReader();\n- return new Promise((resolve, reject) => {\n- fileReader.onerror = error => {\n- fileReader.abort();\n- reject(error);\n- };\n- fileReader.onload = () => {\n- invariant(\n- typeof fileReader.result === 'string',\n- 'FileReader.readAsDataURL should result in string',\n- );\n- resolve(fileReader.result);\n- };\n- fileReader.readAsDataURL(blob);\n- });\n-}\n-\n-function stringToIntArray(str: string): Uint8Array {\n- const array = new Uint8Array(str.length);\n- for (let i = 0; i < str.length; i++) {\n- array[i] = str.charCodeAt(i);\n- }\n- return array;\n-}\n-\n-function dataURIToIntArray(dataURI: string): Uint8Array {\n- const uri = dataURI.replace(/\\r?\\n/g, '');\n-\n- const firstComma = uri.indexOf(',');\n- if (firstComma <= 4) {\n- throw new TypeError('malformed data-URI');\n- }\n-\n- const meta = uri.substring(5, firstComma).split(';');\n- const base64Encoded = meta.some(metum => metum === 'base64');\n-\n- let data = unescape(uri.substring(firstComma + 1));\n- if (base64Encoded) {\n- data = base64.decode(data);\n- }\n-\n- return stringToIntArray(data);\n-}\n-\ntype MediaInput = {|\ntype: MediaType,\nuri: string,\n@@ -393,10 +266,4 @@ function getCompatibleMediaURI(uri: string, ext: ?string): string {\n);\n}\n-export {\n- blobToDataURI,\n- dataURIToIntArray,\n- processMedia,\n- getDimensions,\n- getCompatibleMediaURI,\n-};\n+export { processMedia, getDimensions, getCompatibleMediaURI };\n" }, { "change_type": "MODIFY", "old_path": "native/media/save-image.js", "new_path": "native/media/save-image.js", "diff": "@@ -7,7 +7,7 @@ import * as MediaLibrary from 'expo-media-library';\nimport { fileInfoFromData, readableFilename } from 'lib/utils/file-utils';\n-import { blobToDataURI, dataURIToIntArray } from './media-utils';\n+import { blobToDataURI, dataURIToIntArray } from './blob-utils';\nimport { displayActionResultModal } from '../navigation/action-result-modal';\nimport { getAndroidPermission } from '../utils/android-permissions';\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
blob-utils.js for native
129,187
16.04.2020 19:37:48
14,400
2f9705c15c3f12220a6f0fe2797199fe2f7b547e
[native] Convert media-library URLs before saving on iOS
[ { "change_type": "MODIFY", "old_path": "native/media/media-utils.js", "new_path": "native/media/media-utils.js", "diff": "@@ -266,4 +266,23 @@ function getCompatibleMediaURI(uri: string, ext: ?string): string {\n);\n}\n-export { processMedia, getDimensions, getCompatibleMediaURI };\n+const mediaLibraryIdentifierRegex = new RegExp(\n+ '^assets-library:\\\\/\\\\/asset\\\\/asset.[a-z0-9]+\\\\?id=([a-z0-9-]+)',\n+ 'i',\n+);\n+\n+function getMediaLibraryIdentifier(inputURI: string): ?string {\n+ const uri = getCompatibleMediaURI(inputURI);\n+ const matches = uri.match(mediaLibraryIdentifierRegex);\n+ if (!matches) {\n+ return null;\n+ }\n+ return matches[1];\n+}\n+\n+export {\n+ processMedia,\n+ getDimensions,\n+ getCompatibleMediaURI,\n+ getMediaLibraryIdentifier,\n+};\n" }, { "change_type": "MODIFY", "old_path": "native/media/save-image.js", "new_path": "native/media/save-image.js", "diff": "@@ -8,6 +8,7 @@ import * as MediaLibrary from 'expo-media-library';\nimport { fileInfoFromData, readableFilename } from 'lib/utils/file-utils';\nimport { blobToDataURI, dataURIToIntArray } from './blob-utils';\n+import { getMediaLibraryIdentifier } from './media-utils';\nimport { displayActionResultModal } from '../navigation/action-result-modal';\nimport { getAndroidPermission } from '../utils/android-permissions';\n@@ -24,21 +25,16 @@ type SaveImageInfo =\n};\nasync function intentionalSaveImage(mediaInfo: SaveImageInfo) {\n- let result, message;\n+ let errorMessage;\nif (Platform.OS === 'android') {\n- result = await saveImageAndroid(mediaInfo, 'request');\n+ errorMessage = await saveImageAndroid(mediaInfo, 'request');\n} else if (Platform.OS === 'ios') {\n- result = await saveImageIOS(mediaInfo);\n+ errorMessage = await saveImageIOS(mediaInfo);\n} else {\n- message = `saving images is unsupported on ${Platform.OS}`;\n- }\n-\n- if (result) {\n- message = 'saved!';\n- } else if (!message) {\n- message = \"don't have permission :(\";\n+ errorMessage = `saving images is unsupported on ${Platform.OS}`;\n}\n+ const message = errorMessage ? errorMessage : 'saved!';\ndisplayActionResultModal(message);\n}\n@@ -71,32 +67,44 @@ async function saveImageAndroid(\n);\n}\nif (!hasPermission) {\n- return false;\n+ return \"don't have permission :(\";\n}\nconst saveFolder = `${filesystem.PicturesDirectoryPath}/SquadCal`;\nawait filesystem.mkdir(saveFolder);\nconst filePath = await saveToDisk(mediaInfo.uri, saveFolder);\nawait filesystem.scanFile(filePath);\n- return true;\n+ return null;\n}\n// On iOS, we save the image to the camera roll\nasync function saveImageIOS(mediaInfo: SaveImageInfo) {\n- const { uri } = mediaInfo;\n-\n+ let { uri } = mediaInfo;\nlet tempFile;\nif (uri.startsWith('http')) {\ntempFile = await saveToDisk(uri, filesystem.TemporaryDirectoryPath);\n+ uri = `file://${tempFile}`;\n+ } else if (!uri.startsWith('file://')) {\n+ const mediaNativeID = getMediaLibraryIdentifier(uri);\n+ if (mediaNativeID) {\n+ try {\n+ const assetInfo = await MediaLibrary.getAssetInfoAsync(mediaNativeID);\n+ uri = assetInfo.localUri;\n+ } catch {}\n+ }\n+ }\n+\n+ if (!uri.startsWith('file://')) {\n+ console.log(`could not resolve a path for ${uri}`);\n+ return 'failed to resolve :(';\n}\n- const saveURI = tempFile ? `file://${tempFile}` : uri;\n- await MediaLibrary.saveToLibraryAsync(saveURI);\n+ await MediaLibrary.saveToLibraryAsync(uri);\nif (tempFile) {\nawait filesystem.unlink(tempFile);\n}\n- return true;\n+ return null;\n}\nasync function saveToDisk(uri: string, directory: string) {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Convert media-library URLs before saving on iOS
129,187
16.04.2020 20:15:08
14,400
74c86e74c7de2c4acd13bc1b63b986beb524c8e7
[native] Name downloaded files based on md5 hash
[ { "change_type": "MODIFY", "old_path": "native/media/save-image.js", "new_path": "native/media/save-image.js", "diff": "@@ -4,6 +4,7 @@ import { Platform, PermissionsAndroid } from 'react-native';\nimport filesystem from 'react-native-fs';\nimport invariant from 'invariant';\nimport * as MediaLibrary from 'expo-media-library';\n+import md5 from 'md5';\nimport { fileInfoFromData, readableFilename } from 'lib/utils/file-utils';\n@@ -107,6 +108,7 @@ async function saveImageIOS(mediaInfo: SaveImageInfo) {\nreturn null;\n}\n+// only works on file: and http[s]: schemes\nasync function saveToDisk(uri: string, directory: string) {\nconst response = await fetch(uri);\nconst blob = await response.blob();\n@@ -116,11 +118,10 @@ async function saveToDisk(uri: string, directory: string) {\nconst base64 = dataURI.substring(firstComma + 1);\nconst intArray = dataURIToIntArray(dataURI);\n- const fileName = blob.data.name ? blob.data.name : '';\nconst { mime } = fileInfoFromData(intArray);\ninvariant(mime, `unsupported media type in saveToDisk`);\n- const name = readableFilename(fileName, mime);\n+ const name = readableFilename(md5(dataURI), mime);\ninvariant(name, `unsupported mime type ${mime} in saveToDisk`);\nconst filePath = `${directory}/${name}`;\n" }, { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"lodash\": \"^4.17.5\",\n\"lottie-ios\": \"3.1.3\",\n\"lottie-react-native\": \"^3.2.1\",\n+ \"md5\": \"^2.2.1\",\n\"prop-types\": \"^15.6.0\",\n\"react\": \"16.9.0\",\n\"react-native\": \"0.61.5\",\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Name downloaded files based on md5 hash
129,187
16.04.2020 20:38:48
14,400
273e14878851460f59f52235754850425e40fc7f
[native] Use MIME type from blob instead of parsing magic numbers in saveImage
[ { "change_type": "MODIFY", "old_path": "native/media/save-image.js", "new_path": "native/media/save-image.js", "diff": "@@ -112,13 +112,17 @@ async function saveImageIOS(mediaInfo: SaveImageInfo) {\nasync function saveToDisk(uri: string, directory: string) {\nconst response = await fetch(uri);\nconst blob = await response.blob();\n+\nconst dataURI = await blobToDataURI(blob);\nconst firstComma = dataURI.indexOf(',');\ninvariant(firstComma > 4, 'malformed data-URI');\nconst base64 = dataURI.substring(firstComma + 1);\n+ let mime = blob.type;\n+ if (!mime) {\nconst intArray = dataURIToIntArray(dataURI);\n- const { mime } = fileInfoFromData(intArray);\n+ ({ mime } = fileInfoFromData(intArray));\n+ }\ninvariant(mime, `unsupported media type in saveToDisk`);\nconst name = readableFilename(md5(dataURI), mime);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Use MIME type from blob instead of parsing magic numbers in saveImage