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 | 08.04.2019 00:01:21 | 14,400 | 9d41f51fae2084b3fdab3656cb3a4bfb4efa08ca | [native] Hide media in MessageList while MultimediaModal open or transitioning | [
{
"change_type": "MODIFY",
"old_path": "native/chat/multimedia-message-multimedia.react.js",
"new_path": "native/chat/multimedia-message-multimedia.react.js",
"diff": "@@ -10,35 +10,94 @@ import {\ntype VerticalBounds,\nverticalBoundsPropType,\n} from '../media/vertical-bounds';\n+import type { AppState } from '../redux/redux-setup';\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { View, TouchableWithoutFeedback, StyleSheet } from 'react-native';\n+import Animated from 'react-native-reanimated';\n+\n+import { connect } from 'lib/utils/redux-utils';\nimport Multimedia from '../media/multimedia.react';\n+import { modalsClosedSelector } from '../selectors/nav-selectors';\n+import { withLightboxPositionContext } from '../media/lightbox-navigator.react';\ntype Props = {|\nmedia: Media,\nnavigate: Navigate,\nverticalBounds: ?VerticalBounds,\nstyle?: ImageStyle,\n+ // Redux state\n+ modalsClosed: bool,\n+ // withLightboxPositionContext\n+ lightboxPosition: ?Animated.Value,\n+|};\n+type State = {|\n+ hidden: bool,\n+ opacity: ?Animated.Value,\n|};\n-class MultimediaMessageMultimedia extends React.PureComponent<Props> {\n+class MultimediaMessageMultimedia extends React.PureComponent<Props, State> {\nstatic propTypes = {\nmedia: mediaPropType.isRequired,\nnavigate: PropTypes.func.isRequired,\nverticalBounds: verticalBoundsPropType,\n+ modalsClosed: PropTypes.bool.isRequired,\n+ lightboxPosition: PropTypes.instanceOf(Animated.Value),\n};\nview: ?View;\n+ constructor(props: Props) {\n+ super(props);\n+ this.state = {\n+ hidden: false,\n+ opacity: this.getOpacity(),\n+ };\n+ }\n+\n+ static getDerivedStateFromProps(props: Props, state: State) {\n+ if (props.modalsClosed && state.hidden) {\n+ return { hidden: false };\n+ }\n+ return null;\n+ }\n+\n+ getOpacity() {\n+ const { lightboxPosition } = this.props;\n+ if (!lightboxPosition) {\n+ return null;\n+ }\n+ return Animated.interpolate(\n+ this.props.lightboxPosition,\n+ {\n+ inputRange: [ 0.1, 0.11 ],\n+ outputRange: [ 1, 0 ],\n+ extrapolate: Animated.Extrapolate.CLAMP,\n+ },\n+ );\n+ }\n+\n+ componentDidUpdate(prevProps: Props) {\n+ const { lightboxPosition } = this.props;\n+ if (lightboxPosition !== prevProps.lightboxPosition) {\n+ this.setState({ opacity: this.getOpacity() });\n+ }\n+ }\n+\nrender() {\nconst { media, style } = this.props;\n+ const wrapperStyles = [ styles.expand ];\n+ if (this.state.hidden && this.state.opacity) {\n+ wrapperStyles.push({ opacity: this.state.opacity });\n+ }\nreturn (\n<TouchableWithoutFeedback onPress={this.onPress}>\n+ <Animated.View style={wrapperStyles}>\n<View style={[ styles.expand, style ]} ref={this.viewRef}>\n<Multimedia media={media} />\n</View>\n+ </Animated.View>\n</TouchableWithoutFeedback>\n);\n}\n@@ -59,6 +118,7 @@ class MultimediaMessageMultimedia extends React.PureComponent<Props> {\nrouteName: MultimediaModalRouteName,\nparams: { media, initialCoordinates: coordinates, verticalBounds },\n});\n+ this.setState({ hidden: true });\n});\n}\n@@ -70,4 +130,10 @@ const styles = StyleSheet.create({\n},\n});\n-export default MultimediaMessageMultimedia;\n+export default withLightboxPositionContext(\n+ connect(\n+ (state: AppState) => ({\n+ modalsClosed: modalsClosedSelector(state),\n+ }),\n+ )(MultimediaMessageMultimedia),\n+);\n"
},
{
"change_type": "MODIFY",
"old_path": "native/media/lightbox-navigator.react.js",
"new_path": "native/media/lightbox-navigator.react.js",
"diff": "@@ -28,6 +28,9 @@ import {\nimport { Transitioner } from 'react-navigation-stack';\nimport Animated, { Easing } from 'react-native-reanimated';\n+const LightboxPositionContext: React.Context<Animated.Value>\n+ = React.createContext(null);\n+\nfunction createLightboxNavigator(\nrouteConfigMap: NavigationRouteConfigMap,\nstackConfig: StackNavigatorConfig = {},\n@@ -128,9 +131,9 @@ class Lightbox extends React.PureComponent<Props> {\ntransitionProps,\n);\nreturn (\n- <React.Fragment>\n+ <LightboxPositionContext.Provider value={this.position}>\n{scenes.map(renderScene)}\n- </React.Fragment>\n+ </LightboxPositionContext.Provider>\n);\n}\n@@ -164,6 +167,27 @@ const styles = StyleSheet.create({\n},\n});\n+function withLightboxPositionContext<\n+ AllProps: {},\n+ ComponentType: React.ComponentType<AllProps>,\n+>(Component: ComponentType): React.ComponentType<$Diff<\n+ React.ElementConfig<ComponentType>,\n+ { lightboxPosition: ?Animated.Value },\n+>> {\n+ class LightboxPositionHOC extends React.PureComponent<$Diff<\n+ React.ElementConfig<ComponentType>,\n+ { lightboxPosition: ?Animated.Value },\n+ >> {\n+ static contextType = LightboxPositionContext;\n+ render() {\n+ const lightboxPosition = this.context;\n+ return <Component {...this.props} lightboxPosition={lightboxPosition} />;\n+ }\n+ }\n+ return LightboxPositionHOC;\n+}\n+\nexport {\ncreateLightboxNavigator,\n+ withLightboxPositionContext,\n};\n"
},
{
"change_type": "MODIFY",
"old_path": "native/selectors/nav-selectors.js",
"new_path": "native/selectors/nav-selectors.js",
"diff": "@@ -60,16 +60,30 @@ const baseCreateActiveTabSelector =\nreturn false;\n}\nconst appRoute = assertNavigationRouteNotLeafNode(currentRootSubroute);\n- const [ appSubroute ] = appRoute.routes;\n- if (appSubroute.routeName !== TabNavigatorRouteName) {\n+ const [ firstAppSubroute ] = appRoute.routes;\n+ if (firstAppSubroute.routeName !== TabNavigatorRouteName) {\nreturn false;\n}\n- const tabRoute = assertNavigationRouteNotLeafNode(appSubroute);\n+ const tabRoute = assertNavigationRouteNotLeafNode(firstAppSubroute);\nreturn tabRoute.routes[tabRoute.index].routeName === routeName;\n},\n);\nconst createActiveTabSelector = _memoize<*, *>(baseCreateActiveTabSelector);\n+const modalsClosedSelector = createSelector<*, *, *, *>(\n+ (state: AppState) => state.navInfo.navigationState,\n+ (navigationState: NavigationState) => {\n+ const currentRootSubroute = navigationState.routes[navigationState.index];\n+ if (currentRootSubroute.routeName !== AppRouteName) {\n+ return false;\n+ }\n+ const appRoute = assertNavigationRouteNotLeafNode(currentRootSubroute);\n+ const currentAppSubroute = appRoute.routes[appRoute.index];\n+ return !appRoute.isTransitioning &&\n+ currentAppSubroute.routeName === TabNavigatorRouteName;\n+ },\n+);\n+\nconst activeThreadSelector = createSelector<*, *, *, *>(\n(state: AppState) => state.navInfo.navigationState,\n(navigationState: NavigationState): ?string => {\n@@ -78,11 +92,11 @@ const activeThreadSelector = createSelector<*, *, *, *>(\nreturn null;\n}\nconst appRoute = assertNavigationRouteNotLeafNode(currentRootSubroute);\n- const [ appSubroute ] = appRoute.routes;\n- if (appSubroute.routeName !== TabNavigatorRouteName) {\n+ const [ firstAppSubroute ] = appRoute.routes;\n+ if (firstAppSubroute.routeName !== TabNavigatorRouteName) {\nreturn null;\n}\n- const tabRoute = assertNavigationRouteNotLeafNode(appSubroute);\n+ const tabRoute = assertNavigationRouteNotLeafNode(firstAppSubroute);\nconst currentTabSubroute = tabRoute.routes[tabRoute.index];\nif (currentTabSubroute.routeName !== ChatRouteName) {\nreturn null;\n@@ -161,6 +175,7 @@ export {\nappLoggedInSelector,\nforegroundKeySelector,\ncreateActiveTabSelector,\n+ modalsClosedSelector,\nactiveThreadSelector,\nappCanRespondToBackButtonSelector,\ncalendarActiveSelector,\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Hide media in MessageList while MultimediaModal open or transitioning |
129,187 | 08.04.2019 22:54:32 | 14,400 | f9e5e963fded815e7a625560be286820d8d0924c | [native] Enlarge MultimediaModal close button tap target | [
{
"change_type": "MODIFY",
"old_path": "native/media/multimedia-modal.react.js",
"new_path": "native/media/multimedia-modal.react.js",
"diff": "@@ -811,7 +811,7 @@ class MultimediaModal extends React.PureComponent<Props> {\nconst backdropStyle = { opacity: this.progress };\nconst closeButtonStyle = {\nopacity: this.progress,\n- top: Math.max(this.props.contentVerticalOffset, 6),\n+ top: Math.max(this.props.contentVerticalOffset - 2, 4),\n};\nconst view = (\n<Animated.View style={styles.container}>\n@@ -890,9 +890,13 @@ const styles = StyleSheet.create({\n},\ncloseButtonContainer: {\nposition: \"absolute\",\n- right: 12,\n+ right: 4,\n},\ncloseButton: {\n+ paddingTop: 2,\n+ paddingBottom: 2,\n+ paddingLeft: 8,\n+ paddingRight: 8,\nfontSize: 36,\ncolor: \"white\",\ntextShadowColor: \"#000\",\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Enlarge MultimediaModal close button tap target |
129,187 | 09.04.2019 17:52:32 | 14,400 | 5a1cda22010954f0702bf296868732613667cd38 | [native] Dismiss-from-pan for MultimediaModal | [
{
"change_type": "MODIFY",
"old_path": "native/media/multimedia-modal.react.js",
"new_path": "native/media/multimedia-modal.react.js",
"diff": "@@ -49,6 +49,7 @@ const {\nevent,\nExtrapolate,\nset,\n+ call,\ncond,\nnot,\nand,\n@@ -60,8 +61,11 @@ const {\nsub,\nmultiply,\ndivide,\n+ pow,\nmax,\n+ min,\nround,\n+ abs,\ninterpolate,\nstartClock,\nstopClock,\n@@ -152,6 +156,7 @@ function runDecay(\nclock: Clock,\nvelocity: Value,\ninitialPosition: Value,\n+ startStopClock: bool = true,\n): Value {\nconst state = {\nfinished: new Value(0),\n@@ -168,14 +173,14 @@ function runDecay(\nset(state.velocity, velocity),\nset(state.position, initialPosition),\nset(state.time, 0),\n- startClock(clock),\n+ startStopClock && startClock(clock),\n],\n),\ndecay(clock, state, config),\nset(velocity, state.velocity),\ncond(\nstate.finished,\n- stopClock(clock),\n+ startStopClock && stopClock(clock),\n),\nstate.position,\n];\n@@ -247,10 +252,10 @@ class MultimediaModal extends React.PureComponent<Props> {\npanEvent;\ntapEvent;\n- progress: Value;\nscale: Value;\nx: Value;\ny: Value;\n+ opacity: Value;\nimageContainerOpacity: Value;\nconstructor(props: Props) {\n@@ -277,7 +282,7 @@ class MultimediaModal extends React.PureComponent<Props> {\nconst { position } = props;\nconst { index } = props.scene;\n- this.progress = interpolate(\n+ const progress = interpolate(\nposition,\n{\ninputRange: [ index - 1, index ],\n@@ -285,14 +290,6 @@ class MultimediaModal extends React.PureComponent<Props> {\nextrapolate: Extrapolate.CLAMP,\n},\n);\n- this.imageContainerOpacity = interpolate(\n- this.progress,\n- {\n- inputRange: [ 0, 0.1 ],\n- outputRange: [ 0, 1 ],\n- extrapolate: Extrapolate.CLAMP,\n- },\n- );\n// The inputs we receive from PanGestureHandler\nconst panState = new Value(-1);\n@@ -337,27 +334,31 @@ class MultimediaModal extends React.PureComponent<Props> {\ny: tapY,\n},\n}]);\n- const tapActive = gestureJustEnded(tapState);\n- // Shared between Pan/Pinch. After a gesture completes, values are\n- // moved to these variables and then animated back to valid ranges\n+ // The all-important outputs\nconst curScale = new Value(1);\nconst curX = new Value(0);\nconst curY = new Value(0);\n+ const curOpacity = new Value(1);\n// The centered variables help us know if we need to be recentered\nconst recenteredScale = max(curScale, 1);\nconst horizontalPanSpace = this.horizontalPanSpace(recenteredScale);\nconst verticalPanSpace = this.verticalPanSpace(recenteredScale);\n- const resetScaleClock = new Clock();\nconst resetXClock = new Clock();\nconst resetYClock = new Clock();\n- const flingXClock = new Clock();\n- const flingYClock = new Clock();\nconst zoomClock = new Clock();\n+\n+ const dismissingFromPan = new Value(0);\n+\n+ const roundedCurScale = divide(round(multiply(curScale, 1000)), 1000);\nconst gestureActive = or(pinchActive, panActive);\n- const gestureOrZoomActive = or(gestureActive, clockRunning(zoomClock));\n+ const activeInteraction = or(\n+ gestureActive,\n+ clockRunning(zoomClock),\n+ dismissingFromPan,\n+ );\nconst updates = [\nthis.pinchUpdate(\n@@ -377,20 +378,31 @@ class MultimediaModal extends React.PureComponent<Props> {\ncurY,\n),\nthis.doubleTapUpdate(\n- tapActive,\n+ tapState,\ntapX,\ntapY,\n+ roundedCurScale,\nzoomClock,\ngestureActive,\ncurScale,\ncurX,\ncurY,\n),\n+ this.opacityUpdate(\n+ panState,\n+ pinchActive,\n+ panVelocityX,\n+ panVelocityY,\n+ curX,\n+ curY,\n+ roundedCurScale,\n+ curOpacity,\n+ dismissingFromPan,\n+ ),\nthis.recenter(\n- resetScaleClock,\nresetXClock,\nresetYClock,\n- gestureOrZoomActive,\n+ activeInteraction,\nrecenteredScale,\nhorizontalPanSpace,\nverticalPanSpace,\n@@ -399,11 +411,9 @@ class MultimediaModal extends React.PureComponent<Props> {\ncurY,\n),\nthis.flingUpdate(\n- flingXClock,\n- flingYClock,\nresetXClock,\nresetYClock,\n- gestureOrZoomActive,\n+ activeInteraction,\npanVelocityX,\npanVelocityY,\nhorizontalPanSpace,\n@@ -415,19 +425,29 @@ class MultimediaModal extends React.PureComponent<Props> {\nconst updatedScale = [ updates, curScale ];\nconst updatedCurX = [ updates, curX ];\nconst updatedCurY = [ updates, curY ];\n+ const updatedOpacity = [ updates, curOpacity ];\n- const reverseProgress = sub(1, this.progress);\n+ const reverseProgress = sub(1, progress);\nthis.scale = add(\nmultiply(reverseProgress, initialScale),\n- multiply(this.progress, updatedScale),\n+ multiply(progress, updatedScale),\n);\nthis.x = add(\nmultiply(reverseProgress, initialTranslateX),\n- multiply(this.progress, updatedCurX),\n+ multiply(progress, updatedCurX),\n);\nthis.y = add(\nmultiply(reverseProgress, initialTranslateY),\n- multiply(this.progress, updatedCurY),\n+ multiply(progress, updatedCurY),\n+ );\n+ this.opacity = multiply(progress, updatedOpacity);\n+ this.imageContainerOpacity = interpolate(\n+ progress,\n+ {\n+ inputRange: [ 0, 0.1 ],\n+ outputRange: [ 0, 1 ],\n+ extrapolate: Extrapolate.CLAMP,\n+ },\n);\n}\n@@ -511,19 +531,20 @@ class MultimediaModal extends React.PureComponent<Props> {\n}\ndoubleTapUpdate(\n- tapActive: Value,\n+ // Inputs\n+ tapState: Value,\ntapX: Value,\ntapY: Value,\n+ roundedCurScale: Value,\nzoomClock: Clock,\ngestureActive: Value,\n+ // Outputs\ncurScale: Value,\ncurX: Value,\ncurY: Value,\n): Value {\nconst zoomClockRunning = clockRunning(zoomClock);\nconst zoomActive = and(not(gestureActive), zoomClockRunning);\n-\n- const roundedCurScale = divide(round(multiply(curScale, 1000)), 1000);\nconst targetScale = cond(greaterThan(roundedCurScale, 1), 1, 3);\nconst tapXDiff = sub(tapX, this.centerX, curX);\n@@ -561,11 +582,13 @@ class MultimediaModal extends React.PureComponent<Props> {\nconst deltaX = panDelta(zoomX, zoomActive);\nconst deltaY = panDelta(zoomY, zoomActive);\n+ const tapJustEnded = gestureJustEnded(tapState);\n+\nreturn cond(\n- [ deltaX, deltaY, deltaScale, gestureActive ],\n+ [ tapJustEnded, deltaX, deltaY, deltaScale, gestureActive ],\nstopClock(zoomClock),\ncond(\n- or(zoomClockRunning, tapActive),\n+ or(zoomClockRunning, tapJustEnded),\n[\nzoomX,\nzoomY,\n@@ -578,12 +601,66 @@ class MultimediaModal extends React.PureComponent<Props> {\n);\n}\n+ opacityUpdate(\n+ // Inputs\n+ panState: Value,\n+ pinchActive: Value,\n+ panVelocityX: Value,\n+ panVelocityY: Value,\n+ curX: Value,\n+ curY: Value,\n+ roundedCurScale: Value,\n+ // Outputs\n+ curOpacity: Value,\n+ dismissingFromPan: Value,\n+ ): Value {\n+ const progressiveOpacity = max(\n+ min(\n+ sub(1, abs(divide(curX, this.screenWidth))),\n+ sub(1, abs(divide(curY, this.screenHeight))),\n+ ),\n+ 0,\n+ );\n+ const panJustEnded = gestureJustEnded(panState);\n+\n+ const resetClock = new Clock();\n+\n+ const velocity = pow(add(pow(panVelocityX, 2), pow(panVelocityY, 2)), 0.5);\n+ const shouldGoBack = and(\n+ panJustEnded,\n+ or(\n+ greaterThan(velocity, 50),\n+ greaterThan(0.7, progressiveOpacity),\n+ ),\n+ );\n+\n+ const decayClock = new Clock();\n+ const decay = [\n+ set(curX, runDecay(decayClock, panVelocityX, curX, false)),\n+ set(curY, runDecay(decayClock, panVelocityY, curY)),\n+ ];\n+\n+ return cond(\n+ [ panJustEnded, dismissingFromPan ],\n+ decay,\n+ cond(\n+ or(pinchActive, greaterThan(roundedCurScale, 1)),\n+ set(curOpacity, runTiming(resetClock, curOpacity, 1)),\n+ [\n+ stopClock(resetClock),\n+ set(curOpacity, progressiveOpacity),\n+ set(dismissingFromPan, shouldGoBack),\n+ cond(shouldGoBack, call([ ], this.close)),\n+ ],\n+ ),\n+ );\n+ }\n+\nrecenter(\n// Inputs\n- resetScaleClock: Clock,\nresetXClock: Clock,\nresetYClock: Clock,\n- gestureOrZoomActive: Value,\n+ activeInteraction: Value,\nrecenteredScale: Value,\nhorizontalPanSpace: Value,\nverticalPanSpace: Value,\n@@ -592,6 +669,8 @@ class MultimediaModal extends React.PureComponent<Props> {\ncurX: Value,\ncurY: Value,\n): Value {\n+ const resetScaleClock = new Clock();\n+\nconst recenteredX = clamp(\ncurX,\nmultiply(-1, horizontalPanSpace),\n@@ -602,8 +681,9 @@ class MultimediaModal extends React.PureComponent<Props> {\nmultiply(-1, verticalPanSpace),\nverticalPanSpace,\n);\n+\nreturn cond(\n- gestureOrZoomActive,\n+ activeInteraction,\n[\nstopClock(resetScaleClock),\nstopClock(resetXClock),\n@@ -637,11 +717,9 @@ class MultimediaModal extends React.PureComponent<Props> {\nflingUpdate(\n// Inputs\n- flingXClock: Clock,\n- flingYClock: Clock,\nresetXClock: Clock,\nresetYClock: Clock,\n- gestureOrZoomActive: Value,\n+ activeInteraction: Value,\npanVelocityX: Value,\npanVelocityY: Value,\nhorizontalPanSpace: Value,\n@@ -650,6 +728,9 @@ class MultimediaModal extends React.PureComponent<Props> {\ncurX: Value,\ncurY: Value,\n): Value {\n+ const flingXClock = new Clock();\n+ const flingYClock = new Clock();\n+\nconst decayX = runDecay(flingXClock, panVelocityX, curX);\nconst recenteredX = clamp(\ndecayX,\n@@ -662,8 +743,9 @@ class MultimediaModal extends React.PureComponent<Props> {\nmultiply(-1, verticalPanSpace),\nverticalPanSpace,\n);\n+\nreturn cond(\n- gestureOrZoomActive,\n+ activeInteraction,\n[\nstopClock(flingXClock),\nstopClock(flingYClock),\n@@ -808,9 +890,9 @@ class MultimediaModal extends React.PureComponent<Props> {\nconst statusBar = MultimediaModal.isActive(this.props)\n? <ConnectedStatusBar barStyle=\"light-content\" />\n: null;\n- const backdropStyle = { opacity: this.progress };\n+ const backdropStyle = { opacity: this.opacity };\nconst closeButtonStyle = {\n- opacity: this.progress,\n+ opacity: this.opacity,\ntop: Math.max(this.props.contentVerticalOffset - 2, 4),\n};\nconst view = (\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Dismiss-from-pan for MultimediaModal |
129,187 | 09.04.2019 18:06:46 | 14,400 | 903e621743a69594906ad8231372b9c2158dbfc0 | [native] Fix MultimediaMessageMultimedia on Android
Android can't seem to measure a `View` nested inside an `Animated.View`, so I just flipped them around. | [
{
"change_type": "MODIFY",
"old_path": "native/chat/multimedia-message-multimedia.react.js",
"new_path": "native/chat/multimedia-message-multimedia.react.js",
"diff": "@@ -93,11 +93,11 @@ class MultimediaMessageMultimedia extends React.PureComponent<Props, State> {\n}\nreturn (\n<TouchableWithoutFeedback onPress={this.onPress}>\n- <Animated.View style={wrapperStyles}>\n<View style={[ styles.expand, style ]} ref={this.viewRef}>\n+ <Animated.View style={wrapperStyles}>\n<Multimedia media={media} />\n- </View>\n</Animated.View>\n+ </View>\n</TouchableWithoutFeedback>\n);\n}\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Fix MultimediaMessageMultimedia on Android
Android can't seem to measure a `View` nested inside an `Animated.View`, so I just flipped them around. |
129,187 | 09.04.2019 18:18:11 | 14,400 | 2dfd717aab7fa71143e74874e5b34ecf0fe0bfdc | [native] codeVersion -> 30 | [
{
"change_type": "MODIFY",
"old_path": "native/android/app/build.gradle",
"new_path": "native/android/app/build.gradle",
"diff": "@@ -110,8 +110,8 @@ android {\napplicationId \"org.squadcal\"\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 29\n- versionName \"0.0.29\"\n+ versionCode 30\n+ versionName \"0.0.30\"\n}\nsplits {\nabi {\n"
},
{
"change_type": "MODIFY",
"old_path": "native/ios/SquadCal/Info.plist",
"new_path": "native/ios/SquadCal/Info.plist",
"diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.29</string>\n+ <string>0.0.30</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>29</string>\n+ <string>30</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n"
},
{
"change_type": "MODIFY",
"old_path": "native/persist.js",
"new_path": "native/persist.js",
"diff": "@@ -142,7 +142,7 @@ const persistConfig = {\nmigrate: createMigrate(migrations, { debug: __DEV__ }),\n};\n-const codeVersion = 29;\n+const codeVersion = 30;\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 -> 30 |
129,187 | 09.04.2019 22:58:17 | 14,400 | c41f3de7c62128332c01a02847868067d8c66dff | [native] Avoid jump before dismiss-on-pan decay in MultimediaModal | [
{
"change_type": "MODIFY",
"old_path": "native/media/multimedia-modal.react.js",
"new_path": "native/media/multimedia-modal.react.js",
"diff": "@@ -650,7 +650,13 @@ class MultimediaModal extends React.PureComponent<Props> {\nstopClock(resetClock),\nset(curOpacity, progressiveOpacity),\nset(dismissingFromPan, shouldGoBack),\n- cond(shouldGoBack, call([ ], this.close)),\n+ cond(\n+ shouldGoBack,\n+ [\n+ decay,\n+ call([], this.close),\n+ ],\n+ ),\n],\n),\n);\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Avoid jump before dismiss-on-pan decay in MultimediaModal |
129,187 | 10.04.2019 10:53:25 | 14,400 | d1ada19290ca65eff254a1908ffdba03c9847cd4 | [native] Avoid jump towards the end of fling in MultimediaModal | [
{
"change_type": "MODIFY",
"old_path": "native/media/multimedia-modal.react.js",
"new_path": "native/media/multimedia-modal.react.js",
"diff": "@@ -757,20 +757,20 @@ class MultimediaModal extends React.PureComponent<Props> {\nstopClock(flingYClock),\n],\n[\n+ set(curX, recenteredX),\n+ set(curY, recenteredY),\ncond(\n- and(\n- not(clockRunning(resetXClock)),\n- eq(decayX, recenteredX),\n+ or(\n+ clockRunning(resetXClock),\n+ neq(decayX, recenteredX),\n),\n- set(curX, decayX),\nstopClock(flingXClock),\n),\ncond(\n- and(\n- not(clockRunning(resetYClock)),\n- eq(decayY, recenteredY),\n+ or(\n+ clockRunning(resetYClock),\n+ neq(decayY, recenteredY),\n),\n- set(curY, decayY),\nstopClock(flingYClock),\n),\n],\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Avoid jump towards the end of fling in MultimediaModal |
129,187 | 10.04.2019 15:30:37 | 14,400 | e4a91f5da833e399f218e86896274485d867802d | [native] Update react-navigation Flow libdefs from flow-typed | [
{
"change_type": "MODIFY",
"old_path": "native/flow-typed/npm/@react-navigation/core_v3.x.x.js",
"new_path": "native/flow-typed/npm/@react-navigation/core_v3.x.x.js",
"diff": "-// flow-typed signature: d7b7a4cc978b332c2a63943f63ac7400\n-// flow-typed version: c674c6bec3/@react-navigation/core_v3.x.x/flow_>=v0.60.x\n+// flow-typed signature: b4a693302accf9cdcb842c4702c92c5e\n+// flow-typed version: d11f702aef/@react-navigation/core_v3.x.x/flow_>=v0.60.x\n// @flow\n"
},
{
"change_type": "MODIFY",
"old_path": "native/flow-typed/npm/react-navigation_v3.x.x.js",
"new_path": "native/flow-typed/npm/react-navigation_v3.x.x.js",
"diff": "-// flow-typed signature: 6af080a4a9668eb026b80e5252033bda\n-// flow-typed version: c674c6bec3/react-navigation_v3.x.x/flow_>=v0.60.x\n+// flow-typed signature: b1d791c3159b0ab2ef1edd565d53f0d8\n+// flow-typed version: d11f702aef/react-navigation_v3.x.x/flow_>=v0.60.x\n// @flow\n@@ -1187,7 +1187,7 @@ declare module 'react-navigation' {\n};\ndeclare export var TabView: React$ComponentType<_TabViewProps>;\n- declare type _TabBarTopProps = {\n+ declare type _MaterialTopTabBarProps = {\nactiveTintColor: string,\ninactiveTintColor: string,\nshowIcon: boolean,\n@@ -1211,9 +1211,18 @@ declare module 'react-navigation' {\nlabelStyle?: TextStyleProp,\niconStyle?: ViewStyleProp,\n};\n- declare export var TabBarTop: React$ComponentType<_TabBarTopProps>;\n+ declare export var MaterialTopTabBar: React$ComponentType<\n+ _MaterialTopTabBarProps\n+ >;\n- declare type _TabBarBottomProps = {\n+ declare type _BottomTabBarButtonComponentProps = {\n+ onPress: () => void,\n+ onLongPress: () => void,\n+ testID: string,\n+ accessibilityLabel: string,\n+ style: ViewStyleProp,\n+ };\n+ declare type _BottomTabBarProps = {\nactiveTintColor: string,\nactiveBackgroundColor: string,\nadaptive?: boolean,\n@@ -1236,13 +1245,16 @@ declare module 'react-navigation' {\n}) => void,\ngetTestIDProps: (scene: TabScene) => (scene: TabScene) => any,\nrenderIcon: (scene: TabScene) => React$Node,\n+ getButtonComponent: (\n+ scene: TabScene\n+ ) => React$ComponentType<_BottomTabBarButtonComponentProps>,\nstyle?: ViewStyleProp,\nanimateStyle?: ViewStyleProp,\nlabelStyle?: TextStyleProp,\ntabStyle?: ViewStyleProp,\nshowIcon?: boolean,\n};\n- declare export var TabBarBottom: React$ComponentType<_TabBarBottomProps>;\n+ declare export var BottomTabBar: React$ComponentType<_BottomTabBarProps>;\ndeclare export function withNavigation<Props: {}, ComponentType: React$ComponentType<Props>>(\nComponent: ComponentType\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Update react-navigation Flow libdefs from flow-typed |
129,187 | 11.04.2019 02:47:28 | 14,400 | 699ed91945f6f1da41fa29a29c3bd61a20ccb782 | [native] Fix up types for | [
{
"change_type": "MODIFY",
"old_path": "native/app.react.js",
"new_path": "native/app.react.js",
"diff": "@@ -97,7 +97,6 @@ if (Platform.OS === \"android\") {\n}\nconst msInDay = 24 * 60 * 60 * 1000;\n-// $FlowFixMe should be fixed on flow-bin@0.89\nconst ReduxifiedRootNavigator = createReduxContainer(RootNavigator);\ntype NativeDispatch = Dispatch & ((action: NavigationAction) => boolean);\n"
},
{
"change_type": "MODIFY",
"old_path": "native/chat/compose-thread.react.js",
"new_path": "native/chat/compose-thread.react.js",
"diff": "@@ -260,10 +260,10 @@ class InnerComposeThread extends React.PureComponent<Props, State> {\nthreadInfo.parentThreadID === props.parentThreadInfo.id) &&\nuserIDs.every(userID => userIsMember(threadInfo, userID)),\n),\n- _sortBy([\n+ _sortBy(([\n'members.length',\n(threadInfo: ThreadInfo) => threadInfo.name ? 1 : 0,\n- ]),\n+ ]: $ReadOnlyArray<string | (threadInfo: ThreadInfo) => mixed>)),\n)(props.threadInfos);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "native/flow-typed/npm/@react-navigation/core_v3.x.x.js",
"new_path": "native/flow-typed/npm/@react-navigation/core_v3.x.x.js",
"diff": "@@ -334,11 +334,8 @@ declare module '@react-navigation/core' {\ndeclare export type NavigationScreenComponent<\nRoute: NavigationRoute,\nOptions: {},\n- Props: {}\n- > = React$ComponentType<{\n- ...Props,\n- ...NavigationNavigatorProps<Options, Route>,\n- }> &\n+ Props: NavigationNavigatorProps<Options, Route>,\n+ > = React$ComponentType<Props> &\nwithOptionalNavigationOptions<Options>;\ndeclare interface withRouter<State, Options> {\n@@ -348,11 +345,8 @@ declare module '@react-navigation/core' {\ndeclare export type NavigationNavigator<\nState: NavigationState,\nOptions: {},\n- Props: {}\n- > = React$StatelessFunctionalComponent<{\n- ...Props,\n- ...NavigationNavigatorProps<Options, State>,\n- }> &\n+ Props: NavigationNavigatorProps<Options, State>,\n+ > = React$ComponentType<Props> &\nwithRouter<State, Options> &\nwithOptionalNavigationOptions<Options>;\n@@ -494,8 +488,8 @@ declare module '@react-navigation/core' {\nfallback?: $ElementType<\n$PropertyType<\n{|\n- ...{| params: {| [ParamName]: void |} |},\n...$Exact<S>,\n+ ...{| params: {| [ParamName]: void |} |},\n|},\n'params'\n>,\n@@ -504,14 +498,14 @@ declare module '@react-navigation/core' {\n) => $ElementType<\n$PropertyType<\n{|\n- ...{| params: {| [ParamName]: void |} |},\n...$Exact<S>,\n+ ...{| params: {| [ParamName]: void |} |},\n|},\n'params'\n>,\nParamName\n>,\n- dangerouslyGetParent: () => NavigationScreenProp<*>,\n+ dangerouslyGetParent: () => ?NavigationScreenProp<NavigationState>,\nisFocused: () => boolean,\n// Shared action creators that exist for all routers\ngoBack: (routeKey?: ?string) => boolean,\n@@ -577,11 +571,8 @@ declare module '@react-navigation/core' {\ndeclare export type NavigationContainer<\nState: NavigationState,\nOptions: {},\n- Props: {}\n- > = React$ComponentType<{\n- ...Props,\n- ...NavigationContainerProps<State, Options>,\n- }> &\n+ Props: NavigationContainerProps<Options, State>,\n+ > = React$ComponentType<Props> &\nwithRouter<State, Options> &\nwithOptionalNavigationOptions<Options>;\n@@ -757,6 +748,7 @@ declare module '@react-navigation/core' {\ndeclare type NavigationView<O, S> = React$ComponentType<{\ndescriptors: { [key: string]: NavigationDescriptor },\nnavigation: NavigationScreenProp<S>,\n+ navigationConfig: *,\n}>;\ndeclare export function createNavigator<O: *, S: *, NavigatorConfig: *>(\n"
},
{
"change_type": "MODIFY",
"old_path": "native/flow-typed/npm/react-navigation_v3.x.x.js",
"new_path": "native/flow-typed/npm/react-navigation_v3.x.x.js",
"diff": "@@ -356,11 +356,8 @@ declare module 'react-navigation' {\ndeclare export type NavigationScreenComponent<\nRoute: NavigationRoute,\nOptions: {},\n- Props: {}\n- > = React$ComponentType<{\n- ...Props,\n- ...NavigationNavigatorProps<Options, Route>,\n- }> &\n+ Props: NavigationNavigatorProps<Options, Route>,\n+ > = React$ComponentType<Props> &\nwithOptionalNavigationOptions<Options>;\ndeclare interface withRouter<State, Options> {\n@@ -370,11 +367,8 @@ declare module 'react-navigation' {\ndeclare export type NavigationNavigator<\nState: NavigationState,\nOptions: {},\n- Props: {}\n- > = React$StatelessFunctionalComponent<{\n- ...Props,\n- ...NavigationNavigatorProps<Options, State>,\n- }> &\n+ Props: NavigationNavigatorProps<Options, State>,\n+ > = React$ComponentType<Props> &\nwithRouter<State, Options> &\nwithOptionalNavigationOptions<Options>;\n@@ -466,8 +460,14 @@ declare module 'react-navigation' {\nprevTransitionProps: ?NavigationTransitionProps,\nisModal: boolean\n) => TransitionConfig,\n- onTransitionStart?: () => void,\n- onTransitionEnd?: () => void,\n+ onTransitionStart?: (\n+ transitionProps: NavigationTransitionProps,\n+ prevTransitionProps: ?NavigationTransitionProps,\n+ ) => void,\n+ onTransitionEnd?: (\n+ transitionProps: NavigationTransitionProps,\n+ prevTransitionProps: ?NavigationTransitionProps,\n+ ) => void,\ntransparentCard?: boolean,\ndisableKeyboardHandling?: boolean,\n|};\n@@ -592,8 +592,8 @@ declare module 'react-navigation' {\nfallback?: $ElementType<\n$PropertyType<\n{|\n- ...{| params: {| [ParamName]: void |} |},\n...$Exact<S>,\n+ ...{| params: {| [ParamName]: void |} |},\n|},\n'params'\n>,\n@@ -602,14 +602,14 @@ declare module 'react-navigation' {\n) => $ElementType<\n$PropertyType<\n{|\n- ...{| params: {| [ParamName]: void |} |},\n...$Exact<S>,\n+ ...{| params: {| [ParamName]: void |} |},\n|},\n'params'\n>,\nParamName\n>,\n- dangerouslyGetParent: () => NavigationScreenProp<*>,\n+ dangerouslyGetParent: () => ?NavigationScreenProp<NavigationState>,\nisFocused: () => boolean,\n// Shared action creators that exist for all routers\ngoBack: (routeKey?: ?string) => boolean,\n@@ -675,11 +675,8 @@ declare module 'react-navigation' {\ndeclare export type NavigationContainer<\nState: NavigationState,\nOptions: {},\n- Props: {}\n- > = React$ComponentType<{\n- ...Props,\n- ...NavigationContainerProps<State, Options>,\n- }> &\n+ Props: NavigationContainerProps<Options, State>,\n+ > = React$ComponentType<Props> &\nwithRouter<State, Options> &\nwithOptionalNavigationOptions<Options>;\n@@ -939,6 +936,7 @@ declare module 'react-navigation' {\ndeclare type NavigationView<O, S> = React$ComponentType<{\ndescriptors: { [key: string]: NavigationDescriptor },\nnavigation: NavigationScreenProp<S>,\n+ navigationConfig: *,\n}>;\ndeclare export function createNavigator<O: *, S: *, NavigatorConfig: *>(\n"
},
{
"change_type": "MODIFY",
"old_path": "native/media/lightbox-navigator.react.js",
"new_path": "native/media/lightbox-navigator.react.js",
"diff": "@@ -54,18 +54,17 @@ function createLightboxNavigator(\nNavigationState,\nStackNavigatorConfig,\n>(\n- // $FlowFixMe maybe will be fixed on flow-bin@0.89\nLightbox,\nStackRouter(routeConfigMap, stackRouterConfig),\nstackConfig,\n);\n}\n-type Props = $ReadOnly<{|\n+type Props = $ReadOnly<{\nnavigation: NavigationScreenProp<NavigationState>,\ndescriptors: { [key: string]: NavigationDescriptor },\nnavigationConfig: StackNavigatorConfig,\n-|}>;\n+}>;\nclass Lightbox extends React.PureComponent<Props> {\nposition: Animated.Value;\n"
},
{
"change_type": "MODIFY",
"old_path": "native/package.json",
"new_path": "native/package.json",
"diff": "\"react-native-splash-screen\": \"^3.1.1\",\n\"react-native-vector-icons\": \"^4.5.0\",\n\"react-navigation\": \"3.5.1\",\n- \"react-navigation-redux-helpers\": \"^3.0.0\",\n+ \"react-navigation-redux-helpers\": \"^3.0.1\",\n\"react-navigation-stack\": \"1.1.1\",\n\"react-redux\": \"^5.0.6\",\n\"reactotron-react-native\": \"^2.0.0\",\n"
},
{
"change_type": "MODIFY",
"old_path": "yarn.lock",
"new_path": "yarn.lock",
"diff": "@@ -10665,10 +10665,10 @@ react-navigation-drawer@1.3.0:\ndependencies:\nreact-native-tab-view \"^1.2.0\"\n-react-navigation-redux-helpers@^3.0.0:\n- version \"3.0.0\"\n- resolved \"https://registry.yarnpkg.com/react-navigation-redux-helpers/-/react-navigation-redux-helpers-3.0.0.tgz#fdb7bc7d8ba6c84ac07f21783b98f5f9bd77a64d\"\n- integrity sha512-NSDxrBVNWpHNXw5fyhu25USJe3bL6J5PzEnAb/S2gSWgXBPrZbz/+JoljmNpLyeWVpa0nKnn01b/FhKlRjlJew==\n+react-navigation-redux-helpers@^3.0.1:\n+ version \"3.0.1\"\n+ resolved \"https://registry.yarnpkg.com/react-navigation-redux-helpers/-/react-navigation-redux-helpers-3.0.1.tgz#4e500c8bef30277c240bb602489dd652a6462675\"\n+ integrity sha512-WtrAJ/Wle1Tskv7/Z3IqBkXTw0d+ByDE5cFLCVDYeMJf5u0DU0qPy+rdJCAtyTYRTvmmQE/ExNoVa8SHHXPu2A==\ndependencies:\ninvariant \"^2.2.2\"\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Fix up types for flow-bin@0.92.0 |
129,187 | 11.04.2019 18:01:29 | 14,400 | 6d630d519f5c74d33023c90f6c462c7079c3599f | [native] Switch on inline requires | [
{
"change_type": "MODIFY",
"old_path": "native/metro.config.js",
"new_path": "native/metro.config.js",
"diff": "@@ -14,7 +14,7 @@ module.exports = {\ngetTransformOptions: async () => ({\ntransform: {\nexperimentalImportSupport: false,\n- inlineRequires: false,\n+ inlineRequires: true,\n},\n}),\n},\n"
},
{
"change_type": "MODIFY",
"old_path": "native/package.json",
"new_path": "native/package.json",
"diff": "\"react-native-splash-screen\": \"^3.1.1\",\n\"react-native-vector-icons\": \"^4.5.0\",\n\"react-navigation\": \"3.5.1\",\n- \"react-navigation-redux-helpers\": \"^3.0.1\",\n+ \"react-navigation-redux-helpers\": \"^3.0.2\",\n\"react-navigation-stack\": \"1.1.1\",\n\"react-redux\": \"^5.0.6\",\n\"reactotron-react-native\": \"^2.0.0\",\n"
},
{
"change_type": "MODIFY",
"old_path": "yarn.lock",
"new_path": "yarn.lock",
"diff": "@@ -10665,10 +10665,10 @@ react-navigation-drawer@1.3.0:\ndependencies:\nreact-native-tab-view \"^1.2.0\"\n-react-navigation-redux-helpers@^3.0.1:\n- version \"3.0.1\"\n- resolved \"https://registry.yarnpkg.com/react-navigation-redux-helpers/-/react-navigation-redux-helpers-3.0.1.tgz#4e500c8bef30277c240bb602489dd652a6462675\"\n- integrity sha512-WtrAJ/Wle1Tskv7/Z3IqBkXTw0d+ByDE5cFLCVDYeMJf5u0DU0qPy+rdJCAtyTYRTvmmQE/ExNoVa8SHHXPu2A==\n+react-navigation-redux-helpers@^3.0.2:\n+ version \"3.0.2\"\n+ resolved \"https://registry.yarnpkg.com/react-navigation-redux-helpers/-/react-navigation-redux-helpers-3.0.2.tgz#612e1d5b1378ba0c17b6a2d8ec9a01cc698a3a16\"\n+ integrity sha512-+z7/eBGBpws/W3ffu7ayEl1YFMAbXO3Sgul3KIDyESI1BbmfSvKD2aRMEfE7AlO+58fJJsqWUMhNw+VACAdHjw==\ndependencies:\ninvariant \"^2.2.2\"\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Switch on inline requires |
129,187 | 12.04.2019 02:25:21 | 14,400 | 19414da73245f92a5b824001a8104c5f50375934 | [native] Use new XCode build system | [
{
"change_type": "MODIFY",
"old_path": "native/ios/SquadCal.xcodeproj/project.pbxproj",
"new_path": "native/ios/SquadCal.xcodeproj/project.pbxproj",
"diff": "};\nobjectVersion = 46;\nobjects = {\n+\n/* Begin PBXBuildFile section */\n00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };\n00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; };\n00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; };\n00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; };\n00E356F31AD99517003FC87E /* SquadCalTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* SquadCalTests.m */; };\n+ 01247688B5604BFC9C2C301D /* libRNCNetInfo-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C779697B77F4094B9B235BE /* libRNCNetInfo-tvOS.a */; };\n+ 02BD5DEEF10D43DAB506184E /* libRNCNetInfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 73C775AD68DB4BA0BADC22BF /* libRNCNetInfo.a */; };\n09369EAAB869410E9C0208B4 /* Feather.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A06F10E4481746D2B76CA60E /* Feather.ttf */; };\n133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; };\n139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; };\n2D16E6881FA4F8E400B85C8A /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D16E6891FA4F8E400B85C8A /* libReact.a */; };\n2DCD954D1E0B4F2C00145EB5 /* SquadCalTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* SquadCalTests.m */; };\n2E5ADC2BAEA24F1AAD81E147 /* Zocial.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EBD8879422144B0188A8336F /* Zocial.ttf */; };\n+ 5124B6D20E534DE8B5FEA0D3 /* libRNCAsyncStorage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 02810FBD603C4C36A94AF79B /* libRNCAsyncStorage.a */; };\n569C48070423498795574595 /* EvilIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3430816A291640AEACA13234 /* EvilIcons.ttf */; };\n5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; };\n62E897586C0F47F7AFADFE11 /* libRNExitApp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 95EA49951E064ECB9B1999EA /* libRNExitApp.a */; };\nBBC287C467984DA6BF85800E /* libSplashScreen.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B6A1FF570694BFCB0D65D0E /* libSplashScreen.a */; };\nEFBA858A8D2B4909A08D9FE6 /* libRNGestureHandler.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E0952482A8094CE88F96C0EB /* libRNGestureHandler.a */; };\nFA7F2215AD7646E2BE985BF3 /* SimpleLineIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = AE31AFFF88FB4112A29ADE33 /* SimpleLineIcons.ttf */; };\n- 5124B6D20E534DE8B5FEA0D3 /* libRNCAsyncStorage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 02810FBD603C4C36A94AF79B /* libRNCAsyncStorage.a */; };\n- 02BD5DEEF10D43DAB506184E /* libRNCNetInfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 73C775AD68DB4BA0BADC22BF /* libRNCNetInfo.a */; };\n- 01247688B5604BFC9C2C301D /* libRNCNetInfo-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C779697B77F4094B9B235BE /* libRNCNetInfo-tvOS.a */; };\n/* End PBXBuildFile section */\n/* Begin PBXContainerItemProxy section */\nremoteGlobalIDString = 3D383D621EBD27B9005632C8;\nremoteInfo = \"double-conversion-tvOS\";\n};\n+ 7F4C7902226064F6009F6ABE /* PBXContainerItemProxy */ = {\n+ isa = PBXContainerItemProxy;\n+ containerPortal = 76FF92CF9B394C48A96E8DF8 /* RNCAsyncStorage.xcodeproj */;\n+ proxyType = 2;\n+ remoteGlobalIDString = 134814201AA4EA6300B7C361;\n+ remoteInfo = RNCAsyncStorage;\n+ };\n+ 7F4C7906226064F6009F6ABE /* PBXContainerItemProxy */ = {\n+ isa = PBXContainerItemProxy;\n+ containerPortal = 118DE3D4318D437D8F568F03 /* RNCNetInfo.xcodeproj */;\n+ proxyType = 2;\n+ remoteGlobalIDString = 134814201AA4EA6300B7C361;\n+ remoteInfo = RNCNetInfo;\n+ };\n+ 7F4C7908226064F6009F6ABE /* PBXContainerItemProxy */ = {\n+ isa = PBXContainerItemProxy;\n+ containerPortal = 118DE3D4318D437D8F568F03 /* RNCNetInfo.xcodeproj */;\n+ proxyType = 2;\n+ remoteGlobalIDString = B5027B1B2237B30F00F1AABA;\n+ remoteInfo = \"RNCNetInfo-tvOS\";\n+ };\n7F5B10E82005349D00FE096A /* PBXContainerItemProxy */ = {\nisa = PBXContainerItemProxy;\ncontainerPortal = 143FA99006A442AFB7B24B3A /* RNNotifications.xcodeproj */;\n00E356EE1AD99517003FC87E /* SquadCalTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SquadCalTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };\n00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n00E356F21AD99517003FC87E /* SquadCalTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SquadCalTests.m; sourceTree = \"<group>\"; };\n+ 02810FBD603C4C36A94AF79B /* libRNCAsyncStorage.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNCAsyncStorage.a; sourceTree = \"<group>\"; };\n067F7283F74C4423A00B9690 /* libRNReanimated.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNReanimated.a; sourceTree = \"<group>\"; };\n+ 118DE3D4318D437D8F568F03 /* RNCNetInfo.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = \"wrapper.pb-project\"; name = RNCNetInfo.xcodeproj; path = \"../node_modules/@react-native-community/netinfo/ios/RNCNetInfo.xcodeproj\"; sourceTree = \"<group>\"; };\n139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTSettings.xcodeproj; path = \"../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj\"; sourceTree = \"<group>\"; };\n139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTWebSocket.xcodeproj; path = \"../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj\"; sourceTree = \"<group>\"; };\n13B07F961A680F5B00A75B9A /* SquadCal.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SquadCal.app; sourceTree = BUILT_PRODUCTS_DIR; };\n4AB1FC0EFD3A4ED1A082E32F /* FontAwesome.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf\"; sourceTree = \"<group>\"; };\n4ACC468F28D944F293B91ACC /* Ionicons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Ionicons.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/Ionicons.ttf\"; sourceTree = \"<group>\"; };\n5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTAnimation.xcodeproj; path = \"../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj\"; sourceTree = \"<group>\"; };\n+ 6C779697B77F4094B9B235BE /* libRNCNetInfo-tvOS.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = \"libRNCNetInfo-tvOS.a\"; sourceTree = \"<group>\"; };\n+ 73C775AD68DB4BA0BADC22BF /* libRNCNetInfo.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNCNetInfo.a; sourceTree = \"<group>\"; };\n+ 76FF92CF9B394C48A96E8DF8 /* RNCAsyncStorage.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = \"wrapper.pb-project\"; name = RNCAsyncStorage.xcodeproj; path = \"../node_modules/@react-native-community/async-storage/ios/RNCAsyncStorage.xcodeproj\"; sourceTree = \"<group>\"; };\n78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTLinking.xcodeproj; path = \"../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj\"; sourceTree = \"<group>\"; };\n7AAA81E566EC47C883CDFA61 /* libRNScreens.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNScreens.a; sourceTree = \"<group>\"; };\n7F761E292201141E001B6FB7 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };\nEBD8879422144B0188A8336F /* Zocial.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Zocial.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/Zocial.ttf\"; sourceTree = \"<group>\"; };\nED28C047C454400D87062E8C /* RNGestureHandler.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = \"wrapper.pb-project\"; name = RNGestureHandler.xcodeproj; path = \"../node_modules/react-native-gesture-handler/ios/RNGestureHandler.xcodeproj\"; sourceTree = \"<group>\"; };\nF1A54F24F713488E94B93044 /* RNReanimated.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = \"wrapper.pb-project\"; name = RNReanimated.xcodeproj; path = \"../node_modules/react-native-reanimated/ios/RNReanimated.xcodeproj\"; sourceTree = \"<group>\"; };\n- 76FF92CF9B394C48A96E8DF8 /* RNCAsyncStorage.xcodeproj */ = {isa = PBXFileReference; name = \"RNCAsyncStorage.xcodeproj\"; path = \"../node_modules/@react-native-community/async-storage/ios/RNCAsyncStorage.xcodeproj\"; sourceTree = \"<group>\"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };\n- 02810FBD603C4C36A94AF79B /* libRNCAsyncStorage.a */ = {isa = PBXFileReference; name = \"libRNCAsyncStorage.a\"; path = \"libRNCAsyncStorage.a\"; sourceTree = \"<group>\"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };\n- 118DE3D4318D437D8F568F03 /* RNCNetInfo.xcodeproj */ = {isa = PBXFileReference; name = \"RNCNetInfo.xcodeproj\"; path = \"../node_modules/@react-native-community/netinfo/ios/RNCNetInfo.xcodeproj\"; sourceTree = \"<group>\"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };\n- 73C775AD68DB4BA0BADC22BF /* libRNCNetInfo.a */ = {isa = PBXFileReference; name = \"libRNCNetInfo.a\"; path = \"libRNCNetInfo.a\"; sourceTree = \"<group>\"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };\n- 6C779697B77F4094B9B235BE /* libRNCNetInfo-tvOS.a */ = {isa = PBXFileReference; name = \"libRNCNetInfo-tvOS.a\"; path = \"libRNCNetInfo-tvOS.a\"; sourceTree = \"<group>\"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };\n/* End PBXFileReference section */\n/* Begin PBXFrameworksBuildPhase section */\nname = Products;\nsourceTree = \"<group>\";\n};\n+ 7F4C78FD226064F6009F6ABE /* Products */ = {\n+ isa = PBXGroup;\n+ children = (\n+ 7F4C7907226064F6009F6ABE /* libRNCNetInfo.a */,\n+ 7F4C7909226064F6009F6ABE /* libRNCNetInfo-tvOS.a */,\n+ );\n+ name = Products;\n+ sourceTree = \"<group>\";\n+ };\n+ 7F4C78FF226064F6009F6ABE /* Products */ = {\n+ isa = PBXGroup;\n+ children = (\n+ 7F4C7903226064F6009F6ABE /* libRNCAsyncStorage.a */,\n+ );\n+ name = Products;\n+ sourceTree = \"<group>\";\n+ };\n7F5B10C02005349C00FE096A /* Recovered References */ = {\nisa = PBXGroup;\nchildren = (\n47C86914FEF44D79AD04F880 /* libFastImage.a */,\n99A8CC0EA47F466EAD201409 /* libRCTOrientation.a */,\n067F7283F74C4423A00B9690 /* libRNReanimated.a */,\n+ 02810FBD603C4C36A94AF79B /* libRNCAsyncStorage.a */,\n+ 73C775AD68DB4BA0BADC22BF /* libRNCNetInfo.a */,\n+ 6C779697B77F4094B9B235BE /* libRNCNetInfo-tvOS.a */,\n);\nname = \"Recovered References\";\nsourceTree = \"<group>\";\nProductGroup = 146834001AC3E56700842450 /* Products */;\nProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n},\n+ {\n+ ProductGroup = 7F4C78FF226064F6009F6ABE /* Products */;\n+ ProjectRef = 76FF92CF9B394C48A96E8DF8 /* RNCAsyncStorage.xcodeproj */;\n+ },\n+ {\n+ ProductGroup = 7F4C78FD226064F6009F6ABE /* Products */;\n+ ProjectRef = 118DE3D4318D437D8F568F03 /* RNCNetInfo.xcodeproj */;\n+ },\n{\nProductGroup = 7F3DD40720521A4C00A0D652 /* Products */;\nProjectRef = 220AE3F9742647538AAD1DD7 /* RNExitApp.xcodeproj */;\nremoteRef = 7F474C831F833FCA00B71135 /* PBXContainerItemProxy */;\nsourceTree = BUILT_PRODUCTS_DIR;\n};\n+ 7F4C7903226064F6009F6ABE /* libRNCAsyncStorage.a */ = {\n+ isa = PBXReferenceProxy;\n+ fileType = archive.ar;\n+ path = libRNCAsyncStorage.a;\n+ remoteRef = 7F4C7902226064F6009F6ABE /* PBXContainerItemProxy */;\n+ sourceTree = BUILT_PRODUCTS_DIR;\n+ };\n+ 7F4C7907226064F6009F6ABE /* libRNCNetInfo.a */ = {\n+ isa = PBXReferenceProxy;\n+ fileType = archive.ar;\n+ path = libRNCNetInfo.a;\n+ remoteRef = 7F4C7906226064F6009F6ABE /* PBXContainerItemProxy */;\n+ sourceTree = BUILT_PRODUCTS_DIR;\n+ };\n+ 7F4C7909226064F6009F6ABE /* libRNCNetInfo-tvOS.a */ = {\n+ isa = PBXReferenceProxy;\n+ fileType = archive.ar;\n+ path = \"libRNCNetInfo-tvOS.a\";\n+ remoteRef = 7F4C7908226064F6009F6ABE /* PBXContainerItemProxy */;\n+ sourceTree = BUILT_PRODUCTS_DIR;\n+ };\n7F5B10E92005349D00FE096A /* libRNNotifications.a */ = {\nisa = PBXReferenceProxy;\nfileType = archive.ar;\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Use new XCode build system |
129,187 | 12.04.2019 23:38:02 | 14,400 | 47d0c1f152e5abebf83fae4c06be2e794ec27bf5 | [server] Increase email verification expiration to 30 days | [
{
"change_type": "MODIFY",
"old_path": "server/src/models/verification.js",
"new_path": "server/src/models/verification.js",
"diff": "@@ -14,11 +14,15 @@ import bcrypt from 'twin-bcrypt';\nimport { ServerError } from 'lib/utils/errors';\n-import { dbQuery, SQL } from '../database';\n+import { dbQuery, SQL, mergeOrConditions } from '../database';\nimport createIDs from '../creators/id-creator';\nimport { createUpdates } from '../creators/update-creator';\n-const verifyCodeLifetime = 24 * 60 * 60 * 1000; // in ms\n+const day = 24 * 60 * 60 * 1000; // in ms\n+const verifyCodeLifetimes = {\n+ [verifyField.EMAIL]: day * 30,\n+ [verifyField.RESET_PASSWORD]: day,\n+};\nasync function createVerificationCode(\nuserID: string,\n@@ -59,7 +63,12 @@ async function verifyCode(hex: string): Promise<CodeVerification> {\nthrow new ServerError('invalid_code');\n}\n- if (row.creation_time + verifyCodeLifetime <= Date.now()) {\n+ const field = assertVerifyField(row.field);\n+ const verifyCodeLifetime = verifyCodeLifetimes[field];\n+ if (\n+ verifyCodeLifetime &&\n+ row.creation_time + verifyCodeLifetime <= Date.now()\n+ ) {\n// Code is expired. Delete it...\nconst deleteQuery = SQL`\nDELETE v, i\n@@ -73,7 +82,7 @@ async function verifyCode(hex: string): Promise<CodeVerification> {\nreturn {\nuserID: row.user.toString(),\n- field: assertVerifyField(row.field),\n+ field,\n};\n}\n@@ -121,13 +130,22 @@ async function handleCodeVerificationRequest(\n}\nasync function deleteExpiredVerifications(): Promise<void> {\n- const earliestInvalidCreationTime = Date.now() - verifyCodeLifetime;\n+ const creationTimeConditions = [];\n+ for (let field in verifyCodeLifetimes) {\n+ const lifetime = verifyCodeLifetimes[field];\n+ const earliestInvalid = Date.now() - lifetime;\n+ creationTimeConditions.push(\n+ SQL`v.field = ${field} AND v.creation_time <= ${earliestInvalid}`,\n+ );\n+ }\n+ const creationTimeClause = mergeOrConditions(creationTimeConditions);\nconst query = SQL`\nDELETE v, i\nFROM verifications v\nLEFT JOIN ids i ON i.id = v.id\n- WHERE v.creation_time <= ${earliestInvalidCreationTime}\n+ WHERE\n`;\n+ query.append(creationTimeClause);\nawait dbQuery(query);\n}\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [server] Increase email verification expiration to 30 days |
129,187 | 13.04.2019 00:02:52 | 14,400 | 50a15544ca2f5eb80dee07719c7097984caca048 | [server] Don't show "database error" if sqlMessage is undefined | [
{
"change_type": "MODIFY",
"old_path": "server/src/responders/handlers.js",
"new_path": "server/src/responders/handlers.js",
"diff": "@@ -56,7 +56,9 @@ function downloadHandler(responder: DownloadResponder) {\n}\nfunction getMessageForException(error: Error & { sqlMessage?: string }) {\n- return error.sqlMessage !== null ? \"database error\" : error.message;\n+ return error.sqlMessage !== null && error.sqlMessage !== undefined\n+ ? \"database error\"\n+ : error.message;\n}\nasync function handleException(\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [server] Don't show "database error" if sqlMessage is undefined |
129,187 | 13.04.2019 00:38:31 | 14,400 | fe5464636696d54e8c57b629a496c86c3018b29b | Pass down new ServerVerificationResult object on website load | [
{
"change_type": "MODIFY",
"old_path": "lib/types/verify-types.js",
"new_path": "lib/types/verify-types.js",
"diff": "// @flow\nimport invariant from 'invariant';\n+import PropTypes from 'prop-types';\nexport const verifyField = Object.freeze({\nEMAIL: 0,\n@@ -21,11 +22,41 @@ export type CodeVerificationRequest = {|\ncode: string,\n|};\n-export type VerificationResult =\n- | {| field: 0, userID: string |}\n- | {| field: 1, userID: string, resetPasswordUsername: string |};\n-\nexport type HandleVerificationCodeResult = {|\nverifyField: VerifyField,\nresetPasswordUsername?: string,\n|};\n+\n+type FailedVerificationResult = {|\n+ success: false,\n+|};\n+type EmailServerVerificationResult = {|\n+ success: true,\n+ field: 0,\n+|};\n+type ResetPasswordServerVerificationResult = {|\n+ success: true,\n+ field: 1,\n+ username: string,\n+|};\n+export type ServerSuccessfulVerificationResult =\n+ | EmailServerVerificationResult\n+ | ResetPasswordServerVerificationResult;\n+export type ServerVerificationResult =\n+ | FailedVerificationResult\n+ | ServerSuccessfulVerificationResult;\n+\n+export const serverVerificationResultPropType = PropTypes.oneOfType([\n+ PropTypes.shape({\n+ success: PropTypes.oneOf([ false ]).isRequired,\n+ }),\n+ PropTypes.shape({\n+ success: PropTypes.oneOf([ true ]).isRequired,\n+ field: PropTypes.oneOf([ verifyField.EMAIL ]).isRequired,\n+ }),\n+ PropTypes.shape({\n+ success: PropTypes.oneOf([ true ]).isRequired,\n+ field: PropTypes.oneOf([ verifyField.RESET_PASSWORD ]).isRequired,\n+ username: PropTypes.string.isRequired,\n+ }),\n+]);\n"
},
{
"change_type": "MODIFY",
"old_path": "server/src/models/verification.js",
"new_path": "server/src/models/verification.js",
"diff": "@@ -4,7 +4,7 @@ import {\ntype VerifyField,\nverifyField,\nassertVerifyField,\n- type VerificationResult,\n+ type ServerSuccessfulVerificationResult,\n} from 'lib/types/verify-types';\nimport { updateTypes } from 'lib/types/update-types';\nimport type { Viewer } from '../session/viewer';\n@@ -100,7 +100,7 @@ async function clearVerifyCodes(result: CodeVerification) {\nasync function handleCodeVerificationRequest(\nviewer: Viewer,\ncode: string,\n-): Promise<?VerificationResult> {\n+): Promise<ServerSuccessfulVerificationResult> {\nconst result = await verifyCode(code);\nconst { userID, field } = result;\nif (field === verifyField.EMAIL) {\n@@ -112,7 +112,7 @@ async function handleCodeVerificationRequest(\ntime: Date.now(),\n}];\nawait createUpdates(updateDatas, { viewer });\n- return { field: verifyField.EMAIL, userID };\n+ return { success: true, field: verifyField.EMAIL };\n} else if (field === verifyField.RESET_PASSWORD) {\nconst usernameQuery = SQL`SELECT username FROM users WHERE id = ${userID}`;\nconst [ usernameResult ] = await dbQuery(usernameQuery);\n@@ -121,12 +121,12 @@ async function handleCodeVerificationRequest(\n}\nconst usernameRow = usernameResult[0];\nreturn {\n+ success: true,\nfield: verifyField.RESET_PASSWORD,\n- userID,\n- resetPasswordUsername: usernameRow.username,\n+ username: usernameRow.username,\n};\n}\n- return null;\n+ throw new ServerError('invalid_code');\n}\nasync function deleteExpiredVerifications(): Promise<void> {\n"
},
{
"change_type": "MODIFY",
"old_path": "server/src/responders/verification-responders.js",
"new_path": "server/src/responders/verification-responders.js",
"diff": "@@ -27,18 +27,15 @@ async function codeVerificationResponder(\nawait validateInput(viewer, codeVerificationRequestInputValidator, request);\nconst result = await handleCodeVerificationRequest(viewer, request.code);\n- if (!result) {\n- throw new ServerError('unhandled_field');\n- }\nif (result.field === verifyField.EMAIL) {\nreturn { verifyField: result.field };\n} else if (result.field === verifyField.RESET_PASSWORD) {\nreturn {\nverifyField: result.field,\n- resetPasswordUsername: result.resetPasswordUsername,\n+ resetPasswordUsername: result.username,\n};\n}\n- throw new ServerError('unhandled_field');\n+ throw new ServerError('invalid_code');\n}\nexport {\n"
},
{
"change_type": "MODIFY",
"old_path": "server/src/responders/website-responders.js",
"new_path": "server/src/responders/website-responders.js",
"diff": "@@ -5,6 +5,7 @@ import type { AppState, Action } from 'web/redux-setup';\nimport { defaultCalendarFilters } from 'lib/types/filter-types';\nimport { threadPermissions } from 'lib/types/thread-types';\nimport { defaultConnectionInfo } from 'lib/types/socket-types';\n+import type { ServerVerificationResult } from 'lib/types/verify-types';\nimport html from 'common-tags/lib/html';\nimport { createStore, type Store } from 'redux';\n@@ -82,9 +83,7 @@ async function websiteResponder(viewer: Viewer, url: string): Promise<string> {\nthreadSelectionCriteria,\ndefaultNumberPerThread,\n),\n- navInfo.verify\n- ? handleCodeVerificationRequest(viewer, navInfo.verify)\n- : null,\n+ handleVerificationRequest(viewer, navInfo.verify),\nviewer.loggedIn ? setNewSession(viewer, calendarQuery, initialTime) : null,\n]);\n@@ -123,11 +122,7 @@ async function websiteResponder(viewer: Viewer, url: string): Promise<string> {\nnavInfo,\ncurrentUserInfo,\nsessionID: viewer.sessionID,\n- verifyField: verificationResult && verificationResult.field,\n- resetPasswordUsername:\n- verificationResult && verificationResult.resetPasswordUsername\n- ? verificationResult.resetPasswordUsername\n- : \"\",\n+ serverVerificationResult: verificationResult,\nentryStore: {\nentryInfos: _keyBy('id')(rawEntryInfos),\ndaysToEntries: daysToEntriesFromEntryInfos(rawEntryInfos),\n@@ -244,6 +239,23 @@ async function websiteResponder(viewer: Viewer, url: string): Promise<string> {\nreturn result;\n}\n+async function handleVerificationRequest(\n+ viewer: Viewer,\n+ code: ?string,\n+): Promise<?ServerVerificationResult> {\n+ if (!code) {\n+ return null;\n+ }\n+ try {\n+ return await handleCodeVerificationRequest(viewer, code);\n+ } catch (e) {\n+ if (e instanceof ServerError && e.message === 'invalid_code') {\n+ return { success: false };\n+ }\n+ throw e;\n+ }\n+}\n+\nexport {\nwebsiteResponder,\n};\n"
},
{
"change_type": "MODIFY",
"old_path": "web/app.react.js",
"new_path": "web/app.react.js",
"diff": "import type { LoadingStatus } from 'lib/types/loading-types';\nimport { type AppState, type NavInfo, navInfoPropType } from './redux-setup';\nimport type { DispatchActionPayload } from 'lib/utils/action-utils';\n-import { type VerifyField, verifyField } from 'lib/types/verify-types';\n+import {\n+ verifyField,\n+ type ServerVerificationResult,\n+ serverVerificationResultPropType,\n+} from 'lib/types/verify-types';\nimport * as React from 'react';\nimport invariant from 'invariant';\n@@ -74,7 +78,7 @@ type Props = {\n},\n// Redux state\nnavInfo: NavInfo,\n- verifyField: ?VerifyField,\n+ serverVerificationResult: ?ServerVerificationResult,\nentriesLoadingStatus: LoadingStatus,\nloggedIn: bool,\nmostRecentReadThread: ?string,\n@@ -94,7 +98,7 @@ class App extends React.PureComponent<Props, State> {\npathname: PropTypes.string.isRequired,\n}).isRequired,\nnavInfo: navInfoPropType.isRequired,\n- verifyField: PropTypes.number,\n+ serverVerificationResult: serverVerificationResultPropType,\nentriesLoadingStatus: PropTypes.string.isRequired,\nloggedIn: PropTypes.bool.isRequired,\nmostRecentReadThread: PropTypes.string,\n@@ -108,15 +112,13 @@ class App extends React.PureComponent<Props, State> {\n};\ncomponentDidMount() {\n- if (this.props.navInfo.verify) {\n- if (this.props.verifyField === verifyField.RESET_PASSWORD) {\n+ const { navInfo, serverVerificationResult } = this.props;\n+ if (navInfo.verify && serverVerificationResult) {\n+ if (serverVerificationResult.field === verifyField.RESET_PASSWORD) {\nthis.showResetPasswordModal();\n- } else if (this.props.verifyField === verifyField.EMAIL) {\n+ } else if (serverVerificationResult.field === verifyField.EMAIL) {\nconst newURL = canonicalURLFromReduxState(\n- {\n- ...this.props.navInfo,\n- verify: null,\n- },\n+ { ...navInfo, verify: null },\nthis.props.location.pathname,\n);\nhistory.replace(newURL);\n@@ -128,7 +130,7 @@ class App extends React.PureComponent<Props, State> {\nif (this.props.loggedIn) {\nconst newURL = canonicalURLFromReduxState(\n- this.props.navInfo,\n+ navInfo,\nthis.props.location.pathname,\n);\nif (this.props.location.pathname !== newURL) {\n@@ -150,14 +152,19 @@ class App extends React.PureComponent<Props, State> {\n}\ncomponentDidUpdate(prevProps: Props) {\n- if (this.props.verifyField === verifyField.RESET_PASSWORD) {\n+ const { navInfo, serverVerificationResult } = this.props;\n+ if (\n+ !serverVerificationResult ||\n+ serverVerificationResult.field !== verifyField.RESET_PASSWORD\n+ ) {\n+ return;\n+ }\nif (prevProps.navInfo.verify && !this.props.navInfo.verify) {\nthis.clearModal();\n} else if (!prevProps.navInfo.verify && this.props.navInfo.verify) {\nthis.showResetPasswordModal();\n}\n}\n- }\nshowResetPasswordModal() {\nconst newURL = canonicalURLFromReduxState(\n@@ -356,7 +363,7 @@ export default connect(\nconst activeChatThreadID = state.navInfo.activeChatThreadID;\nreturn {\nnavInfo: state.navInfo,\n- verifyField: state.verifyField,\n+ serverVerificationResult: state.serverVerificationResult,\nentriesLoadingStatus: combineLoadingStatuses(\nfetchEntriesLoadingStatusSelector(state),\nupdateCalendarQueryLoadingStatusSelector(state),\n"
},
{
"change_type": "MODIFY",
"old_path": "web/modals/account/reset-password-modal.react.js",
"new_path": "web/modals/account/reset-password-modal.react.js",
"diff": "@@ -8,6 +8,7 @@ import type {\nLogInResult,\nLogInStartingPayload,\n} from 'lib/types/account-types';\n+import { verifyField } from 'lib/types/verify-types';\nimport * as React from 'react';\nimport invariant from 'invariant';\n@@ -215,7 +216,10 @@ const loadingStatusSelector\nexport default connect(\n(state: AppState) => ({\n- resetPasswordUsername: state.resetPasswordUsername,\n+ resetPasswordUsername: state.serverVerificationResult &&\n+ state.serverVerificationResult.success &&\n+ state.serverVerificationResult.field === verifyField.RESET_PASSWORD &&\n+ state.serverVerificationResult.username,\nverifyCode: state.navInfo.verify,\ninputDisabled: loadingStatusSelector(state) === \"loading\",\nlogInExtraInfo: webLogInExtraInfoSelector(state),\n"
},
{
"change_type": "MODIFY",
"old_path": "web/redux-setup.js",
"new_path": "web/redux-setup.js",
"diff": "@@ -6,7 +6,7 @@ import type { EntryStore } from 'lib/types/entry-types';\nimport type { BaseAction } from 'lib/types/redux-types';\nimport type { LoadingStatus } from 'lib/types/loading-types';\nimport type { CurrentUserInfo, UserInfo } from 'lib/types/user-types';\n-import type { VerifyField } from 'lib/types/verify-types';\n+import type { ServerVerificationResult } from 'lib/types/verify-types';\nimport type { MessageStore } from 'lib/types/message-types';\nimport type { CalendarFilter } from 'lib/types/filter-types';\nimport { setNewSessionActionType } from 'lib/utils/action-utils';\n@@ -45,8 +45,7 @@ export type AppState = {|\nnavInfo: NavInfo,\ncurrentUserInfo: ?CurrentUserInfo,\nsessionID: ?string,\n- verifyField: ?VerifyField,\n- resetPasswordUsername: string,\n+ serverVerificationResult: ?ServerVerificationResult,\nentryStore: EntryStore,\nthreadStore: ThreadStore,\nuserInfos: {[id: string]: UserInfo},\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | Pass down new ServerVerificationResult object on website load |
129,187 | 13.04.2019 00:48:43 | 14,400 | 4021b9c6cf607cfeb1167bec6a027d9fdf39c5df | [web] Show expiration error when verification code is invalid | [
{
"change_type": "MODIFY",
"old_path": "web/app.react.js",
"new_path": "web/app.react.js",
"diff": "@@ -46,8 +46,7 @@ import css from './style.css';\nimport AccountBar from './account-bar.react';\nimport Calendar from './calendar/calendar.react';\nimport ResetPasswordModal from './modals/account/reset-password-modal.react';\n-import VerificationSuccessModal\n- from './modals/account/verification-success-modal.react';\n+import VerificationModal from './modals/account/verification-modal.react';\nimport LoadingIndicator from './loading-indicator.react';\nimport history from './router-history';\nimport { updateNavInfoActionType } from './redux-setup';\n@@ -116,14 +115,14 @@ class App extends React.PureComponent<Props, State> {\nif (navInfo.verify && serverVerificationResult) {\nif (serverVerificationResult.field === verifyField.RESET_PASSWORD) {\nthis.showResetPasswordModal();\n- } else if (serverVerificationResult.field === verifyField.EMAIL) {\n+ } else {\nconst newURL = canonicalURLFromReduxState(\n{ ...navInfo, verify: null },\nthis.props.location.pathname,\n);\nhistory.replace(newURL);\nthis.setModal(\n- <VerificationSuccessModal onClose={this.clearModal} />\n+ <VerificationModal onClose={this.clearModal} />\n);\n}\n}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "web/modals/account/verification-modal.react.js",
"diff": "+// @flow\n+\n+import type { AppState } from '../../redux-setup';\n+import { type ServerVerificationResult, verifyField } from 'lib/types/verify-types';\n+\n+import * as React from 'react';\n+import invariant from 'invariant';\n+\n+import { connect } from 'lib/utils/redux-utils';\n+\n+import css from '../../style.css';\n+import Modal from '../modal.react';\n+\n+type Props = {\n+ onClose: () => void,\n+ // Redux state\n+ serverVerificationResult: ?ServerVerificationResult,\n+};\n+function VerificationModal(props: Props) {\n+ const { onClose, serverVerificationResult } = props;\n+ invariant(\n+ serverVerificationResult,\n+ \"VerificationModal needs a serverVerificationResult\",\n+ );\n+\n+ const { success } = serverVerificationResult;\n+ let message, title;\n+ if (!success) {\n+ title = \"Invalid code\";\n+ message = \"Sorry, but that code has expired or is invalid.\";\n+ } else if (success && serverVerificationResult.field === verifyField.EMAIL) {\n+ title = \"Verified email\";\n+ message = \"Thanks for verifying your email address!\";\n+ }\n+ invariant(\n+ title && message,\n+ \"VerificationModal can't handle serverVerificationResult \"\n+ + JSON.stringify(serverVerificationResult)\n+ );\n+\n+ return (\n+ <Modal name={title} onClose={onClose}>\n+ <div className={css['modal-body']}>\n+ <p>{message}</p>\n+ </div>\n+ </Modal>\n+ );\n+}\n+\n+export default connect(\n+ (state: AppState) => ({\n+ serverVerificationResult: state.serverVerificationResult,\n+ }),\n+)(VerificationModal);\n"
},
{
"change_type": "DELETE",
"old_path": "web/modals/account/verification-success-modal.react.js",
"new_path": null,
"diff": "-// @flow\n-\n-import React from 'react';\n-\n-import css from '../../style.css';\n-import Modal from '../modal.react';\n-\n-type Props = {\n- onClose: () => void,\n-};\n-\n-export default function VerificationSuccessModal(props: Props) {\n- return (\n- <Modal name=\"Verified email\" onClose={props.onClose}>\n- <div className={css['modal-body']}>\n- <p>\n- Thanks for verifying your email address!\n- </p>\n- </div>\n- </Modal>\n- );\n-}\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [web] Show expiration error when verification code is invalid |
129,187 | 15.04.2019 12:30:14 | 14,400 | 9232725159efe3a98fbd3828e0fa2dcc757310cb | [server] Wait until unread status is updated before calling sendPushNotifs
Otherwise badge count can be wrong. | [
{
"change_type": "MODIFY",
"old_path": "server/src/creators/message-creator.js",
"new_path": "server/src/creators/message-creator.js",
"diff": "@@ -318,10 +318,11 @@ async function postMessageSend(\n}\nawait Promise.all([\n- sendPushNotifs(pushInfo),\nupdateUnreadStatus(setUnreadPairs),\nredisPublish(viewer, messageInfosPerUser),\n]);\n+\n+ await sendPushNotifs(pushInfo);\n}\nasync function updateUnreadStatus(\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [server] Wait until unread status is updated before calling sendPushNotifs
Otherwise badge count can be wrong. |
129,187 | 15.04.2019 19:36:19 | 14,400 | 1399cdd6e5fb657feb320f2d3d57b17389783bb0 | [native] Fix up getParam React Navigation Flow type | [
{
"change_type": "MODIFY",
"old_path": "native/flow-typed/npm/@react-navigation/core_v3.x.x.js",
"new_path": "native/flow-typed/npm/@react-navigation/core_v3.x.x.js",
"diff": "@@ -488,8 +488,8 @@ declare module '@react-navigation/core' {\nfallback?: $ElementType<\n$PropertyType<\n{|\n+ ...{| params: { } |},\n...$Exact<S>,\n- ...{| params: {| [ParamName]: void |} |},\n|},\n'params'\n>,\n@@ -498,8 +498,8 @@ declare module '@react-navigation/core' {\n) => $ElementType<\n$PropertyType<\n{|\n+ ...{| params: { } |},\n...$Exact<S>,\n- ...{| params: {| [ParamName]: void |} |},\n|},\n'params'\n>,\n"
},
{
"change_type": "MODIFY",
"old_path": "native/flow-typed/npm/react-navigation_v3.x.x.js",
"new_path": "native/flow-typed/npm/react-navigation_v3.x.x.js",
"diff": "@@ -592,8 +592,8 @@ declare module 'react-navigation' {\nfallback?: $ElementType<\n$PropertyType<\n{|\n+ ...{| params: { } |},\n...$Exact<S>,\n- ...{| params: {| [ParamName]: void |} |},\n|},\n'params'\n>,\n@@ -602,8 +602,8 @@ declare module 'react-navigation' {\n) => $ElementType<\n$PropertyType<\n{|\n+ ...{| params: { } |},\n...$Exact<S>,\n- ...{| params: {| [ParamName]: void |} |},\n|},\n'params'\n>,\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Fix up getParam React Navigation Flow type |
129,187 | 15.04.2019 23:16:46 | 14,400 | 3ffe57a3c2058048f622bb4e05c83cfe0fee9b82 | [server] Prevent overeager notification rescind on activity update | [
{
"change_type": "MODIFY",
"old_path": "server/src/fetchers/thread-fetchers.js",
"new_path": "server/src/fetchers/thread-fetchers.js",
"diff": "@@ -184,6 +184,34 @@ async function checkThreadPermission(\nreturn permissionLookup(permissionsBlob, permission);\n}\n+async function checkThreadPermissions(\n+ viewer: Viewer,\n+ threadIDs: $ReadOnlyArray<string>,\n+ permission: ThreadPermission,\n+): Promise<{[threadID: string]: bool}> {\n+ const viewerID = viewer.id;\n+ const query = SQL`\n+ SELECT thread, permissions\n+ FROM memberships\n+ WHERE thread IN (${threadIDs}) AND user = ${viewerID}\n+ `;\n+ const [ result ] = await dbQuery(query);\n+\n+ const permissionsBlobs = new Map();\n+ for (let row of result) {\n+ const threadID = row.thread.toString();\n+ permissionsBlobs.set(threadID, row.permissions);\n+ }\n+\n+ const permissionByThread = {};\n+ for (let threadID of threadIDs) {\n+ const permissionsBlob = permissionsBlobs.get(threadID);\n+ permissionByThread[threadID] =\n+ permissionLookup(permissionsBlob, permission);\n+ }\n+ return permissionByThread;\n+}\n+\nasync function viewerIsMember(\nviewer: Viewer,\nthreadID: string,\n@@ -210,5 +238,6 @@ export {\nverifyThreadID,\nfetchThreadPermissionsBlob,\ncheckThreadPermission,\n+ checkThreadPermissions,\nviewerIsMember,\n};\n"
},
{
"change_type": "MODIFY",
"old_path": "server/src/updaters/activity-updaters.js",
"new_path": "server/src/updaters/activity-updaters.js",
"diff": "@@ -20,7 +20,7 @@ import { rescindPushNotifs } from '../push/rescind';\nimport { createUpdates } from '../creators/update-creator';\nimport { deleteActivityForViewerSession } from '../deleters/activity-deleters';\nimport { earliestFocusedTimeConsideredCurrent } from '../shared/focused-times';\n-import { checkThreadPermission } from '../fetchers/thread-fetchers';\n+import { checkThreadPermissions } from '../fetchers/thread-fetchers';\nasync function activityUpdater(\nviewer: Viewer,\n@@ -47,96 +47,131 @@ async function activityUpdater(\nupdatesForThreadID.push(activityUpdate);\n}\n- const verifiedThreadIDs = await checkThreadPermissions(\n+ const permissionResults = await checkThreadPermissions(\nviewer,\n- unverifiedThreadIDs,\n- );\n-\n- const focusedThreadIDs = new Set();\n- const unfocusedThreadIDs = new Set();\n- const unfocusedThreadLatestMessages = new Map();\n- for (let threadID of verifiedThreadIDs) {\n- const focusUpdates = focusUpdatesByThreadID.get(threadID);\n- invariant(focusUpdates, `no focusUpdate for thread ID ${threadID}`);\n- for (let focusUpdate of focusUpdates) {\n- if (focusUpdate.focus) {\n- focusedThreadIDs.add(threadID);\n- } else if (focusUpdate.focus === false) {\n- unfocusedThreadIDs.add(threadID);\n- unfocusedThreadLatestMessages.set(\n- threadID,\n- focusUpdate.latestMessage ? focusUpdate.latestMessage : \"0\",\n+ [...unverifiedThreadIDs],\n+ threadPermissions.VISIBLE,\n);\n- }\n- }\n+ const verifiedThreadIDs =\n+ Object.keys(permissionResults).filter(key => permissionResults[key]);\n+ if (verifiedThreadIDs.length === 0) {\n+ return { unfocusedToUnread: [] };\n}\n+ const viewerMemberThreadsPromise = (async () => {\nconst membershipQuery = SQL`\nSELECT thread\nFROM memberships\nWHERE role != 0\n- AND thread IN (${[...focusedThreadIDs, ...unfocusedThreadIDs]})\n+ AND thread IN (${verifiedThreadIDs})\nAND user = ${viewer.userID}\n`;\nconst [ membershipResult ] = await dbQuery(membershipQuery);\n-\nconst viewerMemberThreads = new Set();\nfor (let row of membershipResult) {\nconst threadID = row.thread.toString();\nviewerMemberThreads.add(threadID);\n}\n+ return viewerMemberThreads;\n+ })();\n+\n+ const currentlyFocused = [];\n+ const unfocusedLatestMessages = new Map();\n+ const rescindConditions = [];\n+ for (let threadID of verifiedThreadIDs) {\n+ const focusUpdates = focusUpdatesByThreadID.get(threadID);\n+ invariant(focusUpdates, `no focusUpdate for thread ID ${threadID}`);\n+\n+ let focusEndedAt = null;\n+ for (let focusUpdate of focusUpdates) {\n+ if (focusUpdate.focus === false) {\n+ focusEndedAt = focusUpdate.latestMessage\n+ ? focusUpdate.latestMessage\n+ : \"0\";\n+ // There should only ever be one of these in a request anyways\n+ break;\n+ }\n+ }\n+\n+ if (!focusEndedAt) {\n+ currentlyFocused.push(threadID);\n+ rescindConditions.push(SQL`n.thread = ${threadID}`);\n+ } else {\n+ unfocusedLatestMessages.set(threadID, focusEndedAt);\n+ rescindConditions.push(\n+ SQL`(n.thread = ${threadID} AND n.message <= ${focusEndedAt})`,\n+ );\n+ }\n+ }\n+\n+ const focusUpdatePromise = updateFocusedRows(viewer, currentlyFocused);\n+\n+ const rescindCondition = SQL`n.user = ${viewer.userID} AND `;\n+ rescindCondition.append(mergeOrConditions(rescindConditions));\n+ const rescindPromise = rescindPushNotifs(rescindCondition);\n+\n+ const [ viewerMemberThreads, unfocusedToUnread ] = await Promise.all([\n+ viewerMemberThreadsPromise,\n+ determineUnfocusedThreadsReadStatus(\n+ viewer,\n+ unfocusedLatestMessages,\n+ ),\n+ ]);\n+\n+ const setToRead = [ ...currentlyFocused ];\n+ const setToUnread = [];\n+ for (let [ threadID ] of unfocusedLatestMessages) {\n+ if (!unfocusedToUnread.includes(threadID)) {\n+ setToRead.push(threadID);\n+ } else {\n+ setToUnread.push(threadID);\n+ }\n+ }\n+\nconst filterFunc = threadID => viewerMemberThreads.has(threadID);\n- const memberFocusedThreadIDs = [...focusedThreadIDs].filter(filterFunc);\n- const memberUnfocusedThreadIDs = [...unfocusedThreadIDs].filter(filterFunc);\n+ const memberSetToRead = setToRead.filter(filterFunc);\n+ const memberSetToUnread = setToUnread.filter(filterFunc);\n- const promises = [];\n- promises.push(updateFocusedRows(viewer, memberFocusedThreadIDs));\n- if (memberFocusedThreadIDs.length > 0) {\n- promises.push(dbQuery(SQL`\n- UPDATE memberships\n- SET unread = 0\n- WHERE thread IN (${memberFocusedThreadIDs})\n- AND user = ${viewer.userID}\n- `));\nconst time = Date.now();\n- promises.push(createUpdates(\n- memberFocusedThreadIDs.map(threadID => ({\n+ const makeUpdates = (\n+ threadIDs: $ReadOnlyArray<string>,\n+ unread: bool,\n+ ) => createUpdates(\n+ threadIDs.map(threadID => ({\ntype: updateTypes.UPDATE_THREAD_READ_STATUS,\nuserID: viewer.userID,\ntime,\nthreadID,\n- unread: false,\n+ unread,\n})),\n{ viewer, updatesForCurrentSession: \"ignore\" },\n- ));\n- const rescindCondition = SQL`\n- n.user = ${viewer.userID} AND n.thread IN (${memberFocusedThreadIDs})\n- `;\n- promises.push(rescindPushNotifs(rescindCondition));\n- }\n- await Promise.all(promises);\n-\n- const unfocusedToUnread = await possiblyResetThreadsToUnread(\n- viewer,\n- memberUnfocusedThreadIDs,\n- unfocusedThreadLatestMessages,\n);\n- return { unfocusedToUnread };\n+ const promises = [\n+ focusUpdatePromise,\n+ rescindPromise,\n+ ];\n+ if (memberSetToRead.length > 0) {\n+ promises.push(dbQuery(SQL`\n+ UPDATE memberships\n+ SET unread = 0\n+ WHERE thread IN (${memberSetToRead})\n+ AND user = ${viewer.userID}\n+ `));\n+ promises.push(makeUpdates(memberSetToRead, false));\n+ }\n+ if (memberSetToUnread.length > 0) {\n+ promises.push(dbQuery(SQL`\n+ UPDATE memberships\n+ SET unread = 1\n+ WHERE thread IN (${memberSetToUnread})\n+ AND user = ${viewer.userID}\n+ `));\n+ promises.push(makeUpdates(memberSetToUnread, true));\n}\n-async function checkThreadPermissions(\n- viewer: Viewer,\n- unverifiedThreadIDs: Set<string>,\n-): Promise<string[]> {\n- return await promiseFilter(\n- [...unverifiedThreadIDs],\n- (threadID: string) => checkThreadPermission(\n- viewer,\n- threadID,\n- threadPermissions.VISIBLE,\n- ),\n- );\n+ await Promise.all(promises);\n+ return { unfocusedToUnread };\n}\nasync function updateFocusedRows(\n@@ -165,20 +200,19 @@ async function updateFocusedRows(\n// is no longer the latest message ID.\n// Returns the set of unfocused threads that should be set to unread on\n// the client because a new message arrived since they were unfocused.\n-async function possiblyResetThreadsToUnread(\n+async function determineUnfocusedThreadsReadStatus(\nviewer: Viewer,\n- unfocusedThreadIDs: $ReadOnlyArray<string>,\n- unfocusedThreadLatestMessages: Map<string, string>,\n+ unfocusedLatestMessages: Map<string, string>,\n): Promise<string[]> {\n- if (unfocusedThreadIDs.length === 0 || !viewer.loggedIn) {\n+ if (unfocusedLatestMessages.size === 0 || !viewer.loggedIn) {\nreturn [];\n}\n- const threadUserPairs = unfocusedThreadIDs.map(\n- threadID => [viewer.userID, threadID],\n+ const unfocusedThreadIDs = [ ...unfocusedLatestMessages.keys() ];\n+ const focusedElsewhereThreadIDs = await checkThreadsFocused(\n+ viewer,\n+ unfocusedThreadIDs,\n);\n- const focusedElsewherePairs = await checkThreadsFocused(threadUserPairs);\n- const focusedElsewhereThreadIDs = focusedElsewherePairs.map(pair => pair[1]);\nconst unreadCandidates =\n_difference(unfocusedThreadIDs)(focusedElsewhereThreadIDs);\nif (unreadCandidates.length === 0) {\n@@ -204,7 +238,7 @@ async function possiblyResetThreadsToUnread(\nfor (let row of result) {\nconst threadID = row.thread.toString();\nconst serverLatestMessage = row.latest_message.toString();\n- const clientLatestMessage = unfocusedThreadLatestMessages.get(threadID);\n+ const clientLatestMessage = unfocusedLatestMessages.get(threadID);\ninvariant(\nclientLatestMessage,\n\"latest message should be set for all provided threads\",\n@@ -216,56 +250,29 @@ async function possiblyResetThreadsToUnread(\nresetToUnread.push(threadID);\n}\n}\n- if (resetToUnread.length === 0) {\n- return resetToUnread;\n- }\n-\n- const time = Date.now();\n- const promises = [];\n- const unreadQuery = SQL`\n- UPDATE memberships\n- SET unread = 1\n- WHERE thread IN (${resetToUnread})\n- AND user = ${viewer.userID}\n- `;\n- promises.push(dbQuery(unreadQuery));\n- promises.push(createUpdates(\n- resetToUnread.map(threadID => ({\n- type: updateTypes.UPDATE_THREAD_READ_STATUS,\n- userID: viewer.userID,\n- time,\n- threadID,\n- unread: true,\n- })),\n- { viewer, updatesForCurrentSession: \"ignore\" },\n- ));\n- await Promise.all(promises);\n-\nreturn resetToUnread;\n}\nasync function checkThreadsFocused(\n- threadUserPairs: $ReadOnlyArray<[string, string]>,\n-): Promise<$ReadOnlyArray<[string, string]>> {\n- const conditions = threadUserPairs.map(\n- pair => SQL`(user = ${pair[0]} AND thread = ${pair[1]})`,\n- );\n+ viewer: Viewer,\n+ threadIDs: $ReadOnlyArray<string>,\n+): Promise<string[]> {\nconst time = earliestFocusedTimeConsideredCurrent();\n-\nconst query = SQL`\n- SELECT user, thread\n+ SELECT thread\nFROM focused\n- WHERE time > ${time} AND\n+ WHERE time > ${time}\n+ AND user = ${viewer.userID}\n+ AND thread IN (${threadIDs})\n+ GROUP BY thread\n`;\n- query.append(mergeOrConditions(conditions));\n- query.append(SQL`GROUP BY user, thread`);\nconst [ result ] = await dbQuery(query);\n- const focusedThreadUserPairs = [];\n+ const focusedThreadIDs = [];\nfor (let row of result) {\n- focusedThreadUserPairs.push([row.user.toString(), row.thread.toString()]);\n+ focusedThreadIDs.push(row.thread.toString());\n}\n- return focusedThreadUserPairs;\n+ return focusedThreadIDs;\n}\n// The `focused` table tracks which chat threads are currently in view for a\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [server] Prevent overeager notification rescind on activity update |
129,187 | 16.04.2019 15:31:14 | 14,400 | ffef5bd567048a2bf246d7191ec9c4e967ac8002 | [server] Only rescind notifs after unread update so badge count is correct | [
{
"change_type": "MODIFY",
"old_path": "server/src/updaters/activity-updaters.js",
"new_path": "server/src/updaters/activity-updaters.js",
"diff": "@@ -106,10 +106,6 @@ async function activityUpdater(\nconst focusUpdatePromise = updateFocusedRows(viewer, currentlyFocused);\n- const rescindCondition = SQL`n.user = ${viewer.userID} AND `;\n- rescindCondition.append(mergeOrConditions(rescindConditions));\n- const rescindPromise = rescindPushNotifs(rescindCondition);\n-\nconst [ viewerMemberThreads, unfocusedToUnread ] = await Promise.all([\nviewerMemberThreadsPromise,\ndetermineUnfocusedThreadsReadStatus(\n@@ -147,10 +143,7 @@ async function activityUpdater(\n{ viewer, updatesForCurrentSession: \"ignore\" },\n);\n- const promises = [\n- focusUpdatePromise,\n- rescindPromise,\n- ];\n+ const promises = [ focusUpdatePromise ];\nif (memberSetToRead.length > 0) {\npromises.push(dbQuery(SQL`\nUPDATE memberships\n@@ -171,6 +164,12 @@ async function activityUpdater(\n}\nawait Promise.all(promises);\n+\n+ // We do this afterwards so the badge count is correct\n+ const rescindCondition = SQL`n.user = ${viewer.userID} AND `;\n+ rescindCondition.append(mergeOrConditions(rescindConditions));\n+ await rescindPushNotifs(rescindCondition);\n+\nreturn { unfocusedToUnread };\n}\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [server] Only rescind notifs after unread update so badge count is correct |
129,187 | 17.04.2019 00:28:01 | 14,400 | f3e4d2c9cf735edf61cdddae362b7a34996af53b | [server] Fix botherMonthlyActivesToUpdateAppVersion
Was erroring out | [
{
"change_type": "MODIFY",
"old_path": "server/src/bots/app-version-update.js",
"new_path": "server/src/bots/app-version-update.js",
"diff": "@@ -57,9 +57,9 @@ async function botherMonthlyActivesToUpdateAppVersion(): Promise<void> {\nfor (let row of result) {\nconst userID = row.user.toString();\nconst minCodeVersion = row.min_code_version;\n- const squadbotThread = row.squadbot_thread.toString();\ncodeVersions.set(userID, minCodeVersion);\n- if (squadbotThread) {\n+ if (row.squadbot_thread) {\n+ const squadbotThread = row.squadbot_thread.toString();\nsquadbotThreads.set(userID, squadbotThread);\n} else {\nusersToSquadbotThreadPromises[userID] = createSquadbotThread(userID);\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [server] Fix botherMonthlyActivesToUpdateAppVersion
Was erroring out |
129,187 | 17.04.2019 14:49:27 | 14,400 | f88477efd836766523a188f8d566668a852353ee | [native] Remove react-native-fcm | [
{
"change_type": "MODIFY",
"old_path": "native/android/app/build.gradle",
"new_path": "native/android/app/build.gradle",
"diff": "apply plugin: \"com.android.application\"\n-apply plugin: \"com.google.gms.google-services\"\nimport com.android.build.OutputFile\n@@ -160,9 +159,6 @@ dependencies {\ncompile project(':react-native-gesture-handler')\nimplementation project(':react-native-splash-screen')\nimplementation project(':react-native-exit-app')\n- implementation project(':react-native-fcm')\n- implementation 'com.google.firebase:firebase-core'\n- implementation 'com.google.firebase:firebase-messaging'\nimplementation project(':react-native-vector-icons')\nimplementation project(':react-native-keychain')\nimplementation fileTree(dir: \"libs\", include: [\"*.jar\"])\n"
},
{
"change_type": "MODIFY",
"old_path": "native/android/app/src/main/AndroidManifest.xml",
"new_path": "native/android/app/src/main/AndroidManifest.xml",
"diff": "android:theme=\"@style/AppTheme\"\nandroid:networkSecurityConfig=\"@xml/network_security_config\"\n>\n- <receiver android:name=\"com.evollu.react.fcm.FIRLocalMessagingPublisher\"/>\n- <receiver android:enabled=\"true\" android:exported=\"true\" android:name=\"com.evollu.react.fcm.FIRSystemBootEventReceiver\">\n- <intent-filter>\n- <action android:name=\"android.intent.action.BOOT_COMPLETED\"/>\n- <action android:name=\"android.intent.action.QUICKBOOT_POWERON\"/>\n- <action android:name=\"com.htc.intent.action.QUICKBOOT_POWERON\"/>\n- <category android:name=\"android.intent.category.DEFAULT\" />\n- </intent-filter>\n- </receiver>\n- <service android:name=\"com.evollu.react.fcm.MessagingService\" android:enabled=\"true\" android:exported=\"true\">\n- <intent-filter>\n- <action android:name=\"com.google.firebase.MESSAGING_EVENT\"/>\n- </intent-filter>\n- </service>\n- <service android:name=\"com.evollu.react.fcm.InstanceIdService\" android:exported=\"false\">\n- <intent-filter>\n- <action android:name=\"com.google.firebase.INSTANCE_ID_EVENT\"/>\n- </intent-filter>\n- </service>\n<activity\nandroid:name=\".MainActivity\"\nandroid:launchMode=\"singleTask\"\n<data android:scheme=\"http\" android:host=\"www.squadcal.org\" android:pathPrefix=\"/verify/\" />\n<data android:scheme=\"https\" android:host=\"www.squadcal.org\" android:pathPrefix=\"/verify/\" />\n</intent-filter>\n- <intent-filter>\n- <action android:name=\"fcm.ACTION.HELLO\" />\n- <category android:name=\"android.intent.category.DEFAULT\" />\n- </intent-filter>\n</activity>\n<activity\nandroid:name=\".SplashActivity\"\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": "@@ -12,7 +12,6 @@ import com.swmansion.rnscreens.RNScreensPackage;\nimport com.swmansion.gesturehandler.react.RNGestureHandlerPackage;\nimport org.devio.rn.splashscreen.SplashScreenReactPackage;\nimport com.github.wumke.RNExitApp.RNExitAppPackage;\n-import com.evollu.react.fcm.FIRMessagingPackage;\nimport com.oblador.vectoricons.VectorIconsPackage;\nimport com.oblador.keychain.KeychainPackage;\nimport com.facebook.react.ReactNativeHost;\n@@ -44,7 +43,6 @@ public class MainApplication extends Application implements ReactApplication {\nnew RNGestureHandlerPackage(),\nnew SplashScreenReactPackage(),\nnew RNExitAppPackage(),\n- new FIRMessagingPackage(),\nnew VectorIconsPackage(),\nnew KeychainPackage()\n);\n"
},
{
"change_type": "MODIFY",
"old_path": "native/android/build.gradle",
"new_path": "native/android/build.gradle",
"diff": "@@ -14,7 +14,6 @@ buildscript {\n}\ndependencies {\nclasspath 'com.android.tools.build:gradle:3.3.1'\n- classpath 'com.google.gms:google-services:3.0.0'\n// NOTE: Do not place your application dependencies here; they belong\n// in the individual module build.gradle files\n"
},
{
"change_type": "MODIFY",
"old_path": "native/android/settings.gradle",
"new_path": "native/android/settings.gradle",
"diff": "@@ -17,8 +17,6 @@ include ':react-native-splash-screen'\nproject(':react-native-splash-screen').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-splash-screen/android')\ninclude ':react-native-exit-app'\nproject(':react-native-exit-app').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-exit-app/android')\n-include ':react-native-fcm'\n-project(':react-native-fcm').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fcm/android')\ninclude ':react-native-vector-icons'\nproject(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')\ninclude ':react-native-keychain'\n"
},
{
"change_type": "DELETE",
"old_path": "native/flow-typed/npm/react-native-fcm_vx.x.x.js",
"new_path": null,
"diff": "-// flow-typed signature: 7026fed2bf7663e3aa05df4584086a5e\n-// flow-typed version: <<STUB>>/react-native-fcm_vgit+https://git@github.com/ashoat/react-native-fcm.git/flow_v0.92.0\n-\n-/**\n- * This is an autogenerated libdef stub for:\n- *\n- * 'react-native-fcm'\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-fcm' {\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-fcm/Examples/simple-fcm-client/__tests__/index.android' {\n- declare module.exports: any;\n-}\n-\n-declare module 'react-native-fcm/Examples/simple-fcm-client/__tests__/index.ios' {\n- declare module.exports: any;\n-}\n-\n-declare module 'react-native-fcm/Examples/simple-fcm-client/app/App' {\n- declare module.exports: any;\n-}\n-\n-declare module 'react-native-fcm/Examples/simple-fcm-client/app/FirebaseClient' {\n- declare module.exports: any;\n-}\n-\n-declare module 'react-native-fcm/Examples/simple-fcm-client/app/FirebaseConstants' {\n- declare module.exports: any;\n-}\n-\n-declare module 'react-native-fcm/Examples/simple-fcm-client/app/Listeners' {\n- declare module.exports: any;\n-}\n-\n-declare module 'react-native-fcm/Examples/simple-fcm-client/index.android' {\n- declare module.exports: any;\n-}\n-\n-declare module 'react-native-fcm/Examples/simple-fcm-client/index.ios' {\n- declare module.exports: any;\n-}\n-\n-// Filename aliases\n-declare module 'react-native-fcm/Examples/simple-fcm-client/__tests__/index.android.js' {\n- declare module.exports: $Exports<'react-native-fcm/Examples/simple-fcm-client/__tests__/index.android'>;\n-}\n-declare module 'react-native-fcm/Examples/simple-fcm-client/__tests__/index.ios.js' {\n- declare module.exports: $Exports<'react-native-fcm/Examples/simple-fcm-client/__tests__/index.ios'>;\n-}\n-declare module 'react-native-fcm/Examples/simple-fcm-client/app/App.js' {\n- declare module.exports: $Exports<'react-native-fcm/Examples/simple-fcm-client/app/App'>;\n-}\n-declare module 'react-native-fcm/Examples/simple-fcm-client/app/FirebaseClient.js' {\n- declare module.exports: $Exports<'react-native-fcm/Examples/simple-fcm-client/app/FirebaseClient'>;\n-}\n-declare module 'react-native-fcm/Examples/simple-fcm-client/app/FirebaseConstants.js' {\n- declare module.exports: $Exports<'react-native-fcm/Examples/simple-fcm-client/app/FirebaseConstants'>;\n-}\n-declare module 'react-native-fcm/Examples/simple-fcm-client/app/Listeners.js' {\n- declare module.exports: $Exports<'react-native-fcm/Examples/simple-fcm-client/app/Listeners'>;\n-}\n-declare module 'react-native-fcm/Examples/simple-fcm-client/index.android.js' {\n- declare module.exports: $Exports<'react-native-fcm/Examples/simple-fcm-client/index.android'>;\n-}\n-declare module 'react-native-fcm/Examples/simple-fcm-client/index.ios.js' {\n- declare module.exports: $Exports<'react-native-fcm/Examples/simple-fcm-client/index.ios'>;\n-}\n-declare module 'react-native-fcm/index' {\n- declare module.exports: $Exports<'react-native-fcm'>;\n-}\n-declare module 'react-native-fcm/index.js' {\n- declare module.exports: $Exports<'react-native-fcm'>;\n-}\n"
},
{
"change_type": "MODIFY",
"old_path": "native/package.json",
"new_path": "native/package.json",
"diff": "\"react-native\": \"0.59.4\",\n\"react-native-exit-app\": \"^1.0.0\",\n\"react-native-fast-image\": \"^5.2.0\",\n- \"react-native-fcm\": \"git+https://git@github.com/ashoat/react-native-fcm.git\",\n\"react-native-floating-action\": \"^1.9.0\",\n\"react-native-gesture-handler\": \"1.1.0\",\n\"react-native-hyperlink\": \"git+https://git@github.com/ashoat/react-native-hyperlink.git#both\",\n"
},
{
"change_type": "MODIFY",
"old_path": "yarn.lock",
"new_path": "yarn.lock",
"diff": "@@ -10501,10 +10501,6 @@ react-native-fast-image@^5.2.0:\nresolved \"https://registry.yarnpkg.com/react-native-fast-image/-/react-native-fast-image-5.2.0.tgz#6730eb06951ea6f9a79abe02a733bc05b7a73412\"\nintegrity sha512-S+2gmv9HfLc7CGjjnQ3kO/QoZD9BJnjfwWhsJWgjEvaeOPbpHZaXSUkINSqLcHD5KIHcYidu+U2lgXdEv4Jamg==\n-\"react-native-fcm@git+https://git@github.com/ashoat/react-native-fcm.git\":\n- version \"16.0.0\"\n- resolved \"git+https://git@github.com/ashoat/react-native-fcm.git#5b3c8a971c3030c42b8cb795ad2f0e29ae319b78\"\n-\nreact-native-floating-action@^1.9.0:\nversion \"1.13.0\"\nresolved \"https://registry.yarnpkg.com/react-native-floating-action/-/react-native-floating-action-1.13.0.tgz#876ab9227c4eda8630020a6a3adc20041870edf3\"\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Remove react-native-fcm |
129,187 | 17.04.2019 14:34:05 | 14,400 | 7e5e81f2b98fc2671ba54b683e53fc2dc1b9fa67 | [native] react-native-firebase | [
{
"change_type": "MODIFY",
"old_path": "native/android/app/build.gradle",
"new_path": "native/android/app/build.gradle",
"diff": "@@ -144,19 +144,21 @@ android {\n}\n}\n}\n- configurations.all {\n- resolutionStrategy.force 'com.android.support:support-v4:28.0.0'\n- }\n}\ndependencies {\n+ implementation project(':react-native-firebase')\n+ implementation \"com.google.android.gms:play-services-base:16.1.0\"\n+ implementation \"com.google.firebase:firebase-core:16.0.8\"\n+ implementation \"com.google.firebase:firebase-messaging:17.5.0\"\n+ implementation \"me.leolin:ShortcutBadger:1.1.21@aar\"\nimplementation project(':@react-native-community_netinfo')\nimplementation project(':@react-native-community_async-storage')\nimplementation project(':react-native-reanimated')\nimplementation project(':react-native-orientation-locker')\nimplementation project(':react-native-fast-image')\n- compile project(':react-native-screens')\n- compile project(':react-native-gesture-handler')\n+ implementation project(':react-native-screens')\n+ implementation project(':react-native-gesture-handler')\nimplementation project(':react-native-splash-screen')\nimplementation project(':react-native-exit-app')\nimplementation project(':react-native-vector-icons')\n@@ -172,3 +174,5 @@ task copyDownloadableDepsToLibs(type: Copy) {\nfrom configurations.compile\ninto 'libs'\n}\n+\n+apply plugin: 'com.google.gms.google-services'\n"
},
{
"change_type": "MODIFY",
"old_path": "native/android/app/src/main/AndroidManifest.xml",
"new_path": "native/android/app/src/main/AndroidManifest.xml",
"diff": "android:theme=\"@style/AppTheme\"\nandroid:networkSecurityConfig=\"@xml/network_security_config\"\n>\n+ <service android:name=\"io.invertase.firebase.messaging.RNFirebaseMessagingService\">\n+ <intent-filter>\n+ <action android:name=\"com.google.firebase.MESSAGING_EVENT\" />\n+ </intent-filter>\n+ </service>\n+ <service android:name=\"io.invertase.firebase.messaging.RNFirebaseBackgroundMessagingService\" />\n<activity\nandroid:name=\".MainActivity\"\nandroid:launchMode=\"singleTask\"\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": "@@ -3,6 +3,9 @@ package org.squadcal;\nimport android.app.Application;\nimport com.facebook.react.ReactApplication;\n+import io.invertase.firebase.RNFirebasePackage;\n+import io.invertase.firebase.messaging.RNFirebaseMessagingPackage;\n+import io.invertase.firebase.notifications.RNFirebaseNotificationsPackage;\nimport com.reactnativecommunity.netinfo.NetInfoPackage;\nimport com.reactnativecommunity.asyncstorage.AsyncStoragePackage;\nimport com.swmansion.reanimated.ReanimatedPackage;\n@@ -34,6 +37,9 @@ public class MainApplication extends Application implements ReactApplication {\nprotected List<ReactPackage> getPackages() {\nreturn Arrays.<ReactPackage>asList(\nnew MainReactPackage(),\n+ new RNFirebasePackage(),\n+ new RNFirebaseMessagingPackage(),\n+ new RNFirebaseNotificationsPackage(),\nnew NetInfoPackage(),\nnew AsyncStoragePackage(),\nnew ReanimatedPackage(),\n"
},
{
"change_type": "MODIFY",
"old_path": "native/android/build.gradle",
"new_path": "native/android/build.gradle",
"diff": "@@ -13,7 +13,8 @@ buildscript {\njcenter()\n}\ndependencies {\n- classpath 'com.android.tools.build:gradle:3.3.1'\n+ classpath 'com.android.tools.build:gradle:3.3.2'\n+ classpath 'com.google.gms:google-services:4.2.0'\n// NOTE: Do not place your application dependencies here; they belong\n// in the individual module build.gradle files\n"
},
{
"change_type": "MODIFY",
"old_path": "native/android/settings.gradle",
"new_path": "native/android/settings.gradle",
"diff": "rootProject.name = 'SquadCal'\n+include ':react-native-firebase'\n+project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')\ninclude ':@react-native-community_netinfo'\nproject(':@react-native-community_netinfo').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/netinfo/android')\ninclude ':@react-native-community_async-storage'\n"
},
{
"change_type": "MODIFY",
"old_path": "native/package.json",
"new_path": "native/package.json",
"diff": "\"react-native\": \"0.59.4\",\n\"react-native-exit-app\": \"^1.0.0\",\n\"react-native-fast-image\": \"^5.2.0\",\n+ \"react-native-firebase\": \"^5.3.1\",\n\"react-native-floating-action\": \"^1.9.0\",\n\"react-native-gesture-handler\": \"1.1.0\",\n\"react-native-hyperlink\": \"git+https://git@github.com/ashoat/react-native-hyperlink.git#both\",\n"
},
{
"change_type": "MODIFY",
"old_path": "yarn.lock",
"new_path": "yarn.lock",
"diff": "@@ -8971,6 +8971,11 @@ onetime@^2.0.0:\ndependencies:\nmimic-fn \"^1.0.0\"\n+opencollective-postinstall@^2.0.0:\n+ version \"2.0.2\"\n+ resolved \"https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz#5657f1bede69b6e33a45939b061eb53d3c6c3a89\"\n+ integrity sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw==\n+\nopn@^3.0.2:\nversion \"3.0.3\"\nresolved \"https://registry.yarnpkg.com/opn/-/opn-3.0.3.tgz#b6d99e7399f78d65c3baaffef1fb288e9b85243a\"\n@@ -10501,6 +10506,14 @@ react-native-fast-image@^5.2.0:\nresolved \"https://registry.yarnpkg.com/react-native-fast-image/-/react-native-fast-image-5.2.0.tgz#6730eb06951ea6f9a79abe02a733bc05b7a73412\"\nintegrity sha512-S+2gmv9HfLc7CGjjnQ3kO/QoZD9BJnjfwWhsJWgjEvaeOPbpHZaXSUkINSqLcHD5KIHcYidu+U2lgXdEv4Jamg==\n+react-native-firebase@^5.3.1:\n+ version \"5.3.1\"\n+ resolved \"https://registry.yarnpkg.com/react-native-firebase/-/react-native-firebase-5.3.1.tgz#cfd295f562249f6fcf5e3fb2c62894575ece2c7f\"\n+ integrity sha512-eOuSqIl+DZPNmN5ivSLgkEcsl5m0sXxttoPBn3bOHfI+apEd4I8F+9fcbHerUFUvLzesXmHR9locjhR6IJ+q3w==\n+ dependencies:\n+ opencollective-postinstall \"^2.0.0\"\n+ prop-types \"^15.6.2\"\n+\nreact-native-floating-action@^1.9.0:\nversion \"1.13.0\"\nresolved \"https://registry.yarnpkg.com/react-native-floating-action/-/react-native-floating-action-1.13.0.tgz#876ab9227c4eda8630020a6a3adc20041870edf3\"\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] react-native-firebase |
129,187 | 17.04.2019 22:48:06 | 14,400 | f5d4ba7d575963a752f12bbd687eddbcd90babf7 | [native] Redo Android notifs code to use react-native-firebase | [
{
"change_type": "MODIFY",
"old_path": "native/android/app/src/main/AndroidManifest.xml",
"new_path": "native/android/app/src/main/AndroidManifest.xml",
"diff": "</intent-filter>\n</activity>\n<activity android:name=\"com.facebook.react.devsupport.DevSettingsActivity\" />\n+ <meta-data\n+ android:name=\"com.google.firebase.messaging.default_notification_icon\"\n+ android:resource=\"@drawable/notif_icon\"\n+ />\n<meta-data android:name=\"google_analytics_adid_collection_enabled\" android:value=\"false\" />\n</application>\n</manifest>\n"
},
{
"change_type": "MODIFY",
"old_path": "native/app.react.js",
"new_path": "native/app.react.js",
"diff": "@@ -18,11 +18,15 @@ import {\ntype NotifPermissionAlertInfo,\nnotifPermissionAlertInfoPropType,\n} from './push/alerts';\n-import type { RawMessageInfo } from 'lib/types/message-types';\nimport {\ntype ConnectionInfo,\nconnectionInfoPropType,\n} from 'lib/types/socket-types';\n+import type {\n+ RemoteMessage,\n+ Notification,\n+ NotificationOpen,\n+} from 'react-native-firebase';\nimport React from 'react';\nimport { Provider } from 'react-redux';\n@@ -42,7 +46,7 @@ import invariant from 'invariant';\nimport PropTypes from 'prop-types';\nimport NotificationsIOS from 'react-native-notifications';\nimport InAppNotification from 'react-native-in-app-notification';\n-import FCM, { FCMEvent } from 'react-native-fcm';\n+import firebase from 'react-native-firebase';\nimport SplashScreen from 'react-native-splash-screen';\nimport Orientation from 'react-native-orientation-locker';\n@@ -53,7 +57,6 @@ import {\n} from 'lib/actions/device-actions';\nimport { unreadCount } from 'lib/selectors/thread-selectors';\nimport { notificationPressActionType } from 'lib/shared/notif-utils';\n-import { saveMessagesActionType } from 'lib/actions/message-actions';\nimport {\nbackgroundActionType,\nforegroundActionType,\n@@ -65,7 +68,6 @@ import {\nimport {\nhandleURLActionType,\nrecordNotifPermissionAlertActionType,\n- recordAndroidNotificationActionType,\nclearAndroidNotificationActionType,\n} from './redux/action-types';\nimport { store, appBecameInactive } from './redux/redux-setup';\n@@ -79,8 +81,11 @@ import {\niosPushPermissionResponseReceived,\n} from './push/ios';\nimport {\n- requestAndroidPushPermissions,\n+ androidNotificationChannelID,\n+ handleAndroidMessage,\n+ androidBackgroundMessageTask,\n} from './push/android';\n+import { saveMessageInfos } from './push/utils';\nimport NotificationBody from './push/notification-body.react';\nimport ErrorBoundary from './error-boundary.react';\nimport { AppRouteName } from './navigation/route-names';\n@@ -145,8 +150,9 @@ class AppWithNavigationState extends React.PureComponent<Props> {\n};\ncurrentState: ?string = NativeAppState.currentState;\ninAppNotification: ?InAppNotification = null;\n- androidNotifListener: ?Object = null;\n- androidRefreshTokenListener: ?Object = null;\n+ androidTokenListener: ?(() => void) = null;\n+ androidMessageListener: ?(() => void) = null;\n+ androidNotifOpenListener: ?(() => void) = null;\ninitialAndroidNotifHandled = false;\nopenThreadOnceReceived: Set<string> = new Set();\nappStarted = 0;\n@@ -188,19 +194,19 @@ class AppWithNavigationState extends React.PureComponent<Props> {\nthis.iosNotificationOpened,\n);\n} else if (Platform.OS === \"android\") {\n- FCM.createNotificationChannel({\n- id: \"default\",\n- name: \"Default\",\n- description: \"SquadCal notifications channel\",\n- priority: \"high\",\n- });\n- this.androidNotifListener = FCM.on(\n- FCMEvent.Notification,\n- this.androidNotificationReceived,\n- );\n- this.androidRefreshTokenListener = FCM.on(\n- FCMEvent.RefreshToken,\n- this.registerPushPermissionsAndHandleInitialNotif,\n+ const channel = new firebase.notifications.Android.Channel(\n+ androidNotificationChannelID,\n+ 'Default',\n+ firebase.notifications.Android.Importance.Max,\n+ ).setDescription(\"SquadCal notifications channel\");\n+ firebase.notifications().android.createChannel(channel);\n+ this.androidTokenListener =\n+ firebase.messaging().onTokenRefresh(this.handleAndroidDeviceToken);\n+ this.androidMessageListener =\n+ firebase.messaging().onMessage(this.androidMessageReceived);\n+ this.androidNotifOpenListener =\n+ firebase.notifications().onNotificationOpened(\n+ this.androidNotificationOpened,\n);\n}\n}\n@@ -219,7 +225,7 @@ class AppWithNavigationState extends React.PureComponent<Props> {\nif (Platform.OS === \"ios\") {\nNotificationsIOS.setBadgesCount(unreadCount);\n} else if (Platform.OS === \"android\") {\n- FCM.setBadgeNumber(unreadCount);\n+ firebase.notifications().setBadge(unreadCount);\n}\n}\n@@ -285,13 +291,17 @@ class AppWithNavigationState extends React.PureComponent<Props> {\nthis.iosNotificationOpened,\n);\n} else if (Platform.OS === \"android\") {\n- if (this.androidNotifListener) {\n- this.androidNotifListener.remove();\n- this.androidNotifListener = null;\n+ if (this.androidTokenListener) {\n+ this.androidTokenListener();\n+ this.androidTokenListener = null;\n}\n- if (this.androidRefreshTokenListener) {\n- this.androidRefreshTokenListener.remove();\n- this.androidRefreshTokenListener = null;\n+ if (this.androidMessageListener) {\n+ this.androidMessageListener();\n+ this.androidMessageListener = null;\n+ }\n+ if (this.androidNotifOpenListener) {\n+ this.androidNotifOpenListener();\n+ this.androidNotifOpenListener = null;\n}\n}\n}\n@@ -374,39 +384,25 @@ class AppWithNavigationState extends React.PureComponent<Props> {\n}\nasync ensureAndroidPushNotifsEnabled() {\n- const missingDeviceToken = this.props.deviceToken === null\n- || this.props.deviceToken === undefined;\n- let token = await this.getAndroidFCMToken();\n- if (token) {\n- await this.registerPushPermissionsAndHandleInitialNotif(token);\n- return;\n- }\n+ const hasPermission = await firebase.messaging().hasPermission();\n+ if (!hasPermission) {\ntry {\n- await FCM.deleteInstanceId();\n- } catch (e) {\n- this.failedToRegisterPushPermissions(e);\n- return null;\n- }\n- token = await this.getAndroidFCMToken();\n- if (token) {\n- await this.registerPushPermissionsAndHandleInitialNotif(token);\n- } else if (missingDeviceToken) {\n+ await firebase.messaging().requestPermission();\n+ } catch (error) {\nthis.failedToRegisterPushPermissions();\n+ return;\n}\n}\n- async getAndroidFCMToken() {\n- try {\n- return await requestAndroidPushPermissions();\n- } catch (e) {\n- this.failedToRegisterPushPermissions(e);\n- return null;\n+ const fcmToken = await firebase.messaging().getToken();\n+ if (fcmToken) {\n+ await this.handleAndroidDeviceToken(fcmToken);\n+ } else {\n+ this.failedToRegisterPushPermissions();\n}\n}\n- registerPushPermissionsAndHandleInitialNotif = async (\n- deviceToken: string,\n- ) => {\n+ handleAndroidDeviceToken = async (deviceToken: string) => {\nthis.registerPushPermissions(deviceToken);\nawait this.handleInitialAndroidNotification();\n}\n@@ -416,9 +412,10 @@ class AppWithNavigationState extends React.PureComponent<Props> {\nreturn;\n}\nthis.initialAndroidNotifHandled = true;\n- const initialNotif = await FCM.getInitialNotification();\n+ const initialNotif =\n+ await firebase.notifications().getInitialNotification();\nif (initialNotif) {\n- await this.androidNotificationReceived(initialNotif, true);\n+ await this.androidNotificationOpened(initialNotif);\n}\n}\n@@ -510,12 +507,10 @@ class AppWithNavigationState extends React.PureComponent<Props> {\n}\nsaveMessageInfos(messageInfosString: string) {\n- const messageInfos: $ReadOnlyArray<RawMessageInfo> =\n- JSON.parse(messageInfosString);\n- const { updatesCurrentAsOf } = this.props;\n- this.props.dispatchActionPayload(\n- saveMessagesActionType,\n- { rawMessageInfos: messageInfos, updatesCurrentAsOf },\n+ saveMessageInfos(\n+ this.props.dispatch,\n+ messageInfosString,\n+ this.props.updatesCurrentAsOf,\n);\n}\n@@ -569,87 +564,47 @@ class AppWithNavigationState extends React.PureComponent<Props> {\nnotification.finish(NotificationsIOS.FetchResult.NewData);\n}\n- showInAppNotification(threadID: string, message: string) {\n+ showInAppNotification(threadID: string, message: string, title?: ?string) {\nif (threadID === this.props.activeThread) {\nreturn;\n}\ninvariant(this.inAppNotification, \"should be set\");\nthis.inAppNotification.show({\nmessage,\n+ title,\nonPress: () => this.onPressNotificationForThread(threadID, false),\n});\n}\n- // This function gets called when:\n- // - The app is open (either foreground or background) and a notif is\n- // received. In this case, notification has a custom_notification property.\n- // custom_notification can have either a new notif or a payload indicating a\n- // notif should be rescinded. In both cases, the native side will handle\n- // presenting or rescinding the notif.\n- // - The app is open and a notif is pressed. In this case, notification has a\n- // body property.\n- // - The app is closed and a notif is pressed. This is possible because when\n- // the app is closed and a notif is recevied, the native side will boot up\n- // to process it. However, in this case, this function does not get\n- // triggered when the notif is received - only when it is pressed.\n- androidNotificationReceived = async (\n- notification,\n- appOpenedFromNotif = false,\n- ) => {\n- if (appOpenedFromNotif && notification.messageInfos) {\n- // This indicates that while the app was closed (not backgrounded), a\n- // notif was delivered to the native side, which presented a local notif.\n- // The local notif was then pressed, opening the app and triggering here.\n- // Normally, this callback is called initially when the local notif is\n- // generated, and at that point the MessageInfos get saved. But in the\n- // case of a notif press opening the app, that doesn't happen, so we'll\n- // save the notifs here.\n- this.saveMessageInfos(notification.messageInfos);\n- }\n-\n- if (notification.body) {\n- // This indicates that we're being called because a notif was pressed\n- this.onPressNotificationForThread(notification.threadID, true);\n- return;\n- }\n-\n- if (notification.custom_notification) {\n- const customNotification = JSON.parse(notification.custom_notification);\n- if (customNotification.rescind === \"true\") {\n- // We have nothing to do on the JS thread in the case of a rescind\n- return;\n+ androidNotificationOpened = async (notificationOpen: NotificationOpen) => {\n+ if (this.detectUnsupervisedBackground) {\n+ this.detectUnsupervisedBackground(false);\n}\n-\n- const threadID = customNotification.threadID;\n- if (!threadID) {\n- console.log(\"Server notification with missing threadID received!\");\n- return;\n+ const { threadID } = notificationOpen.notification.data;\n+ this.onPressNotificationForThread(threadID, true);\n}\n- // We are here because notif was received, but hasn't been pressed yet\n+ androidMessageReceived = async (message: RemoteMessage) => {\nif (this.detectUnsupervisedBackground) {\nthis.detectUnsupervisedBackground(false);\n}\n- this.saveMessageInfos(customNotification.messageInfos);\n-\n- if (this.currentState === \"active\") {\n- // In the case where the app is in the foreground, we will show an\n- // in-app notif\n- this.showInAppNotification(threadID, customNotification.body);\n- } else {\n- // We keep track of what notifs have been rendered for a given thread so\n- // that we can clear them immediately (without waiting for the rescind)\n- // when the user navigates to that thread. Since we can't do this while\n- // the app is closed, we rely on the rescind notif in that case.\n- this.props.dispatchActionPayload(\n- recordAndroidNotificationActionType,\n- {\n- threadID,\n- notifID: customNotification.id,\n- },\n+ handleAndroidMessage(\n+ message,\n+ this.props.dispatch,\n+ this.props.updatesCurrentAsOf,\n+ this.handleAndroidNotificationIfActive,\n);\n}\n+\n+ handleAndroidNotificationIfActive = (\n+ threadID: string,\n+ texts: {| body: string, title: ?string |},\n+ ) => {\n+ if (this.currentState !== \"active\") {\n+ return false;\n}\n+ this.showInAppNotification(threadID, texts.body, texts.title);\n+ return true;\n}\nrender() {\n@@ -723,3 +678,7 @@ const App = (props: {}) =>\n</ErrorBoundary>\n</Provider>;\nAppRegistry.registerComponent('SquadCal', () => App);\n+AppRegistry.registerHeadlessTask(\n+ 'RNFirebaseBackgroundMessage',\n+ () => androidBackgroundMessageTask,\n+);\n"
},
{
"change_type": "MODIFY",
"old_path": "native/chat/message-list.react.js",
"new_path": "native/chat/message-list.react.js",
"diff": "@@ -223,6 +223,12 @@ class MessageList extends React.PureComponent<Props, State> {\nreturn;\n}\nflatListContainer.measure((x, y, width, height, pageX, pageY) => {\n+ if (\n+ height === null || height === undefined ||\n+ pageY === null || pageY === undefined\n+ ) {\n+ return;\n+ }\nthis.setState({ messageListVerticalBounds: { height, y: pageY } });\n});\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "native/navigation/navigation-setup.js",
"new_path": "native/navigation/navigation-setup.js",
"diff": "@@ -18,7 +18,7 @@ import type {\nimport type { AppState } from '../redux/redux-setup';\nimport type { SetSessionPayload } from 'lib/types/session-types';\nimport type { NotificationPressPayload } from 'lib/shared/notif-utils';\n-import type { AndroidNotificationActions } from '../push/android';\n+import type { AndroidNotificationActions } from '../push/reducer';\nimport type { UserInfo } from 'lib/types/user-types';\nimport {\n"
},
{
"change_type": "MODIFY",
"old_path": "native/push/android.js",
"new_path": "native/push/android.js",
"diff": "// @flow\n-import FCM from 'react-native-fcm';\n+import type { Dispatch } from 'lib/types/redux-types';\n+import type { RemoteMessage } from 'react-native-firebase';\n-import {\n- recordAndroidNotificationActionType,\n- clearAndroidNotificationActionType,\n-} from '../redux/action-types';\n+import firebase from 'react-native-firebase';\n+import invariant from 'invariant';\n-async function requestAndroidPushPermissions(): Promise<?string> {\n- const requestResult = await FCM.requestPermissions();\n- if (!requestResult) {\n- return null;\n- }\n- return await FCM.getFCMToken();\n-}\n+import { recordAndroidNotificationActionType } from '../redux/action-types';\n-type RecordAndroidNotificationPayload = {|\n- threadID: string,\n- notifID: string,\n-|};\n+import { saveMessageInfos } from './utils';\n+import { store } from '../redux/redux-setup';\n-type ClearAndroidNotificationPayload = {|\n- threadID: string,\n-|};\n+const androidNotificationChannelID = 'default';\n-export type AndroidNotificationActions =\n- | {|\n- type: \"RECORD_ANDROID_NOTIFICATION\",\n- payload: RecordAndroidNotificationPayload,\n- |} | {|\n- type: \"CLEAR_ANDROID_NOTIFICATION\",\n- payload: ClearAndroidNotificationPayload,\n+type Texts = {|\n+ title: string,\n+ prefix: string,\n+ body: string,\n|};\n+function handleAndroidMessage(\n+ message: RemoteMessage,\n+ dispatch: Dispatch,\n+ updatesCurrentAsOf: number,\n+ handleIfActive?: (\n+ threadID: string,\n+ texts: {| body: string, title: ?string |},\n+ ) => bool,\n+) {\n+ const { data } = message;\n+ const { badge } = data;\n+ if (badge !== undefined && badge !== null) {\n+ firebase.notifications().setBadge(parseInt(badge));\n+ }\n-function reduceThreadIDsToNotifIDs(\n- state: {[threadID: string]: string[]},\n- action: AndroidNotificationActions,\n-): {[threadID: string]: string[]} {\n- if (action.type === recordAndroidNotificationActionType) {\n- const existingNotifIDs = state[action.payload.threadID];\n- let set;\n- if (existingNotifIDs) {\n- set = new Set([...existingNotifIDs, action.payload.notifID]);\n- } else {\n- set = new Set([action.payload.notifID]);\n+ const customNotification = data.custom_notification\n+ ? JSON.parse(data.custom_notification)\n+ : null;\n+ let { messageInfos } = data;\n+ if (!messageInfos && customNotification) {\n+ messageInfos = customNotification.messageInfos;\n}\n- return {\n- ...state,\n- [action.payload.threadID]: [...set],\n- };\n- } else if (action.type === clearAndroidNotificationActionType) {\n- if (!state[action.payload.threadID]) {\n- return state;\n+ if (messageInfos) {\n+ saveMessageInfos(dispatch, messageInfos, updatesCurrentAsOf);\n}\n- for (let notifID of state[action.payload.threadID]) {\n- FCM.removeDeliveredNotification(notifID);\n+\n+ let { rescind, rescindID } = data;\n+ if (!rescind && customNotification) {\n+ ({ rescind, notifID: rescindID } = customNotification);\n}\n- return {\n- ...state,\n- [action.payload.threadID]: [],\n- };\n- } else {\n- return state;\n+ if (rescind) {\n+ invariant(rescindID, \"rescind message without notifID\");\n+ firebase.notifications().removeDeliveredNotification(rescindID);\n+ //TODO remove from Redux as well\n+ return;\n}\n+\n+ let { id, title, prefix, body, threadID } = data;\n+ if (!id && customNotification) {\n+ ({ id, body, threadID } = customNotification);\n+ }\n+ const merged = prefix ? `${prefix} ${body}` : body;\n+\n+ if (handleIfActive) {\n+ const texts = { title, body: merged };\n+ const isActive = handleIfActive(threadID, texts);\n+ if (isActive) {\n+ return;\n+ }\n+ }\n+\n+ const notification = new firebase.notifications.Notification()\n+ .setNotificationId(id)\n+ .setBody(merged)\n+ .setData({ threadID })\n+ .android.setChannelId(androidNotificationChannelID)\n+ .android.setDefaults(firebase.notifications.Android.Defaults.All)\n+ .android.setVibrate(true)\n+ .android.setAutoCancel(true)\n+ .android.setLargeIcon(\"@mipmap/ic_launcher\")\n+ .android.setSmallIcon(\"@drawable/notif_icon\");\n+ if (title) {\n+ notification.setTitle(title);\n+ }\n+ firebase.notifications().displayNotification(notification);\n+\n+ // We keep track of what notifs have been rendered for a given thread so\n+ // that we can clear them immediately (without waiting for the rescind)\n+ // when the user navigates to that thread. Since we can't do this while\n+ // the app is closed, we rely on the rescind notif in that case.\n+ dispatch({\n+ type: recordAndroidNotificationActionType,\n+ payload: { threadID, notifID: id },\n+ });\n+}\n+\n+async function androidBackgroundMessageTask(message: RemoteMessage) {\n+ const { dispatch } = store;\n+ const { updatesCurrentAsOf } = store.getState();\n+ handleAndroidMessage(message, dispatch, updatesCurrentAsOf);\n}\nexport {\n- requestAndroidPushPermissions,\n- reduceThreadIDsToNotifIDs,\n+ androidNotificationChannelID,\n+ handleAndroidMessage,\n+ androidBackgroundMessageTask,\n};\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "native/push/reducer.js",
"diff": "+// @flow\n+\n+import firebase from 'react-native-firebase';\n+\n+import {\n+ recordAndroidNotificationActionType,\n+ clearAndroidNotificationActionType,\n+} from '../redux/action-types';\n+\n+type RecordAndroidNotificationPayload = {|\n+ threadID: string,\n+ notifID: string,\n+|};\n+\n+type ClearAndroidNotificationPayload = {|\n+ threadID: string,\n+|};\n+\n+export type AndroidNotificationActions =\n+ | {|\n+ type: \"RECORD_ANDROID_NOTIFICATION\",\n+ payload: RecordAndroidNotificationPayload,\n+ |} | {|\n+ type: \"CLEAR_ANDROID_NOTIFICATION\",\n+ payload: ClearAndroidNotificationPayload,\n+ |};\n+\n+function reduceThreadIDsToNotifIDs(\n+ state: {[threadID: string]: string[]},\n+ action: AndroidNotificationActions,\n+): {[threadID: string]: string[]} {\n+ if (action.type === recordAndroidNotificationActionType) {\n+ const existingNotifIDs = state[action.payload.threadID];\n+ let set;\n+ if (existingNotifIDs) {\n+ set = new Set([...existingNotifIDs, action.payload.notifID]);\n+ } else {\n+ set = new Set([action.payload.notifID]);\n+ }\n+ return {\n+ ...state,\n+ [action.payload.threadID]: [...set],\n+ };\n+ } else if (action.type === clearAndroidNotificationActionType) {\n+ if (!state[action.payload.threadID]) {\n+ return state;\n+ }\n+ for (let notifID of state[action.payload.threadID]) {\n+ firebase.notifications().removeDeliveredNotification(notifID);\n+ }\n+ return {\n+ ...state,\n+ [action.payload.threadID]: [],\n+ };\n+ } else {\n+ return state;\n+ }\n+}\n+\n+export {\n+ reduceThreadIDsToNotifIDs,\n+};\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "native/push/utils.js",
"diff": "+// @flow\n+\n+import type { Dispatch } from 'lib/types/redux-types';\n+import type { RawMessageInfo } from 'lib/types/message-types';\n+\n+import { saveMessagesActionType } from 'lib/actions/message-actions';\n+\n+function saveMessageInfos(\n+ dispatch: Dispatch,\n+ messageInfosString: string,\n+ updatesCurrentAsOf: number,\n+) {\n+ const messageInfos: $ReadOnlyArray<RawMessageInfo> =\n+ JSON.parse(messageInfosString);\n+ dispatch({\n+ type: saveMessagesActionType,\n+ payload: { rawMessageInfos: messageInfos, updatesCurrentAsOf },\n+ });\n+}\n+\n+export {\n+ saveMessageInfos,\n+};\n"
},
{
"change_type": "MODIFY",
"old_path": "native/redux/redux-setup.js",
"new_path": "native/redux/redux-setup.js",
"diff": "@@ -74,9 +74,7 @@ import {\nreplaceChatRoute,\nresetNavInfoAndEnsureLoggedOutModalPresence,\n} from '../navigation/navigation-setup';\n-import {\n- reduceThreadIDsToNotifIDs,\n-} from '../push/android';\n+import { reduceThreadIDsToNotifIDs } from '../push/reducer';\nimport { persistConfig, setPersistor } from './persist';\nimport {\ndefaultURLPrefix,\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Redo Android notifs code to use react-native-firebase |
129,187 | 17.04.2019 22:52:38 | 14,400 | 11423b6c8df897e471b1c9dfbf231d653a8dc08e | New Android notif format | [
{
"change_type": "MODIFY",
"old_path": "lib/shared/notif-utils.js",
"new_path": "lib/shared/notif-utils.js",
"diff": "@@ -30,30 +30,56 @@ export type NotificationPressPayload = {\nclearChatRoutes: bool,\n};\n-function notifTextForMessageInfo(\n+type NotifTexts = {|\n+ merged: string,\n+ body: string,\n+ title: string,\n+ prefix?: string,\n+|};\n+function notifTextsForMessageInfo(\nmessageInfos: MessageInfo[],\nthreadInfo: ThreadInfo,\n-): string {\n- const fullNotifText = fullNotifTextForMessageInfo(messageInfos, threadInfo);\n- if (fullNotifText.length <= 300) {\n- return fullNotifText;\n+): NotifTexts {\n+ const fullNotifTexts = fullNotifTextsForMessageInfo(messageInfos, threadInfo);\n+ const result: NotifTexts = {\n+ merged: trimNotifText(fullNotifTexts.merged, 300),\n+ body: trimNotifText(fullNotifTexts.body, 300),\n+ title: trimNotifText(fullNotifTexts.title, 100),\n+ };\n+ if (fullNotifTexts.prefix) {\n+ result.prefix = trimNotifText(fullNotifTexts.prefix, 50);\n}\n- return fullNotifText.substr(0, 297) + \"...\";\n+ return result;\n+}\n+\n+function trimNotifText(text: string, maxLength: number): string {\n+ if (text.length <= maxLength) {\n+ return text;\n+ }\n+ return text.substr(0, maxLength - 3) + \"...\";\n}\nconst notifTextForSubthreadCreation = (\ncreator: RelativeUserInfo,\nparentThreadInfo: ThreadInfo,\nchildThreadName: ?string,\n+ childThreadUIName: string,\n) => {\n- let text = `${stringForUser(creator)} created a new thread`;\n+ const prefix = stringForUser(creator);\n+ let body = `created a new thread`;\nif (parentThreadInfo.name) {\n- text += ` in ${parentThreadInfo.name}`;\n+ body += ` in ${parentThreadInfo.name}`;\n}\n+ let merged = `${prefix} ${body}`;\nif (childThreadName) {\n- text += ` called \"${childThreadName}\"`;\n+ merged += ` called \"${childThreadName}\"`;\n}\n- return text;\n+ return {\n+ merged,\n+ body,\n+ title: childThreadUIName,\n+ prefix,\n+ };\n}\nfunction notifThreadName(threadInfo: ThreadInfo): string {\n@@ -88,10 +114,10 @@ function mostRecentMessageInfoType(\nreturn messageInfos[0].type;\n}\n-function fullNotifTextForMessageInfo(\n+function fullNotifTextsForMessageInfo(\nmessageInfos: MessageInfo[],\nthreadInfo: ThreadInfo,\n-): string {\n+): NotifTexts {\nconst mostRecentType = mostRecentMessageInfoType(messageInfos);\nif (mostRecentType === messageTypes.TEXT) {\nconst messageInfo = assertSingleMessageInfo(messageInfos);\n@@ -100,11 +126,20 @@ function fullNotifTextForMessageInfo(\n\"messageInfo should be messageTypes.TEXT!\",\n);\nif (!threadInfo.name && threadIsTwoPersonChat(threadInfo)) {\n- return `${threadInfo.uiName}: ${messageInfo.text}`;\n+ return {\n+ merged: `${threadInfo.uiName}: ${messageInfo.text}`,\n+ body: messageInfo.text,\n+ title: threadInfo.uiName,\n+ };\n} else {\nconst userString = stringForUser(messageInfo.creator);\nconst threadName = notifThreadName(threadInfo);\n- return `${userString} to ${threadName}: ${messageInfo.text}`;\n+ return {\n+ merged: `${userString} to ${threadName}: ${messageInfo.text}`,\n+ body: messageInfo.text,\n+ title: threadInfo.uiName,\n+ prefix: `${userString}:`,\n+ };\n}\n} else if (mostRecentType === messageTypes.CREATE_THREAD) {\nconst messageInfo = assertSingleMessageInfo(messageInfos);\n@@ -118,13 +153,21 @@ function fullNotifTextForMessageInfo(\nmessageInfo.creator,\nparentThreadInfo,\nmessageInfo.initialThreadState.name,\n+ threadInfo.uiName,\n);\n}\n- let text = `${stringForUser(messageInfo.creator)} created a new thread`;\n+ const prefix = stringForUser(messageInfo.creator);\n+ const body = \"created a new thread\";\n+ let merged = `${prefix} ${body}`;\nif (messageInfo.initialThreadState.name) {\n- text += ` called \"${messageInfo.initialThreadState.name}\"`;\n+ merged += ` called \"${messageInfo.initialThreadState.name}\"`;\n}\n- return text;\n+ return {\n+ merged,\n+ body,\n+ title: threadInfo.uiName,\n+ prefix,\n+ };\n} else if (mostRecentType === messageTypes.ADD_MEMBERS) {\nconst addedMembersObject = {};\nfor (let messageInfo of messageInfos) {\n@@ -149,7 +192,12 @@ function fullNotifTextForMessageInfo(\nmergedMessageInfo,\nthreadInfo,\n);\n- return `${robotext} to ${notifThreadName(threadInfo)}`;\n+ const merged = `${robotext} to ${notifThreadName(threadInfo)}`;\n+ return {\n+ merged,\n+ title: threadInfo.uiName,\n+ body: robotext,\n+ };\n} else if (mostRecentType === messageTypes.CREATE_SUB_THREAD) {\nconst messageInfo = assertSingleMessageInfo(messageInfos);\ninvariant(\n@@ -160,6 +208,7 @@ function fullNotifTextForMessageInfo(\nmessageInfo.creator,\nthreadInfo,\nmessageInfo.childThreadInfo.name,\n+ messageInfo.childThreadInfo.uiName,\n);\n} else if (mostRecentType === messageTypes.REMOVE_MEMBERS) {\nconst removedMembersObject = {};\n@@ -185,7 +234,12 @@ function fullNotifTextForMessageInfo(\nmergedMessageInfo,\nthreadInfo,\n);\n- return `${robotext} from ${notifThreadName(threadInfo)}`;\n+ const merged = `${robotext} from ${notifThreadName(threadInfo)}`;\n+ return {\n+ merged,\n+ title: threadInfo.uiName,\n+ body: robotext,\n+ };\n} else if (mostRecentType === messageTypes.CHANGE_ROLE) {\nconst membersObject = {};\nfor (let messageInfo of messageInfos) {\n@@ -210,7 +264,12 @@ function fullNotifTextForMessageInfo(\nmergedMessageInfo,\nthreadInfo,\n);\n- return `${robotext} in ${notifThreadName(threadInfo)}`;\n+ const merged = `${robotext} from ${notifThreadName(threadInfo)}`;\n+ return {\n+ merged,\n+ title: threadInfo.uiName,\n+ body: robotext,\n+ };\n} else if (mostRecentType === messageTypes.LEAVE_THREAD) {\nconst leaverBeavers = {};\nfor (let messageInfo of messageInfos) {\n@@ -223,7 +282,13 @@ function fullNotifTextForMessageInfo(\nconst leavers = values(leaverBeavers);\nconst leaversString = pluralize(leavers.map(stringForUser));\n- return `${leaversString} left ${notifThreadName(threadInfo)}`;\n+ const body = `${leaversString} left`;\n+ const merged = `${body} ${notifThreadName(threadInfo)}`;\n+ return {\n+ merged,\n+ title: threadInfo.uiName,\n+ body,\n+ };\n} else if (mostRecentType === messageTypes.JOIN_THREAD) {\nconst joinerArray = {};\nfor (let messageInfo of messageInfos) {\n@@ -236,7 +301,13 @@ function fullNotifTextForMessageInfo(\nconst joiners = values(joinerArray);\nconst joinersString = pluralize(joiners.map(stringForUser));\n- return `${joinersString} joined ${notifThreadName(threadInfo)}`;\n+ const body = `${joinersString} joined`;\n+ const merged = `${body} ${notifThreadName(threadInfo)}`;\n+ return {\n+ merged,\n+ title: threadInfo.uiName,\n+ body,\n+ };\n} else if (\nmostRecentType === messageTypes.CREATE_ENTRY ||\nmostRecentType === messageTypes.EDIT_ENTRY\n@@ -250,43 +321,80 @@ function fullNotifTextForMessageInfo(\nmessageInfo.type === messageTypes.EDIT_ENTRY,\n\"messageInfo should be messageTypes.EDIT_ENTRY!\",\n);\n- return `${stringForUser(messageInfo.creator)} updated the text of an ` +\n- `event in ${notifThreadName(threadInfo)} scheduled for ` +\n+ const body = `updated the text of an event in ` +\n+ `${notifThreadName(threadInfo)} scheduled for ` +\n`${prettyDate(messageInfo.date)}: \"${messageInfo.text}\"`;\n+ const prefix = stringForUser(messageInfo.creator);\n+ const merged = `${prefix} ${body}`;\n+ return {\n+ merged,\n+ title: threadInfo.uiName,\n+ body,\n+ prefix,\n+ };\n}\ninvariant(\nmessageInfo.type === messageTypes.CREATE_ENTRY ||\nmessageInfo.type === messageTypes.EDIT_ENTRY,\n\"messageInfo should be messageTypes.CREATE_ENTRY/EDIT_ENTRY!\",\n);\n- return `${stringForUser(messageInfo.creator)} created an event in ` +\n- `${notifThreadName(threadInfo)} scheduled for ` +\n- `${prettyDate(messageInfo.date)}: \"${messageInfo.text}\"`;\n+ const prefix = stringForUser(messageInfo.creator);\n+ const body = `created an event in ${notifThreadName(threadInfo)} ` +\n+ `scheduled for ${prettyDate(messageInfo.date)}: \"${messageInfo.text}\"`;\n+ const merged = `${prefix} ${body}`;\n+ return {\n+ merged,\n+ title: threadInfo.uiName,\n+ body,\n+ prefix,\n+ };\n} else if (mostRecentType === messageTypes.DELETE_ENTRY) {\nconst messageInfo = assertSingleMessageInfo(messageInfos);\ninvariant(\nmessageInfo.type === messageTypes.DELETE_ENTRY,\n\"messageInfo should be messageTypes.DELETE_ENTRY!\",\n);\n- return `${stringForUser(messageInfo.creator)} deleted an event in ` +\n- `${notifThreadName(threadInfo)} scheduled for ` +\n- `${prettyDate(messageInfo.date)}: \"${messageInfo.text}\"`;\n+ const prefix = stringForUser(messageInfo.creator);\n+ const body = `deleted an event in ${notifThreadName(threadInfo)} ` +\n+ `scheduled for ${prettyDate(messageInfo.date)}: \"${messageInfo.text}\"`;\n+ const merged = `${prefix} ${body}`;\n+ return {\n+ merged,\n+ title: threadInfo.uiName,\n+ body,\n+ prefix,\n+ };\n} else if (mostRecentType === messageTypes.RESTORE_ENTRY) {\nconst messageInfo = assertSingleMessageInfo(messageInfos);\ninvariant(\nmessageInfo.type === messageTypes.RESTORE_ENTRY,\n\"messageInfo should be messageTypes.RESTORE_ENTRY!\",\n);\n- return `${stringForUser(messageInfo.creator)} restored an event in ` +\n- `${notifThreadName(threadInfo)} scheduled for ` +\n- `${prettyDate(messageInfo.date)}: \"${messageInfo.text}\"`;\n+ const prefix = stringForUser(messageInfo.creator);\n+ const body = `restored an event in ${notifThreadName(threadInfo)} ` +\n+ `scheduled for ${prettyDate(messageInfo.date)}: \"${messageInfo.text}\"`;\n+ const merged = `${prefix} ${body}`;\n+ return {\n+ merged,\n+ title: threadInfo.uiName,\n+ body,\n+ prefix,\n+ };\n} else if (mostRecentType === messageTypes.CHANGE_SETTINGS) {\nconst mostRecentMessageInfo = messageInfos[0];\ninvariant(\nmostRecentMessageInfo.type === messageTypes.CHANGE_SETTINGS,\n\"messageInfo should be messageTypes.CHANGE_SETTINGS!\",\n);\n- return strippedRobotextForMessageInfo(mostRecentMessageInfo, threadInfo);\n+ const body = strippedRobotextForMessageInfo(\n+ mostRecentMessageInfo,\n+ threadInfo,\n+ );\n+ return {\n+ merged: body,\n+ title: threadInfo.uiName,\n+ body,\n+ };\n} else if (mostRecentType === messageTypes.MULTIMEDIA) {\nconst media = [];\nfor (let messageInfo of messageInfos) {\n@@ -300,12 +408,24 @@ function fullNotifTextForMessageInfo(\n}\nconst contentString = contentStringForMediaArray(media);\nconst userString = stringForUser(messageInfos[0].creator);\n+\n+ let body, merged;\nif (!threadInfo.name && threadIsTwoPersonChat(threadInfo)) {\n- return `${userString} sent you ${contentString}`;\n+ body = `sent you ${contentString}`;\n+ merged = body;\n} else {\n+ body = `${userString} send ${contentString}`;\nconst threadName = notifThreadName(threadInfo);\n- return `${userString} send ${contentString} to ${threadName}`;\n+ merged = `${body} to ${threadName}`;\n}\n+ merged = `${userString} ${merged}`;\n+\n+ return {\n+ merged,\n+ body,\n+ title: threadInfo.uiName,\n+ prefix: userString,\n+ };\n} else {\ninvariant(false, `we're not aware of messageType ${mostRecentType}`);\n}\n@@ -375,6 +495,6 @@ function notifCollapseKeyForRawMessageInfo(\nexport {\nnotificationPressActionType,\n- notifTextForMessageInfo,\n+ notifTextsForMessageInfo,\nnotifCollapseKeyForRawMessageInfo,\n};\n"
},
{
"change_type": "MODIFY",
"old_path": "native/push/android.js",
"new_path": "native/push/android.js",
"diff": "@@ -12,6 +12,7 @@ import { saveMessageInfos } from './utils';\nimport { store } from '../redux/redux-setup';\nconst androidNotificationChannelID = 'default';\n+const vibrationSpec = [ 500, 500 ];\ntype Texts = {|\ntitle: string,\n@@ -75,7 +76,7 @@ function handleAndroidMessage(\n.setData({ threadID })\n.android.setChannelId(androidNotificationChannelID)\n.android.setDefaults(firebase.notifications.Android.Defaults.All)\n- .android.setVibrate(true)\n+ .android.setVibrate(vibrationSpec)\n.android.setAutoCancel(true)\n.android.setLargeIcon(\"@mipmap/ic_launcher\")\n.android.setSmallIcon(\"@drawable/notif_icon\");\n"
},
{
"change_type": "MODIFY",
"old_path": "server/src/push/rescind.js",
"new_path": "server/src/push/rescind.js",
"diff": "@@ -10,7 +10,7 @@ async function rescindPushNotifs(\ninputCountCondition?: SQLStatement,\n) {\nconst fetchQuery = SQL`\n- SELECT n.id, n.delivery, n.collapse_key, COUNT(\n+ SELECT n.id, n.delivery, n.collapse_key, n.thread, COUNT(\n`;\nfetchQuery.append(inputCountCondition ? inputCountCondition : SQL`m.thread`);\nfetchQuery.append(SQL`\n@@ -64,10 +64,12 @@ async function rescindPushNotifs(\n));\n} else if (delivery.deviceType === \"android\") {\n// New Android\n- const { deviceTokens } = delivery;\n+ const { deviceTokens, codeVersion } = delivery;\nconst notification = prepareAndroidNotification(\nrow.collapse_key ? row.collapse_key : row.id.toString(),\nrow.unread_count,\n+ row.thread.toString(),\n+ codeVersion,\n);\npromises.push(fcmPush(\nnotification,\n@@ -108,7 +110,10 @@ function prepareIOSNotification(\nfunction prepareAndroidNotification(\nnotifID: string,\nunreadCount: number,\n+ threadID: string,\n+ codeVersion: ?number,\n): Object {\n+ if (!codeVersion || codeVersion < 31) {\nreturn {\ndata: {\nbadge: unreadCount.toString(),\n@@ -119,6 +124,15 @@ function prepareAndroidNotification(\n},\n};\n}\n+ return {\n+ data: {\n+ badge: unreadCount.toString(),\n+ rescind: \"true\",\n+ rescindID: notifID,\n+ threadID,\n+ },\n+ };\n+}\nexport {\nrescindPushNotifs,\n"
},
{
"change_type": "MODIFY",
"old_path": "server/src/push/send.js",
"new_path": "server/src/push/send.js",
"diff": "@@ -21,7 +21,7 @@ import _flow from 'lodash/fp/flow';\nimport _mapValues from 'lodash/fp/mapValues';\nimport _pickBy from 'lodash/fp/pickBy';\n-import { notifTextForMessageInfo } from 'lib/shared/notif-utils';\n+import { notifTextsForMessageInfo } from 'lib/shared/notif-utils';\nimport {\ncreateMessageInfo,\nsortMessageInfoList,\n@@ -184,6 +184,7 @@ async function sendPushNotifs(pushInfo: PushInfo) {\nbadgeOnly,\nunreadCounts[userID],\ndbID,\n+ codeVersion,\n);\ndeliveryPromises.push(sendAndroidNotification(\nnotification,\n@@ -467,8 +468,8 @@ function prepareIOSNotification(\nconst notification = new apn.Notification();\nnotification.topic = \"org.squadcal.app\";\nif (!badgeOnly) {\n- const notifText = notifTextForMessageInfo(allMessageInfos, threadInfo);\n- notification.body = notifText;\n+ const { merged } = notifTextsForMessageInfo(allMessageInfos, threadInfo);\n+ notification.body = merged;\nnotification.sound = \"default\";\n}\nnotification.badge = unreadCount;\n@@ -491,6 +492,7 @@ function prepareAndroidNotification(\nbadgeOnly: bool,\nunreadCount: number,\ndbID: string,\n+ codeVersion: number,\n): Object {\nconst notifID = collapseKey ? collapseKey : dbID;\nif (badgeOnly) {\n@@ -502,24 +504,38 @@ function prepareAndroidNotification(\n},\n};\n}\n+ const { merged, ...rest } =\n+ notifTextsForMessageInfo(allMessageInfos, threadInfo);\n+ const messageInfos = JSON.stringify(newRawMessageInfos);\n+ if (codeVersion < 31) {\nreturn {\ndata: {\nbadge: unreadCount.toString(),\ncustom_notification: JSON.stringify({\nchannel: \"default\",\n- body: notifTextForMessageInfo(allMessageInfos, threadInfo),\n- badgeCount: unreadCount, // TODO: remove this\n+ body: merged,\n+ badgeCount: unreadCount,\nid: notifID,\npriority: \"high\",\nsound: \"default\",\nicon: \"notif_icon\",\nthreadID: threadInfo.id,\n- messageInfos: JSON.stringify(newRawMessageInfos),\n+ messageInfos,\nclick_action: \"fcm.ACTION.HELLO\",\n}),\n}\n};\n}\n+ return {\n+ data: {\n+ badge: unreadCount.toString(),\n+ ...rest,\n+ id: notifID,\n+ threadID: threadInfo.id,\n+ messageInfos,\n+ }\n+ };\n+}\ntype NotificationInfo = {|\ndbID: string,\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | New Android notif format |
129,187 | 17.04.2019 23:06:27 | 14,400 | 988f90b1cdb0609b38d75e65cb725309956c12c3 | [native] clearAndroidNotificationActionType -> clearAndroidNotificationsActionType | [
{
"change_type": "MODIFY",
"old_path": "native/app.react.js",
"new_path": "native/app.react.js",
"diff": "@@ -68,7 +68,7 @@ import {\nimport {\nhandleURLActionType,\nrecordNotifPermissionAlertActionType,\n- clearAndroidNotificationActionType,\n+ clearAndroidNotificationsActionType,\n} from './redux/action-types';\nimport { store, appBecameInactive } from './redux/redux-setup';\nimport ConnectedStatusBar from './connected-status-bar.react';\n@@ -242,7 +242,7 @@ class AppWithNavigationState extends React.PureComponent<Props> {\n);\n} else if (Platform.OS === \"android\") {\nprops.dispatchActionPayload(\n- clearAndroidNotificationActionType,\n+ clearAndroidNotificationsActionType,\n{ threadID: activeThread },\n);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "native/push/reducer.js",
"new_path": "native/push/reducer.js",
"diff": "@@ -4,7 +4,7 @@ import firebase from 'react-native-firebase';\nimport {\nrecordAndroidNotificationActionType,\n- clearAndroidNotificationActionType,\n+ clearAndroidNotificationsActionType,\n} from '../redux/action-types';\ntype RecordAndroidNotificationPayload = {|\n@@ -12,7 +12,7 @@ type RecordAndroidNotificationPayload = {|\nnotifID: string,\n|};\n-type ClearAndroidNotificationPayload = {|\n+type ClearAndroidNotificationsPayload = {|\nthreadID: string,\n|};\n@@ -21,8 +21,8 @@ export type AndroidNotificationActions =\ntype: \"RECORD_ANDROID_NOTIFICATION\",\npayload: RecordAndroidNotificationPayload,\n|} | {|\n- type: \"CLEAR_ANDROID_NOTIFICATION\",\n- payload: ClearAndroidNotificationPayload,\n+ type: \"CLEAR_ANDROID_NOTIFICATIONS\",\n+ payload: ClearAndroidNotificationsPayload,\n|};\nfunction reduceThreadIDsToNotifIDs(\n@@ -41,7 +41,7 @@ function reduceThreadIDsToNotifIDs(\n...state,\n[action.payload.threadID]: [...set],\n};\n- } else if (action.type === clearAndroidNotificationActionType) {\n+ } else if (action.type === clearAndroidNotificationsActionType) {\nif (!state[action.payload.threadID]) {\nreturn state;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "native/redux/action-types.js",
"new_path": "native/redux/action-types.js",
"diff": "@@ -7,6 +7,7 @@ export const recordNotifPermissionAlertActionType =\n\"RECORD_NOTIF_PERMISSION_ALERT\";\nexport const recordAndroidNotificationActionType =\n\"RECORD_ANDROID_NOTIFICATION\";\n-export const clearAndroidNotificationActionType = \"CLEAR_ANDROID_NOTIFICATION\";\n+export const clearAndroidNotificationsActionType =\n+ \"CLEAR_ANDROID_NOTIFICATIONS\";\nexport const updateDimensionsActiveType = \"UPDATE_DIMENSIONS\";\nexport const updateConnectivityActiveType = \"UPDATE_CONNECTIVITY\";\n"
},
{
"change_type": "MODIFY",
"old_path": "native/redux/redux-setup.js",
"new_path": "native/redux/redux-setup.js",
"diff": "@@ -63,7 +63,7 @@ import {\nresetUserStateActionType,\nrecordNotifPermissionAlertActionType,\nrecordAndroidNotificationActionType,\n- clearAndroidNotificationActionType,\n+ clearAndroidNotificationsActionType,\nupdateDimensionsActiveType,\nupdateConnectivityActiveType,\n} from './action-types';\n@@ -173,7 +173,7 @@ function chatRouteFromNavInfo(navInfo: NavInfo): NavigationStateRoute {\nfunction reducer(state: AppState = defaultState, action: *) {\nif (\naction.type === recordAndroidNotificationActionType ||\n- action.type === clearAndroidNotificationActionType\n+ action.type === clearAndroidNotificationsActionType\n) {\nreturn {\n...state,\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] clearAndroidNotificationActionType -> clearAndroidNotificationsActionType |
129,187 | 17.04.2019 23:22:37 | 14,400 | d03c81e3cbfe53f14b47b947110490b7553481c3 | [native] Clear Android notifs from Redux on rescind
Use removeDeliveredNotificationsByTag | [
{
"change_type": "MODIFY",
"old_path": "native/push/android.js",
"new_path": "native/push/android.js",
"diff": "@@ -6,7 +6,10 @@ import type { RemoteMessage } from 'react-native-firebase';\nimport firebase from 'react-native-firebase';\nimport invariant from 'invariant';\n-import { recordAndroidNotificationActionType } from '../redux/action-types';\n+import {\n+ recordAndroidNotificationActionType,\n+ rescindAndroidNotificationActionType,\n+} from '../redux/action-types';\nimport { saveMessageInfos } from './utils';\nimport { store } from '../redux/redux-setup';\n@@ -46,13 +49,22 @@ function handleAndroidMessage(\n}\nlet { rescind, rescindID } = data;\n- if (!rescind && customNotification) {\n+ let rescindActionPayload = null;\n+ if (rescind) {\n+ rescindActionPayload = { notifID: rescindID, threadID: data.threadID };\n+ } else if (customNotification) {\n({ rescind, notifID: rescindID } = customNotification);\n+ rescindActionPayload = { notifID: rescindID };\n}\nif (rescind) {\ninvariant(rescindID, \"rescind message without notifID\");\n- firebase.notifications().removeDeliveredNotification(rescindID);\n- //TODO remove from Redux as well\n+ firebase.notifications().android.removeDeliveredNotificationsByTag(\n+ rescindID,\n+ );\n+ dispatch({\n+ type: rescindAndroidNotificationActionType,\n+ payload: rescindActionPayload,\n+ });\nreturn;\n}\n@@ -74,6 +86,7 @@ function handleAndroidMessage(\n.setNotificationId(id)\n.setBody(merged)\n.setData({ threadID })\n+ .android.setTag(id)\n.android.setChannelId(androidNotificationChannelID)\n.android.setDefaults(firebase.notifications.Android.Defaults.All)\n.android.setVibrate(vibrationSpec)\n"
},
{
"change_type": "MODIFY",
"old_path": "native/push/reducer.js",
"new_path": "native/push/reducer.js",
"diff": "@@ -5,6 +5,7 @@ import firebase from 'react-native-firebase';\nimport {\nrecordAndroidNotificationActionType,\nclearAndroidNotificationsActionType,\n+ rescindAndroidNotificationActionType,\n} from '../redux/action-types';\ntype RecordAndroidNotificationPayload = {|\n@@ -16,6 +17,11 @@ type ClearAndroidNotificationsPayload = {|\nthreadID: string,\n|};\n+type RescindAndroidNotificationPayload = {|\n+ notifID: string,\n+ threadID?: string,\n+|};\n+\nexport type AndroidNotificationActions =\n| {|\ntype: \"RECORD_ANDROID_NOTIFICATION\",\n@@ -23,6 +29,9 @@ export type AndroidNotificationActions =\n|} | {|\ntype: \"CLEAR_ANDROID_NOTIFICATIONS\",\npayload: ClearAndroidNotificationsPayload,\n+ |} | {|\n+ type: \"RESCIND_ANDROID_NOTIFICATION\",\n+ payload: RescindAndroidNotificationPayload,\n|};\nfunction reduceThreadIDsToNotifIDs(\n@@ -46,12 +55,35 @@ function reduceThreadIDsToNotifIDs(\nreturn state;\n}\nfor (let notifID of state[action.payload.threadID]) {\n- firebase.notifications().removeDeliveredNotification(notifID);\n+ firebase.notifications().android.removeDeliveredNotificationsByTag(\n+ notifID,\n+ );\n}\nreturn {\n...state,\n[action.payload.threadID]: [],\n};\n+ } else if (action.type === rescindAndroidNotificationActionType) {\n+ const { threadID, notifID } = action.payload;\n+ if (threadID) {\n+ const existingNotifIDs = state[threadID];\n+ if (!existingNotifIDs) {\n+ return state;\n+ }\n+ const filtered = existingNotifIDs.filter(id => id !== notifID);\n+ if (filtered.length === existingNotifIDs.length) {\n+ return state;\n+ }\n+ return { ...state, [threadID]: filtered };\n+ }\n+ for (let candThreadID in state) {\n+ const existingNotifIDs = state[candThreadID];\n+ const filtered = existingNotifIDs.filter(id => id !== notifID);\n+ if (filtered.length !== existingNotifIDs.length) {\n+ return { ...state, [candThreadID]: filtered };\n+ }\n+ }\n+ return state;\n} else {\nreturn state;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "native/redux/action-types.js",
"new_path": "native/redux/action-types.js",
"diff": "@@ -9,5 +9,7 @@ export const recordAndroidNotificationActionType =\n\"RECORD_ANDROID_NOTIFICATION\";\nexport const clearAndroidNotificationsActionType =\n\"CLEAR_ANDROID_NOTIFICATIONS\";\n+export const rescindAndroidNotificationActionType =\n+ \"RESCIND_ANDROID_NOTIFICATION\";\nexport const updateDimensionsActiveType = \"UPDATE_DIMENSIONS\";\nexport const updateConnectivityActiveType = \"UPDATE_CONNECTIVITY\";\n"
},
{
"change_type": "MODIFY",
"old_path": "native/redux/redux-setup.js",
"new_path": "native/redux/redux-setup.js",
"diff": "@@ -64,6 +64,7 @@ import {\nrecordNotifPermissionAlertActionType,\nrecordAndroidNotificationActionType,\nclearAndroidNotificationsActionType,\n+ rescindAndroidNotificationActionType,\nupdateDimensionsActiveType,\nupdateConnectivityActiveType,\n} from './action-types';\n@@ -173,7 +174,8 @@ function chatRouteFromNavInfo(navInfo: NavInfo): NavigationStateRoute {\nfunction reducer(state: AppState = defaultState, action: *) {\nif (\naction.type === recordAndroidNotificationActionType ||\n- action.type === clearAndroidNotificationsActionType\n+ action.type === clearAndroidNotificationsActionType ||\n+ action.type === rescindAndroidNotificationActionType\n) {\nreturn {\n...state,\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Clear Android notifs from Redux on rescind
Use removeDeliveredNotificationsByTag |
129,187 | 18.04.2019 03:25:09 | 14,400 | 7290edb176c37b63db0d1464c15455543ca5320e | [native] Handle already-rehydrated app start
Can get rehydrated by our new notif background task. | [
{
"change_type": "MODIFY",
"old_path": "native/account/logged-out-modal.react.js",
"new_path": "native/account/logged-out-modal.react.js",
"diff": "@@ -227,6 +227,9 @@ class LoggedOutModal extends React.PureComponent<Props, State> {\ncomponentDidMount() {\nthis.mounted = true;\n+ if (this.props.rehydrateConcluded) {\n+ this.onInitialAppLoad();\n+ }\nif (this.props.isForeground) {\nthis.onForeground();\n}\n@@ -239,13 +242,13 @@ class LoggedOutModal extends React.PureComponent<Props, State> {\n}\n}\n- componentWillReceiveProps(nextProps: Props) {\n- if (!this.props.rehydrateConcluded && nextProps.rehydrateConcluded) {\n- this.onInitialAppLoad(nextProps);\n+ componentDidUpdate(prevProps: Props) {\n+ if (!prevProps.rehydrateConcluded && this.props.rehydrateConcluded) {\n+ this.onInitialAppLoad();\n}\n- if (!this.props.isForeground && nextProps.isForeground) {\n+ if (!prevProps.isForeground && this.props.isForeground) {\nthis.onForeground();\n- } else if (this.props.isForeground && !nextProps.isForeground) {\n+ } else if (prevProps.isForeground && !this.props.isForeground) {\nthis.onBackground();\n}\n}\n@@ -270,14 +273,14 @@ 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(nextProps: Props) {\n+ async onInitialAppLoad() {\nif (!initialAppLoad) {\nreturn;\n}\ninitialAppLoad = false;\n- let { cookie } = nextProps;\n- const { urlPrefix } = nextProps;\n+ let { cookie } = this.props;\n+ const { urlPrefix } = this.props;\nconst showPrompt = () => {\nthis.nextMode = \"prompt\";\nthis.guardedSetState({ mode: \"prompt\" });\n@@ -292,10 +295,10 @@ class LoggedOutModal extends React.PureComponent<Props, State> {\n};\n// If we're not logged in, try native credentials\n- if (!nextProps.loggedIn && (!cookie || !cookie.startsWith(\"user=\"))) {\n+ if (!this.props.loggedIn && (!cookie || !cookie.startsWith(\"user=\"))) {\n// If this succeeds it will dispatch LOG_IN_SUCCESS\nconst sessionChange = await fetchNewCookieFromNativeCredentials(\n- nextProps.dispatch,\n+ this.props.dispatch,\ncookie,\nurlPrefix,\nappStartNativeCredentialsAutoLogIn,\n@@ -312,14 +315,14 @@ class LoggedOutModal extends React.PureComponent<Props, State> {\n}\n// Are we possibly already logged in?\n- if (nextProps.loggedIn) {\n+ if (this.props.loggedIn) {\nif (cookie && cookie.startsWith(\"user=\")) {\n- nextProps.dispatchActionPayload(navigateToAppActionType, null);\n+ this.props.dispatchActionPayload(navigateToAppActionType, null);\nreturn;\n}\n// This is an unusual error state that should never happen\nconst sessionChange = await fetchNewCookieFromNativeCredentials(\n- nextProps.dispatch,\n+ this.props.dispatch,\ncookie,\nurlPrefix,\nappStartReduxLoggedInButInvalidCookie,\n@@ -339,7 +342,7 @@ class LoggedOutModal extends React.PureComponent<Props, State> {\n// We are here either because the user cookie exists but Redux says we're\n// not logged in, or because Redux says we're logged in but we don't have\n// a user cookie and we failed to acquire one above\n- nextProps.dispatchActionPayload(resetUserStateActionType, null);\n+ this.props.dispatchActionPayload(resetUserStateActionType, null);\n}\nhardwareBack = () => {\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Handle already-rehydrated app start
Can get rehydrated by our new notif background task. |
129,187 | 19.04.2019 11:46:05 | 14,400 | 0c77da6625fe51e4017a9b88749e2b5d6de543e2 | [native] Update react-navigation libdefs | [
{
"change_type": "MODIFY",
"old_path": "native/flow-typed/npm/@react-navigation/core_v3.x.x.js",
"new_path": "native/flow-typed/npm/@react-navigation/core_v3.x.x.js",
"diff": "-// flow-typed signature: f5d242f3c2446176504c0f649d8c4462\n-// flow-typed version: 976d0874e7/@react-navigation/core_v3.x.x/flow_>=v0.92.x\n+// flow-typed signature: 1a85d16913294aecaee52c990040615d\n+// flow-typed version: 96ddcb844e/@react-navigation/core_v3.x.x/flow_>=v0.92.x\n// @flow\n"
},
{
"change_type": "MODIFY",
"old_path": "native/flow-typed/npm/react-navigation_v3.x.x.js",
"new_path": "native/flow-typed/npm/react-navigation_v3.x.x.js",
"diff": "-// flow-typed signature: fad292a382a5b9892d474559e913d83e\n-// flow-typed version: 976d0874e7/react-navigation_v3.x.x/flow_>=v0.92.x\n+// flow-typed signature: 75f886cf5a1707c87517fb87387dbfa8\n+// flow-typed version: 96ddcb844e/react-navigation_v3.x.x/flow_>=v0.92.x\n// @flow\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Update react-navigation libdefs |
129,187 | 19.04.2019 21:38:25 | 14,400 | cabf0bf0fca73a2605c65ca4b2bd8217911b699f | [native] Fix up SplashActivity to work with react-native-firebase | [
{
"change_type": "MODIFY",
"old_path": "native/android/app/src/main/AndroidManifest.xml",
"new_path": "native/android/app/src/main/AndroidManifest.xml",
"diff": "</activity>\n<activity\nandroid:name=\".SplashActivity\"\n+ android:launchMode=\"singleTop\"\nandroid:theme=\"@style/SplashTheme\"\nandroid:label=\"@string/app_name\"\n>\n"
},
{
"change_type": "MODIFY",
"old_path": "native/android/app/src/main/java/org/squadcal/SplashActivity.java",
"new_path": "native/android/app/src/main/java/org/squadcal/SplashActivity.java",
"diff": "@@ -9,12 +9,21 @@ public class SplashActivity extends AppCompatActivity {\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\nsuper.onCreate(savedInstanceState);\n+ forwardIntent(this.getIntent());\n+ }\n- Intent intent = new Intent(this, MainActivity.class);\n- intent.putExtras(this.getIntent());\n+ @Override\n+ public void onNewIntent(Intent intent) {\n+ super.onNewIntent(intent);\n+ setIntent(intent);\n+ forwardIntent(intent);\n+ }\n- startActivity(intent);\n+ private void forwardIntent(Intent intent) {\n+ Intent mainIntent = new Intent(this, MainActivity.class);\n+ mainIntent.putExtras(intent);\nfinish();\n+ startActivity(mainIntent);\n}\n}\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Fix up SplashActivity to work with react-native-firebase |
129,187 | 22.04.2019 15:41:36 | 14,400 | 72c7859171b86d2155e05675177393958df3a20f | [lib] Don't overwrite Redux nextLocalID if highest localID is lower | [
{
"change_type": "MODIFY",
"old_path": "lib/reducers/local-id-reducer.js",
"new_path": "lib/reducers/local-id-reducer.js",
"diff": "@@ -20,6 +20,13 @@ export default function reduceNextLocalID(state: number, action: BaseAction) {\nlet newCandidate = null;\nif (action.type === rehydrateActionType) {\nnewCandidate = highestLocalIDSelector(action.payload) + 1;\n+ if (\n+ action.payload &&\n+ action.payload.nextLocalID &&\n+ action.payload.nextLocalID > newCandidate\n+ ) {\n+ newCandidate = action.payload.nextLocalID;\n+ }\n} else if (\naction.type === sendTextMessageActionTypes.started ||\naction.type === sendMultimediaMessageActionTypes.started ||\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/reducers/message-reducer.js",
"new_path": "lib/reducers/message-reducer.js",
"diff": "@@ -670,12 +670,13 @@ function reduceMessageStore(\n// If somehow the serverID got in there already, we'll just update the\n// serverID message and scrub the localID one\nnewMessages = _omitBy(\n- (messageInfo: RawMessageInfo) => messageInfo.type === 0 &&\n+ (messageInfo: RawMessageInfo) =>\n+ messageInfo.type === messageTypes.TEXT &&\n!messageInfo.id &&\nmessageInfo.localID === payload.localID,\n)(messageStore.messages);\n} else if (messageStore.messages[payload.localID]) {\n- // The normal case, the localID message gets replaces by the serverID one\n+ // The normal case, the localID message gets replaced by the serverID one\nnewMessages = _mapKeys(replaceMessageKey)(messageStore.messages);\n} else {\n// Well this is weird, we probably got deauthorized between when the\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/selectors/local-id-selectors.js",
"new_path": "lib/selectors/local-id-selectors.js",
"diff": "// @flow\nimport type { BaseAppState } from '../types/redux-types';\n-import { messageTypes } from '../types/message-types';\nimport invariant from 'invariant';\n@@ -13,16 +12,16 @@ function numberFromLocalID(localID: string) {\nreturn parseInt(matches[1]);\n}\n-function highestLocalIDSelector(state: BaseAppState<*>): number {\n+function highestLocalIDSelector(state: ?BaseAppState<*>): number {\nlet highestLocalIDFound = -1;\nif (state && state.messageStore) {\nfor (let messageKey in state.messageStore.messages) {\nconst messageInfo = state.messageStore.messages[messageKey];\n- if (messageInfo.type !== messageTypes.TEXT) {\n+ if (!messageInfo.localID) {\ncontinue;\n}\n- const localID = messageInfo.localID;\n+ const { localID } = messageInfo;\nif (!localID) {\ncontinue;\n}\n@@ -35,7 +34,7 @@ function highestLocalIDSelector(state: BaseAppState<*>): number {\nif (state && state.entryStore) {\nfor (let entryKey in state.entryStore.entryInfos) {\n- const localID = state.entryStore.entryInfos[entryKey].localID;\n+ const { localID } = state.entryStore.entryInfos[entryKey];\nif (!localID) {\ncontinue;\n}\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [lib] Don't overwrite Redux nextLocalID if highest localID is lower |
129,187 | 22.04.2019 16:39:45 | 14,400 | 1ebd4eb0a0afaadf6a8eee3298f7ae80a9e3f3e8 | [web] Fix AccountBar expanding header issue | [
{
"change_type": "MODIFY",
"old_path": "web/account-bar.react.js",
"new_path": "web/account-bar.react.js",
"diff": "@@ -19,7 +19,7 @@ import UserSettingsModal from './modals/account/user-settings-modal.react.js';\nimport { UpCaret, DownCaret } from './vectors.react';\nimport { htmlTargetFromEvent } from './vector-utils';\n-type Props = {\n+type Props = {|\nsetModal: (modal: ?React.Node) => void,\n// Redux state\nloggedIn: bool,\n@@ -28,21 +28,23 @@ type Props = {\ndispatchActionPromise: DispatchActionPromise,\n// async functions that hit server APIs\nlogOut: () => Promise<LogOutResult>,\n-};\n-type State = {\n+|};\n+type State = {|\nexpanded: bool,\n-}\n-\n+|};\nclass AccountBar extends React.PureComponent<Props, State> {\n- menu: ?HTMLDivElement;\n-\n- constructor(props: Props) {\n- super(props);\n- this.state = {\n+ static propTypes = {\n+ setModal: PropTypes.func.isRequired,\n+ loggedIn: PropTypes.bool.isRequired,\n+ username: PropTypes.string,\n+ dispatchActionPromise: PropTypes.func.isRequired,\n+ logOut: PropTypes.func.isRequired,\n+ };\n+ state = {\nexpanded: false,\n};\n- }\n+ menu: ?HTMLDivElement;\ncomponentDidUpdate(prevProps: Props, prevState: State) {\nif (this.state.expanded && !prevState.expanded) {\n@@ -163,13 +165,6 @@ class AccountBar extends React.PureComponent<Props, State> {\n}\n-AccountBar.propTypes = {\n- setModal: PropTypes.func.isRequired,\n- loggedIn: PropTypes.bool.isRequired,\n- username: PropTypes.string,\n- dispatchActionPromise: PropTypes.func.isRequired,\n-};\n-\nexport default connect(\n(state: AppState) => ({\nloggedIn: !!(state.currentUserInfo &&\n"
},
{
"change_type": "MODIFY",
"old_path": "web/style.css",
"new_path": "web/style.css",
"diff": "@@ -53,6 +53,7 @@ header.header {\nbackground-image: url(../images/background.png);\nbackground-size: 3000px 2000px;\nbackground-attachment: fixed;\n+ z-index: 1;\n}\ndiv.main-header {\nfont-family: 'Anaheim', sans-serif;\n@@ -127,7 +128,9 @@ div.main-content {\n}\ndiv.upper-right {\n- float: right;\n+ position: absolute;\n+ top: 0;\n+ right: 0;\npadding: 15px 16px;\n}\nspan.loading-indicator-loading {\n@@ -199,11 +202,9 @@ div.account-bar {\nfont-weight: 600;\npadding: 0 6px;\ncursor: pointer;\n- float: right;\n}\ndiv.account-button {\npadding: 3px 4px 3px 8px;\n- font-size: 0;\n}\ndiv.account-button > span {\nfont-size: 16px;\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [web] Fix AccountBar expanding header issue |
129,187 | 22.04.2019 17:37:36 | 14,400 | 24c4a0a54999a8600895912431051e9437646a74 | [native] Avoid react-native-firebase on iOS | [
{
"change_type": "MODIFY",
"old_path": "native/app.react.js",
"new_path": "native/app.react.js",
"diff": "@@ -46,7 +46,6 @@ import invariant from 'invariant';\nimport PropTypes from 'prop-types';\nimport NotificationsIOS from 'react-native-notifications';\nimport InAppNotification from 'react-native-in-app-notification';\n-import firebase from 'react-native-firebase';\nimport SplashScreen from 'react-native-splash-screen';\nimport Orientation from 'react-native-orientation-locker';\n@@ -85,6 +84,7 @@ import {\nhandleAndroidMessage,\nandroidBackgroundMessageTask,\n} from './push/android';\n+import { getFirebase } from './push/firebase';\nimport { saveMessageInfos } from './push/utils';\nimport NotificationBody from './push/notification-body.react';\nimport ErrorBoundary from './error-boundary.react';\n@@ -194,6 +194,7 @@ class AppWithNavigationState extends React.PureComponent<Props> {\nthis.iosNotificationOpened,\n);\n} else if (Platform.OS === \"android\") {\n+ const firebase = getFirebase();\nconst channel = new firebase.notifications.Android.Channel(\nandroidNotificationChannelID,\n'Default',\n@@ -225,7 +226,7 @@ class AppWithNavigationState extends React.PureComponent<Props> {\nif (Platform.OS === \"ios\") {\nNotificationsIOS.setBadgesCount(unreadCount);\n} else if (Platform.OS === \"android\") {\n- firebase.notifications().setBadge(unreadCount);\n+ getFirebase().notifications().setBadge(unreadCount);\n}\n}\n@@ -384,6 +385,7 @@ class AppWithNavigationState extends React.PureComponent<Props> {\n}\nasync ensureAndroidPushNotifsEnabled() {\n+ const firebase = getFirebase();\nconst hasPermission = await firebase.messaging().hasPermission();\nif (!hasPermission) {\ntry {\n@@ -413,7 +415,7 @@ class AppWithNavigationState extends React.PureComponent<Props> {\n}\nthis.initialAndroidNotifHandled = true;\nconst initialNotif =\n- await firebase.notifications().getInitialNotification();\n+ await getFirebase().notifications().getInitialNotification();\nif (initialNotif) {\nawait this.androidNotificationOpened(initialNotif);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "native/push/android.js",
"new_path": "native/push/android.js",
"diff": "import type { Dispatch } from 'lib/types/redux-types';\nimport type { RemoteMessage } from 'react-native-firebase';\n-import firebase from 'react-native-firebase';\nimport invariant from 'invariant';\nimport {\nrecordAndroidNotificationActionType,\nrescindAndroidNotificationActionType,\n} from '../redux/action-types';\n+import { getFirebase } from './firebase';\nimport { saveMessageInfos } from './utils';\nimport { store } from '../redux/redux-setup';\n@@ -31,6 +31,7 @@ function handleAndroidMessage(\ntexts: {| body: string, title: ?string |},\n) => bool,\n) {\n+ const firebase = getFirebase();\nconst { data } = message;\nconst { badge } = data;\nif (badge !== undefined && badge !== null) {\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "native/push/firebase.js",
"diff": "+// @flow\n+\n+import invariant from 'invariant';\n+import { Platform } from 'react-native';\n+\n+// Will crash if not Android\n+let cachedFirebase = null;\n+function getFirebase() {\n+ if (cachedFirebase !== null) {\n+ return cachedFirebase;\n+ }\n+ invariant(\n+ Platform.OS === \"android\",\n+ \"react-native-firebase only used on Android at the moment\",\n+ );\n+ cachedFirebase = require('react-native-firebase');\n+ return cachedFirebase;\n+}\n+\n+export {\n+ getFirebase,\n+};\n"
},
{
"change_type": "MODIFY",
"old_path": "native/push/reducer.js",
"new_path": "native/push/reducer.js",
"diff": "// @flow\n-import firebase from 'react-native-firebase';\n-\nimport {\nrecordAndroidNotificationActionType,\nclearAndroidNotificationsActionType,\nrescindAndroidNotificationActionType,\n} from '../redux/action-types';\n+import { getFirebase } from './firebase';\ntype RecordAndroidNotificationPayload = {|\nthreadID: string,\n@@ -55,7 +54,7 @@ function reduceThreadIDsToNotifIDs(\nreturn state;\n}\nfor (let notifID of state[action.payload.threadID]) {\n- firebase.notifications().android.removeDeliveredNotificationsByTag(\n+ getFirebase().notifications().android.removeDeliveredNotificationsByTag(\nnotifID,\n);\n}\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Avoid react-native-firebase on iOS |
129,187 | 22.04.2019 22:49:24 | 14,400 | 358a1c5229c7ac361d618e2658b4194a4e2e2527 | [native] Handle updateCalendarQuery error in Calendar | [
{
"change_type": "MODIFY",
"old_path": "native/calendar/calendar.react.js",
"new_path": "native/calendar/calendar.react.js",
"diff": "@@ -23,6 +23,10 @@ import {\ncalendarFilterPropType,\n} from 'lib/types/filter-types';\nimport { type Dimensions, dimensionsPropType } from 'lib/types/media-types';\n+import {\n+ type LoadingStatus,\n+ loadingStatusPropType,\n+} from 'lib/types/loading-types';\nimport React from 'react';\nimport {\n@@ -58,7 +62,7 @@ import {\nupdateCalendarQuery,\n} from 'lib/actions/entry-actions';\nimport { connect } from 'lib/utils/redux-utils';\n-import { registerFetchKey } from 'lib/reducers/loading-reducer';\n+import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors';\nimport { Entry, InternalEntry, entryStyles } from './entry.react';\nimport {\n@@ -127,6 +131,7 @@ type Props = {\ncalendarFilters: $ReadOnlyArray<CalendarFilter>,\ndimensions: Dimensions,\ncontentVerticalOffset: number,\n+ loadingStatus: LoadingStatus,\n// Redux dispatch functions\ndispatchActionPromise: DispatchActionPromise,\n// async functions that hit server APIs\n@@ -173,6 +178,7 @@ class InnerCalendar extends React.PureComponent<Props, State> {\ncalendarFilters: PropTypes.arrayOf(calendarFilterPropType).isRequired,\ndimensions: dimensionsPropType.isRequired,\ncontentVerticalOffset: PropTypes.number.isRequired,\n+ loadingStatus: loadingStatusPropType.isRequired,\ndispatchActionPromise: PropTypes.func.isRequired,\nupdateCalendarQuery: PropTypes.func.isRequired,\n};\n@@ -200,7 +206,6 @@ class InnerCalendar extends React.PureComponent<Props, State> {\ncurrentState: ?string = NativeAppState.currentState;\nlastForegrounded = 0;\nlastCalendarReset = 0;\n- loadingFromScroll = false;\ncurrentScrollPosition: ?number = null;\n// We don't always want an extraData update to trigger a state update, so we\n// cache the most recent value as a member here\n@@ -216,6 +221,9 @@ class InnerCalendar extends React.PureComponent<Props, State> {\nkeyboardDidDismissListener: ?Object;\nkeyboardShownHeight: ?number = null;\nkeyboardPartiallyVisible = false;\n+ // If the query fails, we try it again\n+ topLoadingFromScroll: ?CalendarQuery = null;\n+ bottomLoadingFromScroll: ?CalendarQuery = null;\n// We wait until the loaders leave view before letting them be triggered again\ntopLoaderWaitingToLeaveView = true;\nbottomLoaderWaitingToLeaveView = true;\n@@ -411,6 +419,26 @@ class InnerCalendar extends React.PureComponent<Props, State> {\n}\ncomponentDidUpdate(prevProps: Props, prevState: State) {\n+ if (\n+ this.props.loadingStatus === \"error\" &&\n+ prevProps.loadingStatus === \"loading\"\n+ ) {\n+ if (this.topLoadingFromScroll) {\n+ if (this.topLoaderWaitingToLeaveView) {\n+ this.dispatchCalendarQueryUpdate(this.topLoadingFromScroll);\n+ } else {\n+ this.topLoadingFromScroll = null;\n+ }\n+ }\n+ if (this.bottomLoadingFromScroll) {\n+ if (this.bottomLoaderWaitingToLeaveView) {\n+ this.dispatchCalendarQueryUpdate(this.bottomLoadingFromScroll);\n+ } else {\n+ this.bottomLoadingFromScroll = null;\n+ }\n+ }\n+ }\n+\nconst lastLDWH = prevState.listDataWithHeights;\nconst newLDWH = this.state.listDataWithHeights;\nif (!lastLDWH || !newLDWH) {\n@@ -419,7 +447,8 @@ class InnerCalendar extends React.PureComponent<Props, State> {\nconst { lastStartDate, newStartDate, lastEndDate, newEndDate }\n= InnerCalendar.datesFromListData(lastLDWH, newLDWH);\nif (newStartDate < lastStartDate || newEndDate > lastEndDate) {\n- this.loadingFromScroll = false;\n+ this.topLoadingFromScroll = null;\n+ this.bottomLoadingFromScroll = null;\n}\nconst { keyboardShownHeight, lastEntryKeyActive } = this;\n@@ -987,15 +1016,14 @@ class InnerCalendar extends React.PureComponent<Props, State> {\n};\nconst topLoader = _find({ key: \"TopLoader\" })(info.viewableItems);\n- const bottomLoader = _find({ key: \"BottomLoader\" })(info.viewableItems);\n- if (!this.loadingFromScroll) {\nif (this.topLoaderWaitingToLeaveView && !topLoader) {\nthis.topLoaderWaitingToLeaveView = false;\n}\n+\n+ const bottomLoader = _find({ key: \"BottomLoader\" })(info.viewableItems);\nif (this.bottomLoaderWaitingToLeaveView && !bottomLoader) {\nthis.bottomLoaderWaitingToLeaveView = false;\n}\n- }\nif (\n!this.state.readyToShowList &&\n@@ -1009,30 +1037,45 @@ class InnerCalendar extends React.PureComponent<Props, State> {\n});\n}\n- let startDate = null, endDate = null;\n- if (topLoader && !this.topLoaderWaitingToLeaveView) {\n+ if (\n+ topLoader &&\n+ !this.topLoaderWaitingToLeaveView &&\n+ !this.topLoadingFromScroll\n+ ) {\nthis.topLoaderWaitingToLeaveView = true;\nconst start = dateFromString(this.props.startDate);\nstart.setDate(start.getDate() - 31);\n- startDate = dateString(start);\n- endDate = this.props.endDate;\n- } else if (bottomLoader && !this.bottomLoaderWaitingToLeaveView) {\n+ const startDate = dateString(start);\n+ const endDate = this.props.endDate;\n+ this.topLoadingFromScroll = {\n+ startDate,\n+ endDate,\n+ filters: this.props.calendarFilters,\n+ };\n+ this.dispatchCalendarQueryUpdate(this.topLoadingFromScroll);\n+ } else if (\n+ bottomLoader &&\n+ !this.bottomLoaderWaitingToLeaveView &&\n+ !this.bottomLoadingFromScroll\n+ ) {\nthis.bottomLoaderWaitingToLeaveView = true;\nconst end = dateFromString(this.props.endDate);\nend.setDate(end.getDate() + 31);\n- endDate = dateString(end);\n- startDate = this.props.startDate;\n- } else {\n- return;\n- }\n- this.loadingFromScroll = true;\n- this.props.dispatchActionPromise(\n- updateCalendarQueryActionTypes,\n- this.props.updateCalendarQuery({\n+ const endDate = dateString(end);\n+ const startDate = this.props.startDate;\n+ this.bottomLoadingFromScroll = {\nstartDate,\nendDate,\nfilters: this.props.calendarFilters,\n- }),\n+ };\n+ this.dispatchCalendarQueryUpdate(this.bottomLoadingFromScroll);\n+ }\n+ }\n+\n+ dispatchCalendarQueryUpdate(calendarQuery: CalendarQuery) {\n+ this.props.dispatchActionPromise(\n+ updateCalendarQueryActionTypes,\n+ this.props.updateCalendarQuery(calendarQuery),\n);\n}\n@@ -1117,8 +1160,9 @@ const styles = StyleSheet.create({\n},\n});\n-registerFetchKey(updateCalendarQueryActionTypes);\n-\n+const loadingStatusSelector = createLoadingStatusSelector(\n+ updateCalendarQueryActionTypes,\n+);\nconst activeTabSelector = createActiveTabSelector(CalendarRouteName);\nconst activeThreadPickerSelector =\ncreateIsForegroundSelector(ThreadPickerModalRouteName);\n@@ -1133,6 +1177,7 @@ const Calendar = connect(\ncalendarFilters: state.calendarFilters,\ndimensions: dimensionsSelector(state),\ncontentVerticalOffset: contentVerticalOffsetSelector(state),\n+ loadingStatus: loadingStatusSelector(state),\n}),\n{ updateCalendarQuery },\n)(InnerCalendar);\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Handle updateCalendarQuery error in Calendar |
129,187 | 23.04.2019 00:06:28 | 14,400 | 3fbe209e8eaba1e6ea3bff0b72edc881934a3f54 | [server] Fix legacy call in rescind prepareAndroidNotification | [
{
"change_type": "MODIFY",
"old_path": "server/src/push/rescind.js",
"new_path": "server/src/push/rescind.js",
"diff": "@@ -45,6 +45,8 @@ async function rescindPushNotifs(\nconst notification = prepareAndroidNotification(\nrow.collapse_key ? row.collapse_key : row.id.toString(),\nrow.unread_count,\n+ row.thread.toString(),\n+ null,\n);\npromises.push(fcmPush(\nnotification,\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [server] Fix legacy call in rescind prepareAndroidNotification |
129,187 | 23.04.2019 00:08:28 | 14,400 | 034e0a158a22beec9cd70ecb479c430149db477a | [native] codeVersion -> 31 | [
{
"change_type": "MODIFY",
"old_path": "native/android/app/build.gradle",
"new_path": "native/android/app/build.gradle",
"diff": "@@ -113,8 +113,8 @@ android {\napplicationId \"org.squadcal\"\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 30\n- versionName \"0.0.30\"\n+ versionCode 31\n+ versionName \"0.0.31\"\n}\nsplits {\nabi {\n"
},
{
"change_type": "MODIFY",
"old_path": "native/ios/SquadCal/Info.plist",
"new_path": "native/ios/SquadCal/Info.plist",
"diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>0.0.30</string>\n+ <string>0.0.31</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>30</string>\n+ <string>31</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": "@@ -142,7 +142,7 @@ const persistConfig = {\nmigrate: createMigrate(migrations, { debug: __DEV__ }),\n};\n-const codeVersion = 30;\n+const codeVersion = 31;\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 -> 31 |
129,187 | 23.04.2019 10:53:03 | 14,400 | 2c9c4ed9ed475f747f258682456a7e4baa3147a8 | [lib] Fix REHYDRATE action payload type to be optional | [
{
"change_type": "MODIFY",
"old_path": "lib/types/redux-types.js",
"new_path": "lib/types/redux-types.js",
"diff": "@@ -414,7 +414,7 @@ export type BaseAction =\nloadingInfo: LoadingInfo,\n|} | {|\ntype: \"persist/REHYDRATE\",\n- payload: BaseAppState<*>,\n+ payload: ?BaseAppState<*>,\n|} | {|\ntype: \"FETCH_MESSAGES_BEFORE_CURSOR_STARTED\",\npayload?: void,\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [lib] Fix REHYDRATE action payload type to be optional |
129,187 | 23.04.2019 12:22:31 | 14,400 | 3de6ba857335d6451b223768fd165b61201fd39d | [native] CocoaPods | [
{
"change_type": "MODIFY",
"old_path": "native/.gitignore",
"new_path": "native/.gitignore",
"diff": "@@ -21,6 +21,7 @@ DerivedData\n*.ipa\n*.xcuserstate\nproject.xcworkspace\n+Pods/\n# Android/IntelliJ\n#\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "native/ios/Podfile",
"diff": "+# Uncomment the next line to define a global platform for your project\n+# platform :ios, '9.0'\n+\n+target 'SquadCal' do\n+ # Uncomment the next line if you're using Swift or would like to use dynamic frameworks\n+ # use_frameworks!\n+\n+ # Pods for SquadCal\n+ pod 'React', :path => '../node_modules/react-native', :subspecs => [\n+ 'Core',\n+ 'CxxBridge',\n+ 'DevSupport',\n+ 'RCTText',\n+ 'RCTNetwork',\n+ 'RCTWebSocket',\n+ 'RCTAnimation',\n+ 'RCTImage',\n+ 'RCTLinkingIOS',\n+ ]\n+\n+ pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'\n+ pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'\n+ pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'\n+ pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'\n+\n+ target 'SquadCalTests' do\n+ inherit! :search_paths\n+ # Pods for testing\n+ end\n+\n+end\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "native/ios/Podfile.lock",
"diff": "+PODS:\n+ - boost-for-react-native (1.63.0)\n+ - DoubleConversion (1.1.6)\n+ - Folly (2018.10.22.00):\n+ - boost-for-react-native\n+ - DoubleConversion\n+ - glog\n+ - glog (0.3.5)\n+ - React/Core (0.59.4):\n+ - yoga (= 0.59.4.React)\n+ - React/CxxBridge (0.59.4):\n+ - Folly (= 2018.10.22.00)\n+ - React/Core\n+ - React/cxxreact\n+ - React/jsiexecutor\n+ - React/cxxreact (0.59.4):\n+ - boost-for-react-native (= 1.63.0)\n+ - DoubleConversion\n+ - Folly (= 2018.10.22.00)\n+ - glog\n+ - React/jsinspector\n+ - React/DevSupport (0.59.4):\n+ - React/Core\n+ - React/RCTWebSocket\n+ - React/fishhook (0.59.4)\n+ - React/jsi (0.59.4):\n+ - DoubleConversion\n+ - Folly (= 2018.10.22.00)\n+ - glog\n+ - React/jsiexecutor (0.59.4):\n+ - DoubleConversion\n+ - Folly (= 2018.10.22.00)\n+ - glog\n+ - React/cxxreact\n+ - React/jsi\n+ - React/jsinspector (0.59.4)\n+ - React/RCTAnimation (0.59.4):\n+ - React/Core\n+ - React/RCTBlob (0.59.4):\n+ - React/Core\n+ - React/RCTImage (0.59.4):\n+ - React/Core\n+ - React/RCTNetwork\n+ - React/RCTLinkingIOS (0.59.4):\n+ - React/Core\n+ - React/RCTNetwork (0.59.4):\n+ - React/Core\n+ - React/RCTText (0.59.4):\n+ - React/Core\n+ - React/RCTWebSocket (0.59.4):\n+ - React/Core\n+ - React/fishhook\n+ - React/RCTBlob\n+ - yoga (0.59.4.React)\n+\n+DEPENDENCIES:\n+ - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)\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+ - React/Core (from `../node_modules/react-native`)\n+ - React/CxxBridge (from `../node_modules/react-native`)\n+ - React/DevSupport (from `../node_modules/react-native`)\n+ - React/RCTAnimation (from `../node_modules/react-native`)\n+ - React/RCTImage (from `../node_modules/react-native`)\n+ - React/RCTLinkingIOS (from `../node_modules/react-native`)\n+ - React/RCTNetwork (from `../node_modules/react-native`)\n+ - React/RCTText (from `../node_modules/react-native`)\n+ - React/RCTWebSocket (from `../node_modules/react-native`)\n+ - yoga (from `../node_modules/react-native/ReactCommon/yoga`)\n+\n+SPEC REPOS:\n+ https://github.com/cocoapods/specs.git:\n+ - boost-for-react-native\n+\n+EXTERNAL SOURCES:\n+ DoubleConversion:\n+ :podspec: \"../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec\"\n+ Folly:\n+ :podspec: \"../node_modules/react-native/third-party-podspecs/Folly.podspec\"\n+ glog:\n+ :podspec: \"../node_modules/react-native/third-party-podspecs/glog.podspec\"\n+ React:\n+ :path: \"../node_modules/react-native\"\n+ yoga:\n+ :path: \"../node_modules/react-native/ReactCommon/yoga\"\n+\n+SPEC CHECKSUMS:\n+ boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c\n+ DoubleConversion: bb338842f62ab1d708ceb63ec3d999f0f3d98ecd\n+ Folly: de497beb10f102453a1afa9edbf8cf8a251890de\n+ glog: aefd1eb5dda2ab95ba0938556f34b98e2da3a60d\n+ React: 5cb71fb1a15b5ce04794ab49e24b48ebe4c94e65\n+ yoga: 596e61c9b57751d08a22b07aba310dbd3e65ab75\n+\n+PODFILE CHECKSUM: 9976d4494f4d5c12165d3d049d3afbdefbf1bcdd\n+\n+COCOAPODS: 1.6.1\n"
},
{
"change_type": "MODIFY",
"old_path": "native/ios/SquadCal.xcodeproj/project.pbxproj",
"new_path": "native/ios/SquadCal.xcodeproj/project.pbxproj",
"diff": "13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };\n140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };\n146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };\n+ 164ABF33429CFE672F0D2509 /* libPods-SquadCal.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A0DD07F9928C5FD45DC1BEA6 /* libPods-SquadCal.a */; };\n1914154F4B054443B725346F /* Foundation.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EA40FBBA484449FAA8915A48 /* Foundation.ttf */; };\n1BFB77B74B924FA79ACBC2F6 /* libRCTOrientation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 99A8CC0EA47F466EAD201409 /* libRCTOrientation.a */; };\n2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };\n8894ACD632254222B23F69E2 /* Ionicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 4ACC468F28D944F293B91ACC /* Ionicons.ttf */; };\n9985FC0D9B2A43E49A4C1789 /* FontAwesome.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 4AB1FC0EFD3A4ED1A082E32F /* FontAwesome.ttf */; };\nA1145AA76F5B4EF5B3ACB31D /* MaterialIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = E4E90F44E9F4420080594671 /* MaterialIcons.ttf */; };\n+ A3E3B6D59954857009DE61B2 /* libPods-SquadCalTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AE3DE4A6CB22365D5B888510 /* libPods-SquadCalTests.a */; };\nA4B3D66697E04C11B4167EE7 /* libFastImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 47C86914FEF44D79AD04F880 /* libFastImage.a */; };\nA6EF57DD8BDA4D43812D0B13 /* libRNScreens.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7AAA81E566EC47C883CDFA61 /* libRNScreens.a */; };\nAFA44E75249D4766A4ED74C7 /* Octicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 2D04F3CCBAFF4A8184206FAC /* Octicons.ttf */; };\n00E356EE1AD99517003FC87E /* SquadCalTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SquadCalTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };\n00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n00E356F21AD99517003FC87E /* SquadCalTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SquadCalTests.m; sourceTree = \"<group>\"; };\n+ 014977C8FB73A1BAFFC6A440 /* 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>\"; };\n02810FBD603C4C36A94AF79B /* libRNCAsyncStorage.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNCAsyncStorage.a; sourceTree = \"<group>\"; };\n067F7283F74C4423A00B9690 /* libRNReanimated.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNReanimated.a; sourceTree = \"<group>\"; };\n+ 0C7EDB01EA89B2CC28DB5C92 /* 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>\"; };\n118DE3D4318D437D8F568F03 /* RNCNetInfo.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = \"wrapper.pb-project\"; name = RNCNetInfo.xcodeproj; path = \"../node_modules/@react-native-community/netinfo/ios/RNCNetInfo.xcodeproj\"; sourceTree = \"<group>\"; };\n139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTSettings.xcodeproj; path = \"../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj\"; sourceTree = \"<group>\"; };\n139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTWebSocket.xcodeproj; path = \"../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj\"; sourceTree = \"<group>\"; };\n95EEFC35D4D14053ACA7E064 /* RNKeychain.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = \"wrapper.pb-project\"; name = RNKeychain.xcodeproj; path = \"../node_modules/react-native-keychain/RNKeychain.xcodeproj\"; sourceTree = \"<group>\"; };\n99A8CC0EA47F466EAD201409 /* libRCTOrientation.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRCTOrientation.a; sourceTree = \"<group>\"; };\nA06F10E4481746D2B76CA60E /* Feather.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Feather.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/Feather.ttf\"; sourceTree = \"<group>\"; };\n+ A0DD07F9928C5FD45DC1BEA6 /* libPods-SquadCal.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libPods-SquadCal.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\nAE31AFFF88FB4112A29ADE33 /* SimpleLineIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = SimpleLineIcons.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/SimpleLineIcons.ttf\"; sourceTree = \"<group>\"; };\n+ AE3DE4A6CB22365D5B888510 /* libPods-SquadCalTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libPods-SquadCalTests.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n+ AE948BDFEBFF0E001C92466E /* Pods-SquadCalTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = \"Pods-SquadCalTests.release.xcconfig\"; path = \"Target Support Files/Pods-SquadCalTests/Pods-SquadCalTests.release.xcconfig\"; sourceTree = \"<group>\"; };\nBA72871056D240AEB0706398 /* RNScreens.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = \"wrapper.pb-project\"; name = RNScreens.xcodeproj; path = \"../node_modules/react-native-screens/ios/RNScreens.xcodeproj\"; sourceTree = \"<group>\"; };\nC2449EA8EFA9461DABF09B72 /* SplashScreen.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = \"wrapper.pb-project\"; name = SplashScreen.xcodeproj; path = \"../node_modules/react-native-splash-screen/ios/SplashScreen.xcodeproj\"; sourceTree = \"<group>\"; };\n+ C31F1DCD54AFD77F728CBF09 /* Pods-SquadCalTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = \"Pods-SquadCalTests.debug.xcconfig\"; path = \"Target Support Files/Pods-SquadCalTests/Pods-SquadCalTests.debug.xcconfig\"; sourceTree = \"<group>\"; };\nC3BA31E561EB497494D7882F /* RNVectorIcons.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = \"wrapper.pb-project\"; name = RNVectorIcons.xcodeproj; path = \"../node_modules/react-native-vector-icons/RNVectorIcons.xcodeproj\"; sourceTree = \"<group>\"; };\nE0952482A8094CE88F96C0EB /* libRNGestureHandler.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNGestureHandler.a; sourceTree = \"<group>\"; };\nE4E90F44E9F4420080594671 /* MaterialIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = MaterialIcons.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/MaterialIcons.ttf\"; sourceTree = \"<group>\"; };\nbuildActionMask = 2147483647;\nfiles = (\n140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */,\n+ A3E3B6D59954857009DE61B2 /* libPods-SquadCalTests.a in Frameworks */,\n);\nrunOnlyForDeploymentPostprocessing = 0;\n};\n63CCE55F632C4A96B5BDBFD7 /* libRNReanimated.a in Frameworks */,\n5124B6D20E534DE8B5FEA0D3 /* libRNCAsyncStorage.a in Frameworks */,\n02BD5DEEF10D43DAB506184E /* libRNCNetInfo.a in Frameworks */,\n+ 164ABF33429CFE672F0D2509 /* libPods-SquadCal.a in Frameworks */,\n);\nrunOnlyForDeploymentPostprocessing = 0;\n};\nisa = PBXGroup;\nchildren = (\n7F761E292201141E001B6FB7 /* JavaScriptCore.framework */,\n+ A0DD07F9928C5FD45DC1BEA6 /* libPods-SquadCal.a */,\n+ AE3DE4A6CB22365D5B888510 /* libPods-SquadCalTests.a */,\n);\nname = Frameworks;\nsourceTree = \"<group>\";\n7FF0870B1E833C3F000A1ACF /* Frameworks */,\n7F5B10C02005349C00FE096A /* Recovered References */,\n2D16E6871FA4F8E400B85C8A /* Frameworks */,\n+ D533B93718E3B9684B508006 /* Pods */,\n);\nindentWidth = 2;\nsourceTree = \"<group>\";\nname = Products;\nsourceTree = \"<group>\";\n};\n+ D533B93718E3B9684B508006 /* Pods */ = {\n+ isa = PBXGroup;\n+ children = (\n+ 0C7EDB01EA89B2CC28DB5C92 /* Pods-SquadCal.debug.xcconfig */,\n+ 014977C8FB73A1BAFFC6A440 /* Pods-SquadCal.release.xcconfig */,\n+ C31F1DCD54AFD77F728CBF09 /* Pods-SquadCalTests.debug.xcconfig */,\n+ AE948BDFEBFF0E001C92466E /* Pods-SquadCalTests.release.xcconfig */,\n+ );\n+ name = Pods;\n+ path = Pods;\n+ sourceTree = \"<group>\";\n+ };\n/* End PBXGroup section */\n/* Begin PBXNativeTarget section */\nisa = PBXNativeTarget;\nbuildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget \"SquadCalTests\" */;\nbuildPhases = (\n+ 7C17A6FD8CE5A860D2030A9C /* [CP] Check Pods Manifest.lock */,\n00E356EA1AD99517003FC87E /* Sources */,\n00E356EB1AD99517003FC87E /* Frameworks */,\n00E356EC1AD99517003FC87E /* Resources */,\nisa = PBXNativeTarget;\nbuildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget \"SquadCal\" */;\nbuildPhases = (\n+ 71A3C0E6E4C594516228C60A /* [CP] Check Pods Manifest.lock */,\n13B07F871A680F5B00A75B9A /* Sources */,\n13B07F8C1A680F5B00A75B9A /* Frameworks */,\n13B07F8E1A680F5B00A75B9A /* Resources */,\nshellPath = /bin/sh;\nshellScript = \"export NODE_BINARY=node\\n../node_modules/react-native/scripts/react-native-xcode.sh\";\n};\n+ 71A3C0E6E4C594516228C60A /* [CP] Check Pods Manifest.lock */ = {\n+ isa = PBXShellScriptBuildPhase;\n+ buildActionMask = 2147483647;\n+ files = (\n+ );\n+ inputFileListPaths = (\n+ );\n+ inputPaths = (\n+ \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\",\n+ \"${PODS_ROOT}/Manifest.lock\",\n+ );\n+ name = \"[CP] Check Pods Manifest.lock\";\n+ outputFileListPaths = (\n+ );\n+ outputPaths = (\n+ \"$(DERIVED_FILE_DIR)/Pods-SquadCal-checkManifestLockResult.txt\",\n+ );\n+ runOnlyForDeploymentPostprocessing = 0;\n+ shellPath = /bin/sh;\n+ shellScript = \"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\";\n+ showEnvVarsInLog = 0;\n+ };\n+ 7C17A6FD8CE5A860D2030A9C /* [CP] Check Pods Manifest.lock */ = {\n+ isa = PBXShellScriptBuildPhase;\n+ buildActionMask = 2147483647;\n+ files = (\n+ );\n+ inputFileListPaths = (\n+ );\n+ inputPaths = (\n+ \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\",\n+ \"${PODS_ROOT}/Manifest.lock\",\n+ );\n+ name = \"[CP] Check Pods Manifest.lock\";\n+ outputFileListPaths = (\n+ );\n+ outputPaths = (\n+ \"$(DERIVED_FILE_DIR)/Pods-SquadCalTests-checkManifestLockResult.txt\",\n+ );\n+ runOnlyForDeploymentPostprocessing = 0;\n+ shellPath = /bin/sh;\n+ shellScript = \"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\";\n+ showEnvVarsInLog = 0;\n+ };\n/* End PBXShellScriptBuildPhase section */\n/* Begin PBXSourcesBuildPhase section */\n/* Begin XCBuildConfiguration section */\n00E356F61AD99517003FC87E /* Debug */ = {\nisa = XCBuildConfiguration;\n+ baseConfigurationReference = C31F1DCD54AFD77F728CBF09 /* Pods-SquadCalTests.debug.xcconfig */;\nbuildSettings = {\nBUNDLE_LOADER = \"$(TEST_HOST)\";\nDEVELOPMENT_TEAM = 6BF4H9TU5U;\n};\n00E356F71AD99517003FC87E /* Release */ = {\nisa = XCBuildConfiguration;\n+ baseConfigurationReference = AE948BDFEBFF0E001C92466E /* Pods-SquadCalTests.release.xcconfig */;\nbuildSettings = {\nBUNDLE_LOADER = \"$(TEST_HOST)\";\nCOPY_PHASE_STRIP = NO;\n};\n13B07F941A680F5B00A75B9A /* Debug */ = {\nisa = XCBuildConfiguration;\n+ baseConfigurationReference = 0C7EDB01EA89B2CC28DB5C92 /* Pods-SquadCal.debug.xcconfig */;\nbuildSettings = {\nASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\nCODE_SIGN_ENTITLEMENTS = SquadCal/SquadCal.entitlements;\n};\n13B07F951A680F5B00A75B9A /* Release */ = {\nisa = XCBuildConfiguration;\n+ baseConfigurationReference = 014977C8FB73A1BAFFC6A440 /* Pods-SquadCal.release.xcconfig */;\nbuildSettings = {\nASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\nCODE_SIGN_ENTITLEMENTS = SquadCal/SquadCal.entitlements;\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "native/ios/SquadCal.xcworkspace/contents.xcworkspacedata",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<Workspace\n+ version = \"1.0\">\n+ <FileRef\n+ location = \"group:SquadCal.xcodeproj\">\n+ </FileRef>\n+ <FileRef\n+ location = \"group:Pods/Pods.xcodeproj\">\n+ </FileRef>\n+</Workspace>\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "native/ios/SquadCal.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"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] CocoaPods |
129,187 | 24.04.2019 00:14:34 | 14,400 | 5603d39c8276cafa2af9a215e8634fdc90820c6f | [native] Fix XCode recovered references | [
{
"change_type": "MODIFY",
"old_path": "native/ios/SquadCal.xcodeproj/project.pbxproj",
"new_path": "native/ios/SquadCal.xcodeproj/project.pbxproj",
"diff": "00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; };\n00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; };\n00E356F31AD99517003FC87E /* SquadCalTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* SquadCalTests.m */; };\n- 01247688B5604BFC9C2C301D /* libRNCNetInfo-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C779697B77F4094B9B235BE /* libRNCNetInfo-tvOS.a */; };\n- 02BD5DEEF10D43DAB506184E /* libRNCNetInfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 73C775AD68DB4BA0BADC22BF /* libRNCNetInfo.a */; };\n09369EAAB869410E9C0208B4 /* Feather.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A06F10E4481746D2B76CA60E /* Feather.ttf */; };\n133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; };\n139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; };\n146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };\n164ABF33429CFE672F0D2509 /* libPods-SquadCal.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A0DD07F9928C5FD45DC1BEA6 /* libPods-SquadCal.a */; };\n1914154F4B054443B725346F /* Foundation.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EA40FBBA484449FAA8915A48 /* Foundation.ttf */; };\n- 1BFB77B74B924FA79ACBC2F6 /* libRCTOrientation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 99A8CC0EA47F466EAD201409 /* libRCTOrientation.a */; };\n2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };\n2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };\n2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };\n2D16E6881FA4F8E400B85C8A /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D16E6891FA4F8E400B85C8A /* libReact.a */; };\n2DCD954D1E0B4F2C00145EB5 /* SquadCalTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* SquadCalTests.m */; };\n2E5ADC2BAEA24F1AAD81E147 /* Zocial.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EBD8879422144B0188A8336F /* Zocial.ttf */; };\n- 5124B6D20E534DE8B5FEA0D3 /* libRNCAsyncStorage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 02810FBD603C4C36A94AF79B /* libRNCAsyncStorage.a */; };\n569C48070423498795574595 /* EvilIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3430816A291640AEACA13234 /* EvilIcons.ttf */; };\n5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; };\n- 62E897586C0F47F7AFADFE11 /* libRNExitApp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 95EA49951E064ECB9B1999EA /* libRNExitApp.a */; };\n- 63CCE55F632C4A96B5BDBFD7 /* libRNReanimated.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 067F7283F74C4423A00B9690 /* libRNReanimated.a */; };\n781ED432789E4AFC93FA578A /* Entypo.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1E94F1BD692B4E6EBE1BFBFB /* Entypo.ttf */; };\n7E350429243446AAA3856078 /* MaterialCommunityIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 8D919BA72D8545CBBBF6B74F /* MaterialCommunityIcons.ttf */; };\n7F033BB61F01B5E400700D63 /* libOnePassword.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7FB58AD41E80C21000B4C1B1 /* libOnePassword.a */; };\n+ 7F164C9222701973003C98C9 /* libRNCNetInfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F4C7907226064F6009F6ABE /* libRNCNetInfo.a */; };\n+ 7F164C9322701989003C98C9 /* libRNExitApp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F3DD40B20521A4C00A0D652 /* libRNExitApp.a */; };\n+ 7F164C942270199F003C98C9 /* libSplashScreen.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7FABD009205730E8005F452B /* libSplashScreen.a */; };\n+ 7F164C95227019B0003C98C9 /* libRNGestureHandler.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7FA2ABDA218E3FC5008EF068 /* libRNGestureHandler.a */; };\n+ 7F164C96227019C6003C98C9 /* libRNScreens.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7FA2ABDD218E3FC5008EF068 /* libRNScreens.a */; };\n+ 7F164C97227019DB003C98C9 /* libFastImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F347C1A2242A05200F313CE /* libFastImage.a */; };\n+ 7F164C98227019FC003C98C9 /* libRCTOrientation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F16EB0E224ED3270008E483 /* libRCTOrientation.a */; };\n+ 7F164C9922701A07003C98C9 /* libRNReanimated.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F9DDC752257D85600CECAC3 /* libRNReanimated.a */; };\n+ 7F164C9A22701A1A003C98C9 /* libRNCAsyncStorage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F4C7903226064F6009F6ABE /* libRNCAsyncStorage.a */; };\n7F5B10EA200534C300FE096A /* libRNNotifications.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F5B10E92005349D00FE096A /* libRNNotifications.a */; };\n7F761E602201141E001B6FB7 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F761E292201141E001B6FB7 /* JavaScriptCore.framework */; };\n7FB58ABE1E7F6BD500B4C1B1 /* Anaheim-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 7FB58ABB1E7F6BC600B4C1B1 /* Anaheim-Regular.ttf */; };\n9985FC0D9B2A43E49A4C1789 /* FontAwesome.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 4AB1FC0EFD3A4ED1A082E32F /* FontAwesome.ttf */; };\nA1145AA76F5B4EF5B3ACB31D /* MaterialIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = E4E90F44E9F4420080594671 /* MaterialIcons.ttf */; };\nA3E3B6D59954857009DE61B2 /* libPods-SquadCalTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AE3DE4A6CB22365D5B888510 /* libPods-SquadCalTests.a */; };\n- A4B3D66697E04C11B4167EE7 /* libFastImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 47C86914FEF44D79AD04F880 /* libFastImage.a */; };\n- A6EF57DD8BDA4D43812D0B13 /* libRNScreens.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7AAA81E566EC47C883CDFA61 /* libRNScreens.a */; };\nAFA44E75249D4766A4ED74C7 /* Octicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 2D04F3CCBAFF4A8184206FAC /* Octicons.ttf */; };\n- BBC287C467984DA6BF85800E /* libSplashScreen.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B6A1FF570694BFCB0D65D0E /* libSplashScreen.a */; };\n- EFBA858A8D2B4909A08D9FE6 /* libRNGestureHandler.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E0952482A8094CE88F96C0EB /* libRNGestureHandler.a */; };\nFA7F2215AD7646E2BE985BF3 /* SimpleLineIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = AE31AFFF88FB4112A29ADE33 /* SimpleLineIcons.ttf */; };\n/* End PBXBuildFile section */\n00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n00E356F21AD99517003FC87E /* SquadCalTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SquadCalTests.m; sourceTree = \"<group>\"; };\n014977C8FB73A1BAFFC6A440 /* 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- 02810FBD603C4C36A94AF79B /* libRNCAsyncStorage.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNCAsyncStorage.a; sourceTree = \"<group>\"; };\n- 067F7283F74C4423A00B9690 /* libRNReanimated.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNReanimated.a; sourceTree = \"<group>\"; };\n0C7EDB01EA89B2CC28DB5C92 /* 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>\"; };\n118DE3D4318D437D8F568F03 /* RNCNetInfo.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = \"wrapper.pb-project\"; name = RNCNetInfo.xcodeproj; path = \"../node_modules/@react-native-community/netinfo/ios/RNCNetInfo.xcodeproj\"; sourceTree = \"<group>\"; };\n139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTSettings.xcodeproj; path = \"../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj\"; sourceTree = \"<group>\"; };\n2D16E6891FA4F8E400B85C8A /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; };\n3430816A291640AEACA13234 /* EvilIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = EvilIcons.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf\"; sourceTree = \"<group>\"; };\n443E4D8DC396450F8F664A5D /* RCTOrientation.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = \"wrapper.pb-project\"; name = RCTOrientation.xcodeproj; path = \"../node_modules/react-native-orientation-locker/iOS/RCTOrientation.xcodeproj\"; sourceTree = \"<group>\"; };\n- 47C86914FEF44D79AD04F880 /* libFastImage.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libFastImage.a; sourceTree = \"<group>\"; };\n4AB1FC0EFD3A4ED1A082E32F /* FontAwesome.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf\"; sourceTree = \"<group>\"; };\n4ACC468F28D944F293B91ACC /* Ionicons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Ionicons.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/Ionicons.ttf\"; sourceTree = \"<group>\"; };\n5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTAnimation.xcodeproj; path = \"../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj\"; sourceTree = \"<group>\"; };\n- 6C779697B77F4094B9B235BE /* libRNCNetInfo-tvOS.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = \"libRNCNetInfo-tvOS.a\"; sourceTree = \"<group>\"; };\n- 73C775AD68DB4BA0BADC22BF /* libRNCNetInfo.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNCNetInfo.a; sourceTree = \"<group>\"; };\n76FF92CF9B394C48A96E8DF8 /* RNCAsyncStorage.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = \"wrapper.pb-project\"; name = RNCAsyncStorage.xcodeproj; path = \"../node_modules/@react-native-community/async-storage/ios/RNCAsyncStorage.xcodeproj\"; sourceTree = \"<group>\"; };\n78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTLinking.xcodeproj; path = \"../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj\"; sourceTree = \"<group>\"; };\n- 7AAA81E566EC47C883CDFA61 /* libRNScreens.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNScreens.a; sourceTree = \"<group>\"; };\n7F761E292201141E001B6FB7 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };\n7FA344AAF237451CB8B3424B /* FastImage.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = \"wrapper.pb-project\"; name = FastImage.xcodeproj; path = \"../node_modules/react-native-fast-image/ios/FastImage.xcodeproj\"; sourceTree = \"<group>\"; };\n7FB58ABB1E7F6BC600B4C1B1 /* Anaheim-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = \"Anaheim-Regular.ttf\"; sourceTree = \"<group>\"; };\n7FC7F3EC21B5E0270083848D /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTBlob.xcodeproj; path = \"../../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj\"; sourceTree = \"<group>\"; };\n7FCFD8BD1E81B8DF00629B0E /* SquadCal.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = SquadCal.entitlements; path = SquadCal/SquadCal.entitlements; sourceTree = \"<group>\"; };\n832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTText.xcodeproj; path = \"../node_modules/react-native/Libraries/Text/RCTText.xcodeproj\"; sourceTree = \"<group>\"; };\n- 8B6A1FF570694BFCB0D65D0E /* libSplashScreen.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libSplashScreen.a; sourceTree = \"<group>\"; };\n8D919BA72D8545CBBBF6B74F /* MaterialCommunityIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = MaterialCommunityIcons.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf\"; sourceTree = \"<group>\"; };\n- 95EA49951E064ECB9B1999EA /* libRNExitApp.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNExitApp.a; sourceTree = \"<group>\"; };\n95EEFC35D4D14053ACA7E064 /* RNKeychain.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = \"wrapper.pb-project\"; name = RNKeychain.xcodeproj; path = \"../node_modules/react-native-keychain/RNKeychain.xcodeproj\"; sourceTree = \"<group>\"; };\n- 99A8CC0EA47F466EAD201409 /* libRCTOrientation.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRCTOrientation.a; sourceTree = \"<group>\"; };\nA06F10E4481746D2B76CA60E /* Feather.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Feather.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/Feather.ttf\"; sourceTree = \"<group>\"; };\nA0DD07F9928C5FD45DC1BEA6 /* libPods-SquadCal.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libPods-SquadCal.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\nAE31AFFF88FB4112A29ADE33 /* SimpleLineIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = SimpleLineIcons.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/SimpleLineIcons.ttf\"; sourceTree = \"<group>\"; };\nC2449EA8EFA9461DABF09B72 /* SplashScreen.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = \"wrapper.pb-project\"; name = SplashScreen.xcodeproj; path = \"../node_modules/react-native-splash-screen/ios/SplashScreen.xcodeproj\"; sourceTree = \"<group>\"; };\nC31F1DCD54AFD77F728CBF09 /* Pods-SquadCalTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = \"Pods-SquadCalTests.debug.xcconfig\"; path = \"Target Support Files/Pods-SquadCalTests/Pods-SquadCalTests.debug.xcconfig\"; sourceTree = \"<group>\"; };\nC3BA31E561EB497494D7882F /* RNVectorIcons.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = \"wrapper.pb-project\"; name = RNVectorIcons.xcodeproj; path = \"../node_modules/react-native-vector-icons/RNVectorIcons.xcodeproj\"; sourceTree = \"<group>\"; };\n- E0952482A8094CE88F96C0EB /* libRNGestureHandler.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNGestureHandler.a; sourceTree = \"<group>\"; };\nE4E90F44E9F4420080594671 /* MaterialIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = MaterialIcons.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/MaterialIcons.ttf\"; sourceTree = \"<group>\"; };\nE7D7D614C3184B1BB95EE661 /* OnePassword.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = \"wrapper.pb-project\"; name = OnePassword.xcodeproj; path = \"../node_modules/react-native-onepassword/OnePassword.xcodeproj\"; sourceTree = \"<group>\"; };\nEA40FBBA484449FAA8915A48 /* Foundation.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Foundation.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/Foundation.ttf\"; sourceTree = \"<group>\"; };\n00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,\n139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,\n7F033BB61F01B5E400700D63 /* libOnePassword.a in Frameworks */,\n- 62E897586C0F47F7AFADFE11 /* libRNExitApp.a in Frameworks */,\n- BBC287C467984DA6BF85800E /* libSplashScreen.a in Frameworks */,\n- EFBA858A8D2B4909A08D9FE6 /* libRNGestureHandler.a in Frameworks */,\n- A6EF57DD8BDA4D43812D0B13 /* libRNScreens.a in Frameworks */,\n- A4B3D66697E04C11B4167EE7 /* libFastImage.a in Frameworks */,\n- 1BFB77B74B924FA79ACBC2F6 /* libRCTOrientation.a in Frameworks */,\n- 63CCE55F632C4A96B5BDBFD7 /* libRNReanimated.a in Frameworks */,\n- 5124B6D20E534DE8B5FEA0D3 /* libRNCAsyncStorage.a in Frameworks */,\n- 02BD5DEEF10D43DAB506184E /* libRNCNetInfo.a in Frameworks */,\n+ 7F164C9222701973003C98C9 /* libRNCNetInfo.a in Frameworks */,\n+ 7F164C9322701989003C98C9 /* libRNExitApp.a in Frameworks */,\n+ 7F164C942270199F003C98C9 /* libSplashScreen.a in Frameworks */,\n+ 7F164C95227019B0003C98C9 /* libRNGestureHandler.a in Frameworks */,\n+ 7F164C96227019C6003C98C9 /* libRNScreens.a in Frameworks */,\n+ 7F164C97227019DB003C98C9 /* libFastImage.a in Frameworks */,\n+ 7F164C98227019FC003C98C9 /* libRCTOrientation.a in Frameworks */,\n+ 7F164C9922701A07003C98C9 /* libRNReanimated.a in Frameworks */,\n+ 7F164C9A22701A1A003C98C9 /* libRNCAsyncStorage.a in Frameworks */,\n164ABF33429CFE672F0D2509 /* libPods-SquadCal.a in Frameworks */,\n);\nrunOnlyForDeploymentPostprocessing = 0;\n2D02E4C61E0B4AEC006451C7 /* libRCTSettings-tvOS.a in Frameworks */,\n2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */,\n2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */,\n- 01247688B5604BFC9C2C301D /* libRNCNetInfo-tvOS.a in Frameworks */,\n);\nrunOnlyForDeploymentPostprocessing = 0;\n};\n7F5B10C02005349C00FE096A /* Recovered References */ = {\nisa = PBXGroup;\nchildren = (\n- 95EA49951E064ECB9B1999EA /* libRNExitApp.a */,\n- 8B6A1FF570694BFCB0D65D0E /* libSplashScreen.a */,\n- E0952482A8094CE88F96C0EB /* libRNGestureHandler.a */,\n- 7AAA81E566EC47C883CDFA61 /* libRNScreens.a */,\n- 47C86914FEF44D79AD04F880 /* libFastImage.a */,\n- 99A8CC0EA47F466EAD201409 /* libRCTOrientation.a */,\n- 067F7283F74C4423A00B9690 /* libRNReanimated.a */,\n- 02810FBD603C4C36A94AF79B /* libRNCAsyncStorage.a */,\n- 73C775AD68DB4BA0BADC22BF /* libRNCNetInfo.a */,\n- 6C779697B77F4094B9B235BE /* libRNCNetInfo-tvOS.a */,\n);\nname = \"Recovered References\";\nsourceTree = \"<group>\";\nC31F1DCD54AFD77F728CBF09 /* Pods-SquadCalTests.debug.xcconfig */,\nAE948BDFEBFF0E001C92466E /* Pods-SquadCalTests.release.xcconfig */,\n);\n- name = Pods;\npath = Pods;\nsourceTree = \"<group>\";\n};\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Fix XCode recovered references |
129,187 | 23.04.2019 19:21:29 | 14,400 | 541e5489873d76703dd180df4529a4241c831702 | [native] Remove unused libraries from iOS build | [
{
"change_type": "MODIFY",
"old_path": "native/ios/SquadCal.xcodeproj/project.pbxproj",
"new_path": "native/ios/SquadCal.xcodeproj/project.pbxproj",
"diff": "objects = {\n/* Begin PBXBuildFile section */\n- 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };\n- 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; };\n00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; };\n00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; };\n- 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; };\n00E356F31AD99517003FC87E /* SquadCalTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* SquadCalTests.m */; };\n09369EAAB869410E9C0208B4 /* Feather.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A06F10E4481746D2B76CA60E /* Feather.ttf */; };\n133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; };\n- 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; };\n139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; };\n13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };\n13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };\n2D02E4C31E0B4AEC006451C7 /* libRCTImage-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */; };\n2D02E4C41E0B4AEC006451C7 /* libRCTLinking-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */; };\n2D02E4C51E0B4AEC006451C7 /* libRCTNetwork-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */; };\n- 2D02E4C61E0B4AEC006451C7 /* libRCTSettings-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */; };\n2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */; };\n2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */; };\n2D16E6881FA4F8E400B85C8A /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D16E6891FA4F8E400B85C8A /* libReact.a */; };\n7FB58AC11E7F6BD900B4C1B1 /* 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 */; };\n7FB58AC31E7F6BDC00B4C1B1 /* OpenSans-Semibold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 7FB58ABD1E7F6BC600B4C1B1 /* OpenSans-Semibold.ttf */; };\n- 7FC7F3F521B5E0540083848D /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7FC7F3F221B5E0270083848D /* libRCTBlob.a */; };\n7FF1294020047B8B0051F874 /* libRNVectorIcons.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7FB58ABA1E7F6B4400B4C1B1 /* libRNVectorIcons.a */; };\n7FF1294120047BAC0051F874 /* libRNKeychain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7FEB2DEC1E8D64D200C4B763 /* libRNKeychain.a */; };\n832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };\n/* End PBXBuildFile section */\n/* Begin PBXContainerItemProxy section */\n- 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = {\n- isa = PBXContainerItemProxy;\n- containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;\n- proxyType = 2;\n- remoteGlobalIDString = 134814201AA4EA6300B7C361;\n- remoteInfo = RCTActionSheet;\n- };\n- 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = {\n- isa = PBXContainerItemProxy;\n- containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */;\n- proxyType = 2;\n- remoteGlobalIDString = 134814201AA4EA6300B7C361;\n- remoteInfo = RCTGeolocation;\n- };\n00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = {\nisa = PBXContainerItemProxy;\ncontainerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;\nremoteGlobalIDString = 58B511DB1A9E6C8500147676;\nremoteInfo = RCTNetwork;\n};\n- 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = {\n- isa = PBXContainerItemProxy;\n- containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */;\n- proxyType = 2;\n- remoteGlobalIDString = 832C81801AAF6DEF007FA2F7;\n- remoteInfo = RCTVibration;\n- };\n00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {\nisa = PBXContainerItemProxy;\ncontainerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;\nremoteGlobalIDString = 13B07F861A680F5B00A75B9A;\nremoteInfo = SquadCal;\n};\n- 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = {\n- isa = PBXContainerItemProxy;\n- containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;\n- proxyType = 2;\n- remoteGlobalIDString = 134814201AA4EA6300B7C361;\n- remoteInfo = RCTSettings;\n- };\n139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = {\nisa = PBXContainerItemProxy;\ncontainerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;\nremoteGlobalIDString = 2D2A28541D9B044C00D4039D;\nremoteInfo = \"RCTNetwork-tvOS\";\n};\n- 3DAD3E8F1DF850E9000B6D8A /* PBXContainerItemProxy */ = {\n- isa = PBXContainerItemProxy;\n- containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;\n- proxyType = 2;\n- remoteGlobalIDString = 2D2A28611D9B046600D4039D;\n- remoteInfo = \"RCTSettings-tvOS\";\n- };\n3DAD3E931DF850E9000B6D8A /* PBXContainerItemProxy */ = {\nisa = PBXContainerItemProxy;\ncontainerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;\nremoteGlobalIDString = 52E319201C0655C200265D56;\nremoteInfo = OnePassword;\n};\n- 7FC7F3F121B5E0270083848D /* PBXContainerItemProxy */ = {\n- isa = PBXContainerItemProxy;\n- containerPortal = 7FC7F3EC21B5E0270083848D /* RCTBlob.xcodeproj */;\n- proxyType = 2;\n- remoteGlobalIDString = 358F4ED71D1E81A9004DF814;\n- remoteInfo = RCTBlob;\n- };\n- 7FC7F3F321B5E0270083848D /* PBXContainerItemProxy */ = {\n- isa = PBXContainerItemProxy;\n- containerPortal = 7FC7F3EC21B5E0270083848D /* RCTBlob.xcodeproj */;\n- proxyType = 2;\n- remoteGlobalIDString = ADD01A681E09402E00F6D226;\n- remoteInfo = \"RCTBlob-tvOS\";\n- };\n7FEB2DEB1E8D64D200C4B763 /* PBXContainerItemProxy */ = {\nisa = PBXContainerItemProxy;\ncontainerPortal = 95EEFC35D4D14053ACA7E064 /* RNKeychain.xcodeproj */;\n/* Begin PBXFileReference section */\n008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = \"<group>\"; };\n- 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTActionSheet.xcodeproj; path = \"../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj\"; sourceTree = \"<group>\"; };\n- 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTGeolocation.xcodeproj; path = \"../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj\"; sourceTree = \"<group>\"; };\n00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTImage.xcodeproj; path = \"../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj\"; sourceTree = \"<group>\"; };\n00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTNetwork.xcodeproj; path = \"../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj\"; sourceTree = \"<group>\"; };\n- 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTVibration.xcodeproj; path = \"../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj\"; sourceTree = \"<group>\"; };\n00E356EE1AD99517003FC87E /* SquadCalTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SquadCalTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };\n00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n00E356F21AD99517003FC87E /* SquadCalTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SquadCalTests.m; sourceTree = \"<group>\"; };\n014977C8FB73A1BAFFC6A440 /* 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>\"; };\n0C7EDB01EA89B2CC28DB5C92 /* 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>\"; };\n118DE3D4318D437D8F568F03 /* RNCNetInfo.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = \"wrapper.pb-project\"; name = RNCNetInfo.xcodeproj; path = \"../node_modules/@react-native-community/netinfo/ios/RNCNetInfo.xcodeproj\"; sourceTree = \"<group>\"; };\n- 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTSettings.xcodeproj; path = \"../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj\"; sourceTree = \"<group>\"; };\n139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTWebSocket.xcodeproj; path = \"../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj\"; sourceTree = \"<group>\"; };\n13B07F961A680F5B00A75B9A /* SquadCal.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SquadCal.app; sourceTree = BUILT_PRODUCTS_DIR; };\n13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = SquadCal/AppDelegate.h; 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>\"; };\n- 7FC7F3EC21B5E0270083848D /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTBlob.xcodeproj; path = \"../../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj\"; sourceTree = \"<group>\"; };\n7FCFD8BD1E81B8DF00629B0E /* SquadCal.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = SquadCal.entitlements; path = SquadCal/SquadCal.entitlements; sourceTree = \"<group>\"; };\n832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTText.xcodeproj; path = \"../node_modules/react-native/Libraries/Text/RCTText.xcodeproj\"; sourceTree = \"<group>\"; };\n8D919BA72D8545CBBBF6B74F /* MaterialCommunityIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = MaterialCommunityIcons.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf\"; sourceTree = \"<group>\"; };\nbuildActionMask = 2147483647;\nfiles = (\n7F761E602201141E001B6FB7 /* JavaScriptCore.framework in Frameworks */,\n- 7FC7F3F521B5E0540083848D /* libRCTBlob.a in Frameworks */,\n7F5B10EA200534C300FE096A /* libRNNotifications.a in Frameworks */,\n7FF1294120047BAC0051F874 /* libRNKeychain.a in Frameworks */,\n7FF1294020047B8B0051F874 /* libRNVectorIcons.a in Frameworks */,\n146834051AC3E58100842450 /* libReact.a in Frameworks */,\n5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */,\n- 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */,\n- 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */,\n00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */,\n133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */,\n00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */,\n- 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */,\n832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,\n- 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,\n139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,\n7F033BB61F01B5E400700D63 /* libOnePassword.a in Frameworks */,\n7F164C9222701973003C98C9 /* libRNCNetInfo.a in Frameworks */,\n2D02E4C31E0B4AEC006451C7 /* libRCTImage-tvOS.a in Frameworks */,\n2D02E4C41E0B4AEC006451C7 /* libRCTLinking-tvOS.a in Frameworks */,\n2D02E4C51E0B4AEC006451C7 /* libRCTNetwork-tvOS.a in Frameworks */,\n- 2D02E4C61E0B4AEC006451C7 /* libRCTSettings-tvOS.a in Frameworks */,\n2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */,\n2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */,\n);\n/* End PBXFrameworksBuildPhase section */\n/* Begin PBXGroup section */\n- 00C302A81ABCB8CE00DB3ED1 /* Products */ = {\n- isa = PBXGroup;\n- children = (\n- 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */,\n- );\n- name = Products;\n- sourceTree = \"<group>\";\n- };\n- 00C302B61ABCB90400DB3ED1 /* Products */ = {\n- isa = PBXGroup;\n- children = (\n- 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */,\n- );\n- name = Products;\n- sourceTree = \"<group>\";\n- };\n00C302BC1ABCB91800DB3ED1 /* Products */ = {\nisa = PBXGroup;\nchildren = (\nname = Products;\nsourceTree = \"<group>\";\n};\n- 00C302E01ABCB9EE00DB3ED1 /* Products */ = {\n- isa = PBXGroup;\n- children = (\n- 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */,\n- );\n- name = Products;\n- sourceTree = \"<group>\";\n- };\n00E356EF1AD99517003FC87E /* SquadCalTests */ = {\nisa = PBXGroup;\nchildren = (\nname = \"Supporting Files\";\nsourceTree = \"<group>\";\n};\n- 139105B71AF99BAD00B5F7CC /* Products */ = {\n- isa = PBXGroup;\n- children = (\n- 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */,\n- 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */,\n- );\n- name = Products;\n- sourceTree = \"<group>\";\n- };\n139FDEE71B06529A00C62182 /* Products */ = {\nisa = PBXGroup;\nchildren = (\nname = Products;\nsourceTree = \"<group>\";\n};\n- 7FC7F3ED21B5E0270083848D /* Products */ = {\n- isa = PBXGroup;\n- children = (\n- 7FC7F3F221B5E0270083848D /* libRCTBlob.a */,\n- 7FC7F3F421B5E0270083848D /* libRCTBlob-tvOS.a */,\n- );\n- name = Products;\n- sourceTree = \"<group>\";\n- };\n7FEB2DCE1E8D64D200C4B763 /* Products */ = {\nisa = PBXGroup;\nchildren = (\n832341AE1AAA6A7D00B99B32 /* Libraries */ = {\nisa = PBXGroup;\nchildren = (\n- 7FC7F3EC21B5E0270083848D /* RCTBlob.xcodeproj */,\n5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */,\n146833FF1AC3E56700842450 /* React.xcodeproj */,\n- 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */,\n- 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */,\n00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */,\n78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */,\n00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */,\n- 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */,\n832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,\n- 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,\n139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,\nC3BA31E561EB497494D7882F /* RNVectorIcons.xcodeproj */,\nE7D7D614C3184B1BB95EE661 /* OnePassword.xcodeproj */,\nProductGroup = 7FB58AD01E80C21000B4C1B1 /* Products */;\nProjectRef = E7D7D614C3184B1BB95EE661 /* OnePassword.xcodeproj */;\n},\n- {\n- ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */;\n- ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;\n- },\n{\nProductGroup = 5E91572E1DD0AC6500FF2AA8 /* Products */;\nProjectRef = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */;\n},\n- {\n- ProductGroup = 7FC7F3ED21B5E0270083848D /* Products */;\n- ProjectRef = 7FC7F3EC21B5E0270083848D /* RCTBlob.xcodeproj */;\n- },\n- {\n- ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */;\n- ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */;\n- },\n{\nProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */;\nProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;\nProductGroup = 7F16EB09224ED3270008E483 /* Products */;\nProjectRef = 443E4D8DC396450F8F664A5D /* RCTOrientation.xcodeproj */;\n},\n- {\n- ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */;\n- ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;\n- },\n{\nProductGroup = 832341B11AAA6A8300B99B32 /* Products */;\nProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;\n},\n- {\n- ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */;\n- ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */;\n- },\n{\nProductGroup = 139FDEE71B06529A00C62182 /* Products */;\nProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;\n/* End PBXProject section */\n/* Begin PBXReferenceProxy section */\n- 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = {\n- isa = PBXReferenceProxy;\n- fileType = archive.ar;\n- path = libRCTActionSheet.a;\n- remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */;\n- sourceTree = BUILT_PRODUCTS_DIR;\n- };\n- 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = {\n- isa = PBXReferenceProxy;\n- fileType = archive.ar;\n- path = libRCTGeolocation.a;\n- remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */;\n- sourceTree = BUILT_PRODUCTS_DIR;\n- };\n00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = {\nisa = PBXReferenceProxy;\nfileType = archive.ar;\nremoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */;\nsourceTree = BUILT_PRODUCTS_DIR;\n};\n- 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = {\n- isa = PBXReferenceProxy;\n- fileType = archive.ar;\n- path = libRCTVibration.a;\n- remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */;\n- sourceTree = BUILT_PRODUCTS_DIR;\n- };\n- 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = {\n- isa = PBXReferenceProxy;\n- fileType = archive.ar;\n- path = libRCTSettings.a;\n- remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */;\n- sourceTree = BUILT_PRODUCTS_DIR;\n- };\n139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = {\nisa = PBXReferenceProxy;\nfileType = archive.ar;\nremoteRef = 3DAD3E8B1DF850E9000B6D8A /* PBXContainerItemProxy */;\nsourceTree = BUILT_PRODUCTS_DIR;\n};\n- 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */ = {\n- isa = PBXReferenceProxy;\n- fileType = archive.ar;\n- path = \"libRCTSettings-tvOS.a\";\n- remoteRef = 3DAD3E8F1DF850E9000B6D8A /* PBXContainerItemProxy */;\n- sourceTree = BUILT_PRODUCTS_DIR;\n- };\n3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */ = {\nisa = PBXReferenceProxy;\nfileType = archive.ar;\nremoteRef = 7FB58AD31E80C21000B4C1B1 /* PBXContainerItemProxy */;\nsourceTree = BUILT_PRODUCTS_DIR;\n};\n- 7FC7F3F221B5E0270083848D /* libRCTBlob.a */ = {\n- isa = PBXReferenceProxy;\n- fileType = archive.ar;\n- path = libRCTBlob.a;\n- remoteRef = 7FC7F3F121B5E0270083848D /* PBXContainerItemProxy */;\n- sourceTree = BUILT_PRODUCTS_DIR;\n- };\n- 7FC7F3F421B5E0270083848D /* libRCTBlob-tvOS.a */ = {\n- isa = PBXReferenceProxy;\n- fileType = archive.ar;\n- path = \"libRCTBlob-tvOS.a\";\n- remoteRef = 7FC7F3F321B5E0270083848D /* PBXContainerItemProxy */;\n- sourceTree = BUILT_PRODUCTS_DIR;\n- };\n7FEB2DEC1E8D64D200C4B763 /* libRNKeychain.a */ = {\nisa = PBXReferenceProxy;\nfileType = archive.ar;\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Remove unused libraries from iOS build |
129,187 | 24.04.2019 01:56:05 | 14,400 | 0eec00f1770a398dacbf4b89de3bd8e689a3a327 | [native] Use react-native-onepassword from GitHub
Has a fix for running on the UI thread that avoids a warning when debugging in simulator. | [
{
"change_type": "MODIFY",
"old_path": "native/package.json",
"new_path": "native/package.json",
"diff": "\"react-native-in-app-notification\": \"^2.1.0\",\n\"react-native-keychain\": \"^3.0.0\",\n\"react-native-notifications\": \"git+https://git@github.com/ashoat/react-native-notifications.git\",\n- \"react-native-onepassword\": \"^1.0.6\",\n+ \"react-native-onepassword\": \"git+https://git@github.com/DriveWealth/react-native-onepassword#aed794d8c6f0f2560b62a0012449abf6f1b3576c\",\n\"react-native-orientation-locker\": \"^1.1.5\",\n\"react-native-reanimated\": \"^1.0.0\",\n\"react-native-screens\": \"1.0.0-alpha.17\",\n"
},
{
"change_type": "MODIFY",
"old_path": "yarn.lock",
"new_path": "yarn.lock",
"diff": "@@ -10554,10 +10554,9 @@ react-native-keychain@^3.0.0:\ncore-js \"^1.0.0\"\nuuid \"^2.0.3\"\n-react-native-onepassword@^1.0.6:\n+\"react-native-onepassword@git+https://git@github.com/DriveWealth/react-native-onepassword#aed794d8c6f0f2560b62a0012449abf6f1b3576c\":\nversion \"1.0.6\"\n- resolved \"https://registry.yarnpkg.com/react-native-onepassword/-/react-native-onepassword-1.0.6.tgz#f4c2f07253fffcd3bb4fb795cfb1e11158221a54\"\n- integrity sha512-kRgWo3H4FTL/7GRFVsfJosr47nDbXGtT+FhEAGlMC39xmuNGr5qa1dkcjIirNu3biEHED/WATMP2tLFCmDLm8g==\n+ resolved \"git+https://git@github.com/DriveWealth/react-native-onepassword#aed794d8c6f0f2560b62a0012449abf6f1b3576c\"\ndependencies:\n\"1PasswordExtension\" \"git+https://github.com/jjshammas/onepassword-app-extension.git\"\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Use react-native-onepassword from GitHub
Has a fix for running on the UI thread that avoids a warning when debugging in simulator. |
129,187 | 24.04.2019 12:55:42 | 14,400 | 4210d477dddefb163d5d4001ea55d29e017eba24 | [native] Use paths relative to whole repo root for Podfile | [
{
"change_type": "MODIFY",
"old_path": "native/ios/Podfile",
"new_path": "native/ios/Podfile",
"diff": "@@ -6,7 +6,7 @@ target 'SquadCal' do\n# use_frameworks!\n# Pods for SquadCal\n- pod 'React', :path => '../node_modules/react-native', :subspecs => [\n+ pod 'React', :path => '../../node_modules/react-native', :subspecs => [\n'Core',\n'CxxBridge',\n'DevSupport',\n@@ -18,10 +18,10 @@ target 'SquadCal' do\n'RCTLinkingIOS',\n]\n- pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'\n- pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'\n- pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'\n- pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'\n+ pod 'yoga', :path => '../../node_modules/react-native/ReactCommon/yoga'\n+ pod 'DoubleConversion', :podspec => '../../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'\n+ pod 'glog', :podspec => '../../node_modules/react-native/third-party-podspecs/glog.podspec'\n+ pod 'Folly', :podspec => '../../node_modules/react-native/third-party-podspecs/Folly.podspec'\ntarget 'SquadCalTests' do\ninherit! :search_paths\n"
},
{
"change_type": "MODIFY",
"old_path": "native/ios/Podfile.lock",
"new_path": "native/ios/Podfile.lock",
"diff": "@@ -54,19 +54,19 @@ PODS:\n- yoga (0.59.4.React)\nDEPENDENCIES:\n- - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)\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- - React/Core (from `../node_modules/react-native`)\n- - React/CxxBridge (from `../node_modules/react-native`)\n- - React/DevSupport (from `../node_modules/react-native`)\n- - React/RCTAnimation (from `../node_modules/react-native`)\n- - React/RCTImage (from `../node_modules/react-native`)\n- - React/RCTLinkingIOS (from `../node_modules/react-native`)\n- - React/RCTNetwork (from `../node_modules/react-native`)\n- - React/RCTText (from `../node_modules/react-native`)\n- - React/RCTWebSocket (from `../node_modules/react-native`)\n- - yoga (from `../node_modules/react-native/ReactCommon/yoga`)\n+ - DoubleConversion (from `../../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)\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+ - React/Core (from `../../node_modules/react-native`)\n+ - React/CxxBridge (from `../../node_modules/react-native`)\n+ - React/DevSupport (from `../../node_modules/react-native`)\n+ - React/RCTAnimation (from `../../node_modules/react-native`)\n+ - React/RCTImage (from `../../node_modules/react-native`)\n+ - React/RCTLinkingIOS (from `../../node_modules/react-native`)\n+ - React/RCTNetwork (from `../../node_modules/react-native`)\n+ - React/RCTText (from `../../node_modules/react-native`)\n+ - React/RCTWebSocket (from `../../node_modules/react-native`)\n+ - yoga (from `../../node_modules/react-native/ReactCommon/yoga`)\nSPEC REPOS:\nhttps://github.com/cocoapods/specs.git:\n@@ -74,15 +74,15 @@ SPEC REPOS:\nEXTERNAL SOURCES:\nDoubleConversion:\n- :podspec: \"../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec\"\n+ :podspec: \"../../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec\"\nFolly:\n- :podspec: \"../node_modules/react-native/third-party-podspecs/Folly.podspec\"\n+ :podspec: \"../../node_modules/react-native/third-party-podspecs/Folly.podspec\"\nglog:\n- :podspec: \"../node_modules/react-native/third-party-podspecs/glog.podspec\"\n+ :podspec: \"../../node_modules/react-native/third-party-podspecs/glog.podspec\"\nReact:\n- :path: \"../node_modules/react-native\"\n+ :path: \"../../node_modules/react-native\"\nyoga:\n- :path: \"../node_modules/react-native/ReactCommon/yoga\"\n+ :path: \"../../node_modules/react-native/ReactCommon/yoga\"\nSPEC CHECKSUMS:\nboost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c\n@@ -92,6 +92,6 @@ SPEC CHECKSUMS:\nReact: 5cb71fb1a15b5ce04794ab49e24b48ebe4c94e65\nyoga: 596e61c9b57751d08a22b07aba310dbd3e65ab75\n-PODFILE CHECKSUM: 9976d4494f4d5c12165d3d049d3afbdefbf1bcdd\n+PODFILE CHECKSUM: ca6bcd531ceb6ccefe6729416fe8f2be25135679\nCOCOAPODS: 1.6.1\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Use paths relative to whole repo root for Podfile |
129,187 | 24.04.2019 13:24:56 | 14,400 | ce42f174efc4dcd3e5bb34dbecc033cb94896387 | [native] Use latest react-native-exit-app from GitHub
It has a Podspec | [
{
"change_type": "MODIFY",
"old_path": "native/ios/Podfile",
"new_path": "native/ios/Podfile",
"diff": "@@ -35,6 +35,7 @@ target 'SquadCal' do\npod 'react-native-async-storage', :path => '../../node_modules/@react-native-community/async-storage'\npod 'react-native-netinfo', :path => '../../node_modules/@react-native-community/netinfo'\npod 'react-native-notifications', :path => '../../node_modules/react-native-notifications'\n+ pod 'react-native-exit-app', :path => '../../node_modules/react-native-exit-app'\ntarget 'SquadCalTests' do\ninherit! :search_paths\n"
},
{
"change_type": "MODIFY",
"old_path": "native/ios/Podfile.lock",
"new_path": "native/ios/Podfile.lock",
"diff": "@@ -36,6 +36,8 @@ PODS:\n- React/Core (= 0.59.4)\n- react-native-async-storage (1.3.0):\n- React\n+ - react-native-exit-app (0.1.0):\n+ - React\n- react-native-fast-image (5.2.0):\n- FLAnimatedImage\n- React\n@@ -122,6 +124,7 @@ DEPENDENCIES:\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- \"react-native-async-storage (from `../../node_modules/@react-native-community/async-storage`)\"\n+ - react-native-exit-app (from `../../node_modules/react-native-exit-app`)\n- react-native-fast-image (from `../../node_modules/react-native-fast-image`)\n- \"react-native-netinfo (from `../../node_modules/@react-native-community/netinfo`)\"\n- react-native-notifications (from `../../node_modules/react-native-notifications`)\n@@ -163,6 +166,8 @@ EXTERNAL SOURCES:\n:path: \"../../node_modules/react-native\"\nreact-native-async-storage:\n:path: \"../../node_modules/@react-native-community/async-storage\"\n+ react-native-exit-app:\n+ :path: \"../../node_modules/react-native-exit-app\"\nreact-native-fast-image:\n:path: \"../../node_modules/react-native-fast-image\"\nreact-native-netinfo:\n@@ -198,6 +203,7 @@ SPEC CHECKSUMS:\nlibwebp: b068a3bd7c45f7460f6715be7bed1a18fd5d6b48\nReact: 5cb71fb1a15b5ce04794ab49e24b48ebe4c94e65\nreact-native-async-storage: 6aa3086d7b4f45e49adc8e087b4a03e47279aa1b\n+ react-native-exit-app: 3f9b8c2f2071f7e51fba21dfac9fc235c1764e84\nreact-native-fast-image: 21d2d84a46b12cacbe7958ab6414fe828c094f82\nreact-native-netinfo: d6ff19d6b0fff3c617d01949f87e9976e7ecc9a9\nreact-native-notifications: bb042206ac7eab9323d528c780b3d6fe796c1f5e\n@@ -212,6 +218,6 @@ SPEC CHECKSUMS:\nSDWebImage: 3f3f0c02f09798048c47a5ed0a13f17b063572d8\nyoga: 596e61c9b57751d08a22b07aba310dbd3e65ab75\n-PODFILE CHECKSUM: d0422deb6f8fcaa02c637f23140450218a1ad741\n+PODFILE CHECKSUM: 397bf9fed89dc511db29da5bead3cc6b1a4b8ab6\nCOCOAPODS: 1.6.1\n"
},
{
"change_type": "MODIFY",
"old_path": "native/ios/SquadCal.xcodeproj/project.pbxproj",
"new_path": "native/ios/SquadCal.xcodeproj/project.pbxproj",
"diff": "};\nobjectVersion = 46;\nobjects = {\n+\n/* Begin PBXBuildFile section */\n00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; };\n00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; };\n37EFE215F3DF4D559A6113EF /* MaterialCommunityIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 21637FDCB85C48C78A1E0D0F /* MaterialCommunityIcons.ttf */; };\n50114777890342C69E1A0D53 /* Feather.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1BACB9A55ECC42C38F5FE331 /* Feather.ttf */; };\n5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; };\n- 7F164C9322701989003C98C9 /* libRNExitApp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F3DD40B20521A4C00A0D652 /* libRNExitApp.a */; };\n7F761E602201141E001B6FB7 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F761E292201141E001B6FB7 /* JavaScriptCore.framework */; };\n7FB58ABE1E7F6BD500B4C1B1 /* Anaheim-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 7FB58ABB1E7F6BC600B4C1B1 /* Anaheim-Regular.ttf */; };\n7FB58ABF1E7F6BD600B4C1B1 /* Anaheim-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 7FB58ABB1E7F6BC600B4C1B1 /* Anaheim-Regular.ttf */; };\nremoteGlobalIDString = EBF21BFA1FC4989A0052F4D5;\nremoteInfo = \"jsinspector-tvOS\";\n};\n- 7F3DD40A20521A4C00A0D652 /* PBXContainerItemProxy */ = {\n- isa = PBXContainerItemProxy;\n- containerPortal = 220AE3F9742647538AAD1DD7 /* RNExitApp.xcodeproj */;\n- proxyType = 2;\n- remoteGlobalIDString = 15209BEF1D250F63000D0F44;\n- remoteInfo = RNExitApp;\n- };\n7F407AEA1FF1D826006997C8 /* PBXContainerItemProxy */ = {\nisa = PBXContainerItemProxy;\ncontainerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;\n13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = SquadCal/Info.plist; sourceTree = \"<group>\"; };\n13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = SquadCal/main.m; sourceTree = \"<group>\"; };\n146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = React.xcodeproj; path = \"../node_modules/react-native/React/React.xcodeproj\"; sourceTree = \"<group>\"; };\n- 1BACB9A55ECC42C38F5FE331 /* Feather.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = Feather.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/Feather.ttf\"; sourceTree = \"<group>\"; };\n- 1D93876C58814C70A51B11CA /* SimpleLineIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = SimpleLineIcons.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/SimpleLineIcons.ttf\"; sourceTree = \"<group>\"; };\n- 21637FDCB85C48C78A1E0D0F /* MaterialCommunityIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = MaterialCommunityIcons.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf\"; sourceTree = \"<group>\"; };\n- 220AE3F9742647538AAD1DD7 /* RNExitApp.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = \"wrapper.pb-project\"; name = RNExitApp.xcodeproj; path = \"../node_modules/react-native-exit-app/ios/RNExitApp.xcodeproj\"; sourceTree = \"<group>\"; };\n+ 1BACB9A55ECC42C38F5FE331 /* Feather.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Feather.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/Feather.ttf\"; sourceTree = \"<group>\"; };\n+ 1D93876C58814C70A51B11CA /* SimpleLineIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = SimpleLineIcons.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/SimpleLineIcons.ttf\"; sourceTree = \"<group>\"; };\n+ 21637FDCB85C48C78A1E0D0F /* MaterialCommunityIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = MaterialCommunityIcons.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf\"; sourceTree = \"<group>\"; };\n2D02E47B1E0B4A5D006451C7 /* SquadCal-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"SquadCal-tvOS.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n2D02E4901E0B4A5D006451C7 /* SquadCal-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = \"SquadCal-tvOSTests.xctest\"; sourceTree = BUILT_PRODUCTS_DIR; };\n2D16E6891FA4F8E400B85C8A /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; };\n- 385405DD37934EDF872A9264 /* MaterialIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = MaterialIcons.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/MaterialIcons.ttf\"; sourceTree = \"<group>\"; };\n+ 385405DD37934EDF872A9264 /* MaterialIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = MaterialIcons.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/MaterialIcons.ttf\"; sourceTree = \"<group>\"; };\n5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTAnimation.xcodeproj; path = \"../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj\"; sourceTree = \"<group>\"; };\n- 679D0ED4D6CD443282915074 /* Octicons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = Octicons.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/Octicons.ttf\"; sourceTree = \"<group>\"; };\n- 6D556981F43D459CB36250F9 /* Zocial.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = Zocial.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/Zocial.ttf\"; sourceTree = \"<group>\"; };\n- 76DBEB73A008439E97F240AC /* Entypo.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = Entypo.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/Entypo.ttf\"; sourceTree = \"<group>\"; };\n+ 679D0ED4D6CD443282915074 /* Octicons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Octicons.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/Octicons.ttf\"; sourceTree = \"<group>\"; };\n+ 6D556981F43D459CB36250F9 /* Zocial.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Zocial.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/Zocial.ttf\"; sourceTree = \"<group>\"; };\n+ 76DBEB73A008439E97F240AC /* Entypo.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Entypo.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/Entypo.ttf\"; sourceTree = \"<group>\"; };\n78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTLinking.xcodeproj; path = \"../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj\"; 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>\"; };\nAE3DE4A6CB22365D5B888510 /* libPods-SquadCalTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libPods-SquadCalTests.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\nAE948BDFEBFF0E001C92466E /* Pods-SquadCalTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = \"Pods-SquadCalTests.release.xcconfig\"; path = \"Target Support Files/Pods-SquadCalTests/Pods-SquadCalTests.release.xcconfig\"; sourceTree = \"<group>\"; };\nC31F1DCD54AFD77F728CBF09 /* Pods-SquadCalTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = \"Pods-SquadCalTests.debug.xcconfig\"; path = \"Target Support Files/Pods-SquadCalTests/Pods-SquadCalTests.debug.xcconfig\"; sourceTree = \"<group>\"; };\n- C8642FC942DA484383E738BC /* Foundation.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = Foundation.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/Foundation.ttf\"; sourceTree = \"<group>\"; };\n- D70A534A191746A08CD82B83 /* Ionicons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = Ionicons.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/Ionicons.ttf\"; sourceTree = \"<group>\"; };\n- E594F1B870984E85B20C0622 /* FontAwesome.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf\"; sourceTree = \"<group>\"; };\n- EB874B1A580F4300A923B4A0 /* EvilIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = EvilIcons.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf\"; sourceTree = \"<group>\"; };\n+ C8642FC942DA484383E738BC /* Foundation.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Foundation.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/Foundation.ttf\"; sourceTree = \"<group>\"; };\n+ D70A534A191746A08CD82B83 /* Ionicons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Ionicons.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/Ionicons.ttf\"; sourceTree = \"<group>\"; };\n+ E594F1B870984E85B20C0622 /* FontAwesome.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf\"; sourceTree = \"<group>\"; };\n+ EB874B1A580F4300A923B4A0 /* EvilIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = EvilIcons.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf\"; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n/* Begin PBXFrameworksBuildPhase section */\n00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */,\n832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,\n139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,\n- 7F164C9322701989003C98C9 /* libRNExitApp.a in Frameworks */,\n164ABF33429CFE672F0D2509 /* libPods-SquadCal.a in Frameworks */,\n);\nrunOnlyForDeploymentPostprocessing = 0;\nname = Products;\nsourceTree = \"<group>\";\n};\n- 7F3DD40720521A4C00A0D652 /* Products */ = {\n- isa = PBXGroup;\n- children = (\n- 7F3DD40B20521A4C00A0D652 /* libRNExitApp.a */,\n- );\n- name = Products;\n- sourceTree = \"<group>\";\n- };\n7F5B10C02005349C00FE096A /* Recovered References */ = {\nisa = PBXGroup;\nchildren = (\n00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */,\n832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,\n139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,\n- 220AE3F9742647538AAD1DD7 /* RNExitApp.xcodeproj */,\n);\nname = Libraries;\nsourceTree = \"<group>\";\nProductGroup = 146834001AC3E56700842450 /* Products */;\nProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;\n},\n- {\n- ProductGroup = 7F3DD40720521A4C00A0D652 /* Products */;\n- ProjectRef = 220AE3F9742647538AAD1DD7 /* RNExitApp.xcodeproj */;\n- },\n);\nprojectRoot = \"\";\ntargets = (\nremoteRef = 7F3DD40220521A4B00A0D652 /* PBXContainerItemProxy */;\nsourceTree = BUILT_PRODUCTS_DIR;\n};\n- 7F3DD40B20521A4C00A0D652 /* libRNExitApp.a */ = {\n- isa = PBXReferenceProxy;\n- fileType = archive.ar;\n- path = libRNExitApp.a;\n- remoteRef = 7F3DD40A20521A4C00A0D652 /* PBXContainerItemProxy */;\n- sourceTree = BUILT_PRODUCTS_DIR;\n- };\n7F407AEB1FF1D826006997C8 /* libfishhook.a */ = {\nisa = PBXReferenceProxy;\nfileType = archive.ar;\nremoteRef = 7F474C831F833FCA00B71135 /* PBXContainerItemProxy */;\nsourceTree = BUILT_PRODUCTS_DIR;\n};\n- 7F4C7909226064F6009F6ABE /* libRNCNetInfo-tvOS.a */ = {\n- isa = PBXReferenceProxy;\n- fileType = archive.ar;\n- path = \"libRNCNetInfo-tvOS.a\";\n- remoteRef = 7F4C7908226064F6009F6ABE /* PBXContainerItemProxy */;\n- sourceTree = BUILT_PRODUCTS_DIR;\n- };\n7F761E512201141E001B6FB7 /* libjsi.a */ = {\nisa = PBXReferenceProxy;\nfileType = archive.ar;\nremoteRef = 7F761E562201141E001B6FB7 /* PBXContainerItemProxy */;\nsourceTree = BUILT_PRODUCTS_DIR;\n};\n- 7F9DDC4E2257D85600CECAC3 /* libRCTOrientation-tvOS.a */ = {\n- isa = PBXReferenceProxy;\n- fileType = archive.ar;\n- path = \"libRCTOrientation-tvOS.a\";\n- remoteRef = 7F9DDC4D2257D85600CECAC3 /* PBXContainerItemProxy */;\n- sourceTree = BUILT_PRODUCTS_DIR;\n- };\n832341B51AAA6A8300B99B32 /* libRCTText.a */ = {\nisa = PBXReferenceProxy;\nfileType = archive.ar;\nHEADER_SEARCH_PATHS = (\n\"$(inherited)\",\n\"$(SRCROOT)/../node_modules/react-native/Libraries/LinkingIOS\",\n- \"$(SRCROOT)/../node_modules/react-native-notifications/RNNotifications\",\n- \"$(SRCROOT)/../node_modules/react-native-notifications/RNNotifications\",\n);\nINFOPLIST_FILE = SquadCal/Info.plist;\nLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\nHEADER_SEARCH_PATHS = (\n\"$(inherited)\",\n\"$(SRCROOT)/../node_modules/react-native/Libraries/LinkingIOS\",\n- \"$(SRCROOT)/../node_modules/react-native-notifications/RNNotifications\",\n- \"$(SRCROOT)/../node_modules/react-native-notifications/RNNotifications\",\n);\nINFOPLIST_FILE = SquadCal/Info.plist;\nLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n"
},
{
"change_type": "MODIFY",
"old_path": "native/package.json",
"new_path": "native/package.json",
"diff": "\"lodash\": \"^4.17.5\",\n\"react\": \"16.8.3\",\n\"react-native\": \"0.59.4\",\n- \"react-native-exit-app\": \"^1.0.0\",\n+ \"react-native-exit-app\": \"git+https://github.com/wumke/react-native-exit-app.git#460d40aaacb1aa95d7ed5f21e7906ba930c74301\",\n\"react-native-fast-image\": \"^5.2.0\",\n\"react-native-firebase\": \"^5.3.1\",\n\"react-native-floating-action\": \"^1.9.0\",\n\"react-native-in-app-notification\": \"^2.1.0\",\n\"react-native-keychain\": \"^3.0.0\",\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#aed794d8c6f0f2560b62a0012449abf6f1b3576c\",\n+ \"react-native-onepassword\": \"git+https://git@github.com/DriveWealth/react-native-onepassword.git#aed794d8c6f0f2560b62a0012449abf6f1b3576c\",\n\"react-native-orientation-locker\": \"^1.1.5\",\n\"react-native-reanimated\": \"^1.0.0\",\n\"react-native-screens\": \"1.0.0-alpha.17\",\n"
},
{
"change_type": "MODIFY",
"old_path": "yarn.lock",
"new_path": "yarn.lock",
"diff": "@@ -10496,10 +10496,9 @@ react-linkify@^0.2.2:\nprop-types \"^15.5.8\"\ntlds \"^1.57.0\"\n-react-native-exit-app@^1.0.0:\n+\"react-native-exit-app@git+https://github.com/wumke/react-native-exit-app.git#460d40aaacb1aa95d7ed5f21e7906ba930c74301\":\nversion \"1.0.0\"\n- resolved \"https://registry.yarnpkg.com/react-native-exit-app/-/react-native-exit-app-1.0.0.tgz#a2fbb121d902e6967cd8a365fe8453e5c4bc3172\"\n- integrity sha512-2d8RlzfjA4fTJaXD3xObTt0hv+7i41bDyWDB9+zOI0zS1nGvY4mtENKhte8ceRih/3eZWQLpwkkHFP1Y8AG/5w==\n+ resolved \"git+https://github.com/wumke/react-native-exit-app.git#460d40aaacb1aa95d7ed5f21e7906ba930c74301\"\nreact-native-fast-image@^5.2.0:\nversion \"5.2.0\"\n@@ -10554,9 +10553,9 @@ react-native-keychain@^3.0.0:\ncore-js \"^1.0.0\"\nuuid \"^2.0.3\"\n-\"react-native-onepassword@git+https://git@github.com/DriveWealth/react-native-onepassword#aed794d8c6f0f2560b62a0012449abf6f1b3576c\":\n+\"react-native-onepassword@git+https://git@github.com/DriveWealth/react-native-onepassword.git#aed794d8c6f0f2560b62a0012449abf6f1b3576c\":\nversion \"1.0.6\"\n- resolved \"git+https://git@github.com/DriveWealth/react-native-onepassword#aed794d8c6f0f2560b62a0012449abf6f1b3576c\"\n+ resolved \"git+https://git@github.com/DriveWealth/react-native-onepassword.git#aed794d8c6f0f2560b62a0012449abf6f1b3576c\"\ndependencies:\n\"1PasswordExtension\" \"git+https://github.com/jjshammas/onepassword-app-extension.git\"\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Use latest react-native-exit-app from GitHub
It has a Podspec |
129,187 | 24.04.2019 16:56:43 | 14,400 | 5d70f7ff1e7999872f9769d710e961819b7fb9e9 | [native] CameraRoll | [
{
"change_type": "MODIFY",
"old_path": "native/ios/Podfile",
"new_path": "native/ios/Podfile",
"diff": "@@ -16,6 +16,7 @@ target 'SquadCal' do\n'RCTAnimation',\n'RCTImage',\n'RCTLinkingIOS',\n+ 'RCTCameraRoll',\n]\npod 'yoga', :path => '../../node_modules/react-native/ReactCommon/yoga'\n"
},
{
"change_type": "MODIFY",
"old_path": "native/ios/Podfile.lock",
"new_path": "native/ios/Podfile.lock",
"diff": "@@ -87,6 +87,9 @@ PODS:\n- React/Core\n- React/RCTBlob (0.59.4):\n- React/Core\n+ - React/RCTCameraRoll (0.59.4):\n+ - React/Core\n+ - React/RCTImage\n- React/RCTImage (0.59.4):\n- React/Core\n- React/RCTNetwork\n@@ -135,6 +138,7 @@ DEPENDENCIES:\n- React/CxxBridge (from `../../node_modules/react-native`)\n- React/DevSupport (from `../../node_modules/react-native`)\n- React/RCTAnimation (from `../../node_modules/react-native`)\n+ - React/RCTCameraRoll (from `../../node_modules/react-native`)\n- React/RCTImage (from `../../node_modules/react-native`)\n- React/RCTLinkingIOS (from `../../node_modules/react-native`)\n- React/RCTNetwork (from `../../node_modules/react-native`)\n@@ -218,6 +222,6 @@ SPEC CHECKSUMS:\nSDWebImage: 3f3f0c02f09798048c47a5ed0a13f17b063572d8\nyoga: 596e61c9b57751d08a22b07aba310dbd3e65ab75\n-PODFILE CHECKSUM: 397bf9fed89dc511db29da5bead3cc6b1a4b8ab6\n+PODFILE CHECKSUM: 418ffddaaf4af58276e77925466f61f19ccf31b5\nCOCOAPODS: 1.6.1\n"
},
{
"change_type": "MODIFY",
"old_path": "native/ios/SquadCal/Info.plist",
"new_path": "native/ios/SquadCal/Info.plist",
"diff": "</dict>\n</dict>\n<key>NSLocationAlwaysUsageDescription</key>\n- <string>React Native binary makes Apple think we use this, but we don't.</string>\n+ <string>Allow $(PRODUCT_NAME) to use your location</string>\n<key>NSLocationWhenInUseUsageDescription</key>\n- <string>React Native binary makes Apple think we use this, but we don't.</string>\n+ <string>Allow $(PRODUCT_NAME) to access your location</string>\n+ <key>NSPhotoLibraryUsageDescription</key>\n+ <string>Give $(PRODUCT_NAME) permission to access your photos</string>\n+ <key>NSPhotoLibraryAddUsageDescription</key>\n+ <string>Give $(PRODUCT_NAME) permission to save photos to your camera roll</string>\n<key>UIAppFonts</key>\n<array>\n<string>OpenSans-Semibold.ttf</string>\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] CameraRoll |
129,187 | 24.04.2019 17:45:36 | 14,400 | 60ebcc2291cc9b9e567f09e1d644dc8bb555d9e4 | [native] Use different icon for message send button | [
{
"change_type": "MODIFY",
"old_path": "native/chat/chat-input-bar.react.js",
"new_path": "native/chat/chat-input-bar.react.js",
"diff": "@@ -32,7 +32,7 @@ import {\nText,\nActivityIndicator,\n} from 'react-native';\n-import Icon from 'react-native-vector-icons/FontAwesome';\n+import Icon from 'react-native-vector-icons/Ionicons';\nimport PropTypes from 'prop-types';\nimport invariant from 'invariant';\n@@ -55,7 +55,7 @@ import { nonThreadCalendarQuery } from '../selectors/nav-selectors';\nconst draftKeyFromThreadID =\n(threadID: string) => `${threadID}/message_composer`;\n-type Props = {\n+type Props = {|\nthreadInfo: ThreadInfo,\n// Redux state\nviewerID: ?string,\n@@ -73,11 +73,11 @@ type Props = {\ntext: string,\n) => Promise<SendMessageResult>,\njoinThread: (request: ClientThreadJoinRequest) => Promise<ThreadJoinPayload>,\n-};\n-type State = {\n+|};\n+type State = {|\ntext: string,\nheight: number,\n-};\n+|};\nclass ChatInputBar extends React.PureComponent<Props, State> {\nstatic propTypes = {\n@@ -174,7 +174,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nstyle={styles.sendButton}\n>\n<Icon\n- name=\"chevron-right\"\n+ name=\"md-send\"\nsize={25}\nstyle={styles.sendIcon}\ncolor=\"#88BB88\"\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Use different icon for message send button |
129,187 | 24.04.2019 20:16:41 | 14,400 | e3b457aa4dd64f7355a9cd3bfe21b1db4a1a9e16 | [native] Expanding buttons in ChatInputBar | [
{
"change_type": "MODIFY",
"old_path": "native/chat/chat-input-bar.react.js",
"new_path": "native/chat/chat-input-bar.react.js",
"diff": "@@ -20,8 +20,9 @@ import {\nimport type { LoadingStatus } from 'lib/types/loading-types';\nimport { loadingStatusPropType } from 'lib/types/loading-types';\nimport type { CalendarQuery } from 'lib/types/entry-types';\n+import type { KeyboardEvent } from '../keyboard';\n-import React from 'react';\n+import * as React from 'react';\nimport {\nView,\nStyleSheet,\n@@ -33,8 +34,10 @@ import {\nActivityIndicator,\n} from 'react-native';\nimport Icon from 'react-native-vector-icons/Ionicons';\n+import FAIcon from 'react-native-vector-icons/FontAwesome';\nimport PropTypes from 'prop-types';\nimport invariant from 'invariant';\n+import Animated, { Easing } from 'react-native-reanimated';\nimport { connect } from 'lib/utils/redux-utils';\nimport {\n@@ -51,6 +54,11 @@ import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors';\nimport Button from '../components/button.react';\nimport { nonThreadCalendarQuery } from '../selectors/nav-selectors';\n+import {\n+ addKeyboardShowListener,\n+ addKeyboardDismissListener,\n+ removeKeyboardListener,\n+} from '../keyboard';\nconst draftKeyFromThreadID =\n(threadID: string) => `${threadID}/message_composer`;\n@@ -93,6 +101,11 @@ class ChatInputBar extends React.PureComponent<Props, State> {\njoinThread: PropTypes.func.isRequired,\n};\ntextInput: ?TextInput;\n+ keyboardShowListener: ?Object;\n+ keyboardDismissListener: ?Object;\n+ cameraRollOpacity: Animated.Value;\n+ expandOpacity: Animated.Value;\n+ expandoButtonsWidth: Animated.Value;\nconstructor(props: Props) {\nsuper(props);\n@@ -100,19 +113,71 @@ class ChatInputBar extends React.PureComponent<Props, State> {\ntext: props.draft,\nheight: 0,\n};\n+ this.cameraRollOpacity = new Animated.Value(1);\n+ this.expandOpacity = Animated.sub(1, this.cameraRollOpacity);\n+ this.expandoButtonsWidth = Animated.interpolate(\n+ this.cameraRollOpacity,\n+ {\n+ inputRange: [ 0, 1 ],\n+ outputRange: [ 22, 27 ],\n+ },\n+ );\n+ }\n+\n+ componentDidMount() {\n+ this.keyboardShowListener = addKeyboardShowListener(this.hideButtons);\n+ this.keyboardDismissListener = addKeyboardDismissListener(\n+ this.expandButtons,\n+ );\n}\n- componentWillUpdate(nextProps: Props, nextState: State) {\n+ componentWillUnmount() {\n+ if (this.keyboardShowListener) {\n+ removeKeyboardListener(this.keyboardShowListener);\n+ this.keyboardShowListener = null;\n+ }\n+ if (this.keyboardDismissListener) {\n+ removeKeyboardListener(this.keyboardDismissListener);\n+ this.keyboardDismissListener = null;\n+ }\n+ }\n+\n+ componentDidUpdate(prevProps: Props, prevState: State) {\nconst currentText = this.state.text.trim();\n- const nextText = nextState.text.trim();\n+ const prevText = prevState.text.trim();\nif (\n- currentText === \"\" && nextText !== \"\" ||\n- currentText !== \"\" && nextText === \"\"\n+ currentText === \"\" && prevText !== \"\" ||\n+ currentText !== \"\" && prevText === \"\"\n) {\nLayoutAnimation.easeInEaseOut();\n}\n}\n+ get textInputStyle() {\n+ return { height: Math.max(this.state.height, 30) };\n+ }\n+\n+ get expandoButtonsStyle() {\n+ return {\n+ ...styles.expandoButtons,\n+ width: this.expandoButtonsWidth,\n+ };\n+ }\n+\n+ get cameraRollIconStyle() {\n+ return {\n+ ...styles.cameraRollIcon,\n+ opacity: this.cameraRollOpacity,\n+ };\n+ }\n+\n+ get expandIconStyle() {\n+ return {\n+ ...styles.expandIcon,\n+ opacity: this.expandOpacity,\n+ };\n+ }\n+\nrender() {\nconst isMember = viewerIsMember(this.props.threadInfo);\nlet joinButton = null;\n@@ -149,29 +214,13 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nlet content;\nif (threadHasPermission(this.props.threadInfo, threadPermissions.VOICED)) {\n- const textInputStyle = {\n- height: Math.max(this.state.height, 30),\n- };\n- const textInput = (\n- <TextInput\n- value={this.state.text}\n- onChangeText={this.updateText}\n- underlineColorAndroid=\"transparent\"\n- placeholder=\"Send a message...\"\n- placeholderTextColor=\"#888888\"\n- multiline={true}\n- onContentSizeChange={this.onContentSizeChange}\n- style={[styles.textInput, textInputStyle]}\n- ref={this.textInputRef}\n- />\n- );\nlet button = null;\nif (this.state.text.trim()) {\nbutton = (\n<TouchableOpacity\nonPress={this.onSend}\nactiveOpacity={0.4}\n- style={styles.sendButton}\n+ style={styles.bottomAligned}\n>\n<Icon\nname=\"md-send\"\n@@ -184,8 +233,36 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n}\ncontent = (\n<View style={styles.inputContainer}>\n+ <Animated.View style={this.expandoButtonsStyle}>\n+ <TouchableOpacity onPress={this.expandButtons} activeOpacity={0.4}>\n+ <Animated.View style={this.cameraRollIconStyle}>\n+ <Icon\n+ name=\"md-image\"\n+ size={25}\n+ color=\"#888888\"\n+ />\n+ </Animated.View>\n+ <Animated.View style={this.expandIconStyle}>\n+ <FAIcon\n+ name=\"chevron-right\"\n+ size={19}\n+ color=\"#888888\"\n+ />\n+ </Animated.View>\n+ </TouchableOpacity>\n+ </Animated.View>\n<View style={styles.textInputContainer}>\n- {textInput}\n+ <TextInput\n+ value={this.state.text}\n+ onChangeText={this.updateText}\n+ underlineColorAndroid=\"transparent\"\n+ placeholder=\"Send a message...\"\n+ placeholderTextColor=\"#888888\"\n+ multiline={true}\n+ onContentSizeChange={this.onContentSizeChange}\n+ style={[styles.textInput, this.textInputStyle]}\n+ ref={this.textInputRef}\n+ />\n</View>\n{button}\n</View>\n@@ -320,6 +397,20 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n});\n}\n+ expandButtons = () => {\n+ Animated.timing(\n+ this.cameraRollOpacity,\n+ { duration: 500, toValue: 1, easing: Easing.inOut(Easing.ease) },\n+ ).start();\n+ }\n+\n+ hideButtons = () => {\n+ Animated.timing(\n+ this.cameraRollOpacity,\n+ { duration: 500, toValue: 0, easing: Easing.inOut(Easing.ease) },\n+ ).start();\n+ }\n+\n}\nconst styles = StyleSheet.create({\n@@ -338,7 +429,7 @@ const styles = StyleSheet.create({\ntextInput: {\nbackgroundColor: 'white',\nmarginVertical: 5,\n- marginHorizontal: 8,\n+ marginHorizontal: 4,\npaddingVertical: 5,\npaddingHorizontal: 10,\nborderRadius: 10,\n@@ -346,14 +437,27 @@ const styles = StyleSheet.create({\nborderColor: '#AAAAAAAA',\nborderWidth: 1,\n},\n- sendButton: {\n+ bottomAligned: {\nalignSelf: 'flex-end',\npaddingBottom: 7,\n},\n+ expandoButtons: {\n+ alignSelf: 'flex-end',\n+ },\nsendIcon: {\n- paddingLeft: 2,\n+ paddingLeft: 5,\npaddingRight: 8,\n},\n+ expandIcon: {\n+ position: 'absolute',\n+ right: 0,\n+ bottom: 10,\n+ },\n+ cameraRollIcon: {\n+ position: 'absolute',\n+ right: 2,\n+ bottom: 5,\n+ },\nexplanation: {\ncolor: '#777777',\ntextAlign: 'center',\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Expanding buttons in ChatInputBar |
129,187 | 24.04.2019 21:02:31 | 14,400 | 928e095e0948fbbbd9e4afcb79c61982e2e6ff73 | react-native-keyboard-input
Includes patch-package for Podfile | [
{
"change_type": "MODIFY",
"old_path": "native/android/app/build.gradle",
"new_path": "native/android/app/build.gradle",
"diff": "@@ -163,6 +163,7 @@ dependencies {\nimplementation project(':react-native-exit-app')\nimplementation project(':react-native-vector-icons')\nimplementation project(':react-native-keychain')\n+ implementation project(':reactnativekeyboardinput')\nimplementation fileTree(dir: \"libs\", include: [\"*.jar\"])\nimplementation \"com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}\"\nimplementation \"com.facebook.react:react-native:+\" // From node_modules\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": "@@ -17,6 +17,7 @@ import org.devio.rn.splashscreen.SplashScreenReactPackage;\nimport com.github.wumke.RNExitApp.RNExitAppPackage;\nimport com.oblador.vectoricons.VectorIconsPackage;\nimport com.oblador.keychain.KeychainPackage;\n+import com.wix.reactnativekeyboardinput.KeyboardInputPackage;\nimport com.facebook.react.ReactNativeHost;\nimport com.facebook.react.ReactPackage;\nimport com.facebook.react.shell.MainReactPackage;\n@@ -50,7 +51,8 @@ public class MainApplication extends Application implements ReactApplication {\nnew SplashScreenReactPackage(),\nnew RNExitAppPackage(),\nnew VectorIconsPackage(),\n- new KeychainPackage()\n+ new KeychainPackage(),\n+ new KeyboardInputPackage(this)\n);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "native/android/settings.gradle",
"new_path": "native/android/settings.gradle",
"diff": "@@ -23,5 +23,7 @@ include ':react-native-vector-icons'\nproject(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')\ninclude ':react-native-keychain'\nproject(':react-native-keychain').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-keychain/android')\n+include ':reactnativekeyboardinput'\n+project(':reactnativekeyboardinput').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-keyboard-input/lib/android')\ninclude ':app'\n"
},
{
"change_type": "MODIFY",
"old_path": "native/ios/Podfile",
"new_path": "native/ios/Podfile",
"diff": "@@ -37,6 +37,8 @@ target 'SquadCal' do\npod 'react-native-netinfo', :path => '../../node_modules/@react-native-community/netinfo'\npod 'react-native-notifications', :path => '../../node_modules/react-native-notifications'\npod 'react-native-exit-app', :path => '../../node_modules/react-native-exit-app'\n+ pod 'react-native-keyboard-tracking-view', :path => '../../node_modules/react-native-keyboard-tracking-view'\n+ pod 'react-native-keyboard-input', :path => '../../node_modules/react-native-keyboard-input'\ntarget 'SquadCalTests' do\ninherit! :search_paths\n"
},
{
"change_type": "MODIFY",
"old_path": "native/ios/Podfile.lock",
"new_path": "native/ios/Podfile.lock",
"diff": "@@ -44,6 +44,11 @@ PODS:\n- SDWebImage/Core\n- SDWebImage/GIF\n- SDWebImage/WebP\n+ - react-native-keyboard-input (5.3.1):\n+ - React\n+ - react-native-keyboard-tracking-view\n+ - react-native-keyboard-tracking-view (5.5.0):\n+ - React\n- react-native-netinfo (2.0.0):\n- React\n- react-native-notifications (1.1.19):\n@@ -129,6 +134,8 @@ DEPENDENCIES:\n- \"react-native-async-storage (from `../../node_modules/@react-native-community/async-storage`)\"\n- react-native-exit-app (from `../../node_modules/react-native-exit-app`)\n- react-native-fast-image (from `../../node_modules/react-native-fast-image`)\n+ - react-native-keyboard-input (from `../../node_modules/react-native-keyboard-input`)\n+ - react-native-keyboard-tracking-view (from `../../node_modules/react-native-keyboard-tracking-view`)\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@@ -174,6 +181,10 @@ EXTERNAL SOURCES:\n:path: \"../../node_modules/react-native-exit-app\"\nreact-native-fast-image:\n:path: \"../../node_modules/react-native-fast-image\"\n+ react-native-keyboard-input:\n+ :path: \"../../node_modules/react-native-keyboard-input\"\n+ react-native-keyboard-tracking-view:\n+ :path: \"../../node_modules/react-native-keyboard-tracking-view\"\nreact-native-netinfo:\n:path: \"../../node_modules/@react-native-community/netinfo\"\nreact-native-notifications:\n@@ -209,6 +220,8 @@ SPEC CHECKSUMS:\nreact-native-async-storage: 6aa3086d7b4f45e49adc8e087b4a03e47279aa1b\nreact-native-exit-app: 3f9b8c2f2071f7e51fba21dfac9fc235c1764e84\nreact-native-fast-image: 21d2d84a46b12cacbe7958ab6414fe828c094f82\n+ react-native-keyboard-input: 83520632cab76a827bdf1db0aa1c87a047f7c18b\n+ react-native-keyboard-tracking-view: bf1f758a529e1e87f8a76044414b168251d59d37\nreact-native-netinfo: d6ff19d6b0fff3c617d01949f87e9976e7ecc9a9\nreact-native-notifications: bb042206ac7eab9323d528c780b3d6fe796c1f5e\nreact-native-onepassword: 5b2b7f425f9db40932703e65d350b78cbc598047\n@@ -222,6 +235,6 @@ SPEC CHECKSUMS:\nSDWebImage: 3f3f0c02f09798048c47a5ed0a13f17b063572d8\nyoga: 596e61c9b57751d08a22b07aba310dbd3e65ab75\n-PODFILE CHECKSUM: 418ffddaaf4af58276e77925466f61f19ccf31b5\n+PODFILE CHECKSUM: ffdcac0712f6be90ee5f78b3720bdbcd0237f5c5\nCOCOAPODS: 1.6.1\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": "parallelizeBuildables = \"NO\"\nbuildImplicitDependencies = \"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 = \"041095EC60FF61D42D998A5E7489090E\"\n+ BuildableName = \"libreact-native-keyboard-tracking-view.a\"\n+ BlueprintName = \"react-native-keyboard-tracking-view\"\n+ ReferencedContainer = \"container:Pods/Pods.xcodeproj\">\n+ </BuildableReference>\n+ </BuildActionEntry>\n<BuildActionEntry\nbuildForTesting = \"YES\"\nbuildForRunning = \"YES\"\n"
},
{
"change_type": "MODIFY",
"old_path": "native/package.json",
"new_path": "native/package.json",
"diff": "\"version\": \"0.0.1\",\n\"private\": true,\n\"scripts\": {\n- \"postinstall\": \"node link-workspaces.js && cd ../; npx flow-mono create-symlinks native/.flowconfig\",\n+ \"postinstall\": \"node link-workspaces.js && cd ../ && patch-package && npx flow-mono create-symlinks native/.flowconfig\",\n\"start\": \"node node_modules/react-native/local-cli/cli.js start\",\n\"test\": \"jest\",\n\"devtools\": \"react-devtools\",\n\"react-native-gesture-handler\": \"1.1.0\",\n\"react-native-hyperlink\": \"git+https://git@github.com/ashoat/react-native-hyperlink.git#both\",\n\"react-native-in-app-notification\": \"^2.1.0\",\n+ \"react-native-keyboard-input\": \"^5.3.1\",\n\"react-native-keychain\": \"^3.0.0\",\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\"get-yarn-workspaces\": \"^1.0.2\",\n\"jest\": \"^24.7.1\",\n\"metro-react-native-babel-preset\": \"^0.53.1\",\n+ \"postinstall-postinstall\": \"^2.0.0\",\n\"react-devtools\": \"^3.0.0\",\n\"react-test-renderer\": \"16.8.3\",\n\"schedule\": \"0.4.0\"\n"
},
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "\"native\",\n\"server\"\n],\n+ \"devDependencies\": {\n+ \"patch-package\": \"^6.1.2\",\n+ \"postinstall-postinstall\": \"^2.0.0\"\n+ },\n\"scripts\": {\n\"clean\": \"rm -rf node_modules/ && rm -rf lib/node_modules/ && rm -rf web/node_modules/ && rm -rf native/node_modules/ && rm -rf server/node_modules/ && rm -rf web/dist/ && rm -rf server/dist/\",\n- \"cleaninstall\": \"npm run clean && yarn\"\n+ \"cleaninstall\": \"npm run clean && yarn\",\n+ \"postinstall\": \"patch-package\"\n}\n}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "patches/react-native-keyboard-input+5.3.1.patch",
"diff": "+diff --git a/node_modules/react-native-keyboard-input/react-native-keyboard-input.podspec b/node_modules/react-native-keyboard-input/react-native-keyboard-input.podspec\n+new file mode 100644\n+index 0000000..9f724be\n+--- /dev/null\n++++ b/node_modules/react-native-keyboard-input/react-native-keyboard-input.podspec\n+@@ -0,0 +1,18 @@\n++require 'json'\n++version = JSON.parse(File.read('package.json'))[\"version\"]\n++\n++Pod::Spec.new do |s|\n++\n++ s.name = \"react-native-keyboard-input\"\n++ s.version = version\n++ s.summary = \"Keyboard Input for React Native.\"\n++ s.homepage = \"https://github.com/wix/react-native-keyboard-input\"\n++ s.license = 'MIT'\n++ s.source = { path: '.' }\n++ s.ios.deployment_target = '9.0'\n++ s.authors = { 'Leo Natan' => 'lnatan@wix.com' }\n++ s.source_files = 'lib/ios/{LNInterpolation/*,RCTCustomInputController/*}.{h,m,mm}'\n++ s.dependency 'React'\n++ s.dependency 'react-native-keyboard-tracking-view'\n++\n++end\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "patches/react-native-keyboard-tracking-view+5.5.0.patch",
"diff": "+diff --git a/node_modules/react-native-keyboard-tracking-view/react-native-keyboard-tracking-view.podspec b/node_modules/react-native-keyboard-tracking-view/react-native-keyboard-tracking-view.podspec\n+new file mode 100644\n+index 0000000..8a63c79\n+--- /dev/null\n++++ b/node_modules/react-native-keyboard-tracking-view/react-native-keyboard-tracking-view.podspec\n+@@ -0,0 +1,17 @@\n++require 'json'\n++version = JSON.parse(File.read('package.json'))[\"version\"]\n++\n++Pod::Spec.new do |s|\n++\n++ s.name = \"react-native-keyboard-tracking-view\"\n++ s.version = version\n++ s.summary = \"Keyboard Tracking View for React Native.\"\n++ s.homepage = \"https://github.com/wix/react-native-keyboard-tracking-view\"\n++ s.license = 'MIT'\n++ s.source = { path: '.' }\n++ s.ios.deployment_target = '9.0'\n++ s.authors = { 'Artal Druk' => 'artald@wix.com' }\n++ s.source_files = 'lib/*.{h,m}'\n++ s.dependency 'React'\n++\n++end\n"
},
{
"change_type": "MODIFY",
"old_path": "yarn.lock",
"new_path": "yarn.lock",
"diff": "resolved \"https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.1.tgz#5c85d662f76fa1d34575766c5dcd6615abcd30d8\"\nintegrity sha512-FZdkNBDqBRHKQ2MEbSC17xnPFOhZxeJ2YGSfr2BKf3sujG49Qe3bB+rGCwQfIaA7WHnGeGkSijX4FuBCdrzW/g==\n+\"@yarnpkg/lockfile@^1.1.0\":\n+ version \"1.1.0\"\n+ resolved \"https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31\"\n+ integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==\n+\nabab@^2.0.0:\nversion \"2.0.0\"\nresolved \"https://registry.yarnpkg.com/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f\"\n@@ -5136,6 +5141,14 @@ find-up@^2.0.0, find-up@^2.1.0:\ndependencies:\nlocate-path \"^2.0.0\"\n+find-yarn-workspace-root@^1.2.1:\n+ version \"1.2.1\"\n+ resolved \"https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-1.2.1.tgz#40eb8e6e7c2502ddfaa2577c176f221422f860db\"\n+ integrity sha512-dVtfb0WuQG+8Ag2uWkbG79hOUzEsRrhBzgfn86g2sJPkzmcpGdghbNTfUKGTxymFrY/tLIodDzLoW9nOJ4FY8Q==\n+ dependencies:\n+ fs-extra \"^4.0.3\"\n+ micromatch \"^3.1.4\"\n+\nfindup-sync@^2.0.0:\nversion \"2.0.0\"\nresolved \"https://registry.yarnpkg.com/findup-sync/-/findup-sync-2.0.0.tgz#9326b1488c22d1a6088650a86901b2d9a90a2cbc\"\n@@ -5304,6 +5317,15 @@ fs-extra@^1.0.0:\njsonfile \"^2.1.0\"\nklaw \"^1.0.0\"\n+fs-extra@^4.0.3:\n+ version \"4.0.3\"\n+ resolved \"https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94\"\n+ integrity sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==\n+ dependencies:\n+ graceful-fs \"^4.1.2\"\n+ jsonfile \"^4.0.0\"\n+ universalify \"^0.1.0\"\n+\nfs-extra@^5.0.0:\nversion \"5.0.0\"\nresolved \"https://registry.yarnpkg.com/fs-extra/-/fs-extra-5.0.0.tgz#414d0110cdd06705734d055652c5411260c31abd\"\n@@ -7411,6 +7433,13 @@ kind-of@^6.0.0, kind-of@^6.0.2:\nresolved \"https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051\"\nintegrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==\n+klaw-sync@^6.0.0:\n+ version \"6.0.0\"\n+ resolved \"https://registry.yarnpkg.com/klaw-sync/-/klaw-sync-6.0.0.tgz#1fd2cfd56ebb6250181114f0a581167099c2b28c\"\n+ integrity sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==\n+ dependencies:\n+ graceful-fs \"^4.1.11\"\n+\nklaw@^1.0.0:\nversion \"1.3.1\"\nresolved \"https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439\"\n@@ -9274,6 +9303,25 @@ pascalcase@^0.1.1:\nresolved \"https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14\"\nintegrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=\n+patch-package@^6.1.2:\n+ version \"6.1.2\"\n+ resolved \"https://registry.yarnpkg.com/patch-package/-/patch-package-6.1.2.tgz#9ed0b3defb5c34ecbef3f334ddfb13e01b3d3ff6\"\n+ integrity sha512-5GnzR8lEyeleeariG+hGabUnD2b1yL7AIGFjlLo95zMGRWhZCel58IpeKD46wwPb7i+uNhUI8unV56ogk8Bgqg==\n+ dependencies:\n+ \"@yarnpkg/lockfile\" \"^1.1.0\"\n+ chalk \"^2.4.2\"\n+ cross-spawn \"^6.0.5\"\n+ find-yarn-workspace-root \"^1.2.1\"\n+ fs-extra \"^7.0.1\"\n+ is-ci \"^2.0.0\"\n+ klaw-sync \"^6.0.0\"\n+ minimist \"^1.2.0\"\n+ rimraf \"^2.6.3\"\n+ semver \"^5.6.0\"\n+ slash \"^2.0.0\"\n+ tmp \"^0.0.33\"\n+ update-notifier \"^2.5.0\"\n+\npath-browserify@0.0.0:\nversion \"0.0.0\"\nresolved \"https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a\"\n@@ -10015,6 +10063,11 @@ postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.5:\nsource-map \"^0.6.1\"\nsupports-color \"^6.0.0\"\n+postinstall-postinstall@^2.0.0:\n+ version \"2.0.0\"\n+ resolved \"https://registry.yarnpkg.com/postinstall-postinstall/-/postinstall-postinstall-2.0.0.tgz#7ba6711b4420575c4f561638836a81faad47f43f\"\n+ integrity sha512-3f6qWexsHiT4WKtZc5DRb0FPLilHtARi5KpY4fqban/DJNn8/YhZH8U7dVKVz51WbOxEnR31gV+qYQhvEdHtdQ==\n+\nprelude-ls@~1.1.2:\nversion \"1.1.2\"\nresolved \"https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54\"\n@@ -10541,6 +10594,19 @@ react-native-in-app-notification@^2.1.0:\ndependencies:\nreact-native-swipe-gestures \"^1.0.2\"\n+react-native-keyboard-input@^5.3.1:\n+ version \"5.3.1\"\n+ resolved \"https://registry.yarnpkg.com/react-native-keyboard-input/-/react-native-keyboard-input-5.3.1.tgz#e90f43e17c070535cb54cc0be66a247f177474fc\"\n+ integrity sha512-NdKgueDFetyh77CC8veXE9jgISxatKbWkOpe3wfyPjw9O0J/c7EI5CEjSp5/ICufkvY6oLVDsZrP6TngTxTrXw==\n+ dependencies:\n+ lodash \"^4.17.4\"\n+ react-native-keyboard-tracking-view \"^5.5.0\"\n+\n+react-native-keyboard-tracking-view@^5.5.0:\n+ version \"5.5.0\"\n+ resolved \"https://registry.yarnpkg.com/react-native-keyboard-tracking-view/-/react-native-keyboard-tracking-view-5.5.0.tgz#87d28639f30e5b511de510e4063e476f23d6e4f2\"\n+ integrity sha512-e/tYhvccmLOSV+6qpU5Hlpn/U2gVu5K5F555oCUBBF229vv/V/fGoq2QyBnBEKmF9IKzBEOpzxBavUR3IfaKXw==\n+\nreact-native-keychain@^3.0.0:\nversion \"3.0.0\"\nresolved \"https://registry.yarnpkg.com/react-native-keychain/-/react-native-keychain-3.0.0.tgz#29da1dfa43c2581f76bf9420914fd38a1558cf18\"\n@@ -11407,6 +11473,13 @@ rimraf@2, rimraf@^2.2.8, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2:\ndependencies:\nglob \"^7.0.5\"\n+rimraf@^2.6.3:\n+ version \"2.6.3\"\n+ resolved \"https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab\"\n+ integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==\n+ dependencies:\n+ glob \"^7.1.3\"\n+\nrimraf@~2.2.6:\nversion \"2.2.8\"\nresolved \"https://registry.yarnpkg.com/rimraf/-/rimraf-2.2.8.tgz#e439be2aaee327321952730f99a8929e4fc50582\"\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | react-native-keyboard-input
Includes patch-package for Podfile |
129,187 | 24.04.2019 23:43:04 | 14,400 | fbdf061ca28bb5e576d98444fe29e37c0bbe7b21 | [native] ImageGalleryKeyboard | [
{
"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": "@@ -52,7 +52,7 @@ public class MainApplication extends Application implements ReactApplication {\nnew RNExitAppPackage(),\nnew VectorIconsPackage(),\nnew KeychainPackage(),\n- new KeyboardInputPackage(this)\n+ new KeyboardInputPackage(this.getApplication())\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": "@@ -38,6 +38,7 @@ import FAIcon from 'react-native-vector-icons/FontAwesome';\nimport PropTypes from 'prop-types';\nimport invariant from 'invariant';\nimport Animated, { Easing } from 'react-native-reanimated';\n+import { KeyboardAccessoryView } from 'react-native-keyboard-input';\nimport { connect } from 'lib/utils/redux-utils';\nimport {\n@@ -59,6 +60,9 @@ import {\naddKeyboardDismissListener,\nremoveKeyboardListener,\n} from '../keyboard';\n+import {\n+ imageGalleryKeyboardName,\n+} from '../media/image-gallery-keyboard.react';\nconst draftKeyFromThreadID =\n(threadID: string) => `${threadID}/message_composer`;\n@@ -85,6 +89,8 @@ type Props = {|\ntype State = {|\ntext: string,\nheight: number,\n+ buttonsExpanded: bool,\n+ customKeyboard: ?string,\n|};\nclass ChatInputBar extends React.PureComponent<Props, State> {\n@@ -112,6 +118,8 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nthis.state = {\ntext: props.draft,\nheight: 0,\n+ buttonsExpanded: true,\n+ customKeyboard: null,\n};\nthis.cameraRollOpacity = new Animated.Value(1);\nthis.expandOpacity = Animated.sub(1, this.cameraRollOpacity);\n@@ -119,7 +127,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nthis.cameraRollOpacity,\n{\ninputRange: [ 0, 1 ],\n- outputRange: [ 22, 27 ],\n+ outputRange: [ 22, 28 ],\n},\n);\n}\n@@ -151,6 +159,12 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n) {\nLayoutAnimation.easeInEaseOut();\n}\n+\n+ if (!this.state.customKeyboard && prevState.customKeyboard) {\n+ this.hideButtons();\n+ } else if (this.state.customKeyboard && !prevState.customKeyboard) {\n+ this.expandButtons();\n+ }\n}\nget textInputStyle() {\n@@ -234,14 +248,11 @@ class ChatInputBar extends React.PureComponent<Props, State> {\ncontent = (\n<View style={styles.inputContainer}>\n<Animated.View style={this.expandoButtonsStyle}>\n- <TouchableOpacity onPress={this.expandButtons} activeOpacity={0.4}>\n- <Animated.View style={this.cameraRollIconStyle}>\n- <Icon\n- name=\"md-image\"\n- size={25}\n- color=\"#888888\"\n- />\n- </Animated.View>\n+ <TouchableOpacity\n+ onPress={this.onRightmostButtonPress}\n+ activeOpacity={0.4}\n+ style={styles.expandoButtons}\n+ >\n<Animated.View style={this.expandIconStyle}>\n<FAIcon\nname=\"chevron-right\"\n@@ -249,6 +260,13 @@ class ChatInputBar extends React.PureComponent<Props, State> {\ncolor=\"#888888\"\n/>\n</Animated.View>\n+ <Animated.View style={this.cameraRollIconStyle}>\n+ <Icon\n+ name=\"md-image\"\n+ size={25}\n+ color=\"#888888\"\n+ />\n+ </Animated.View>\n</TouchableOpacity>\n</Animated.View>\n<View style={styles.textInputContainer}>\n@@ -302,6 +320,12 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n<View style={styles.container}>\n{joinButton}\n{content}\n+ <KeyboardAccessoryView\n+ kbInputRef={this.textInput}\n+ kbComponent={this.state.customKeyboard}\n+ onItemSelected={this.onImageGalleryItemSelected}\n+ onKeyboardResigned={this.hideCustomKeyboard}\n+ />\n</View>\n);\n}\n@@ -398,17 +422,40 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n}\nexpandButtons = () => {\n+ if (this.state.buttonsExpanded) {\n+ return;\n+ }\nAnimated.timing(\nthis.cameraRollOpacity,\n{ duration: 500, toValue: 1, easing: Easing.inOut(Easing.ease) },\n).start();\n+ this.setState({ buttonsExpanded: true });\n}\nhideButtons = () => {\n+ if (this.state.customKeyboard || !this.state.buttonsExpanded) {\n+ return;\n+ }\nAnimated.timing(\nthis.cameraRollOpacity,\n{ duration: 500, toValue: 0, easing: Easing.inOut(Easing.ease) },\n).start();\n+ this.setState({ buttonsExpanded: false });\n+ }\n+\n+ onRightmostButtonPress = () => {\n+ if (!this.state.buttonsExpanded) {\n+ this.expandButtons();\n+ } else {\n+ this.setState({ customKeyboard: imageGalleryKeyboardName });\n+ }\n+ }\n+\n+ hideCustomKeyboard = () => {\n+ this.setState({ customKeyboard: null });\n+ }\n+\n+ onImageGalleryItemSelected = () => {\n}\n}\n@@ -439,7 +486,7 @@ const styles = StyleSheet.create({\n},\nbottomAligned: {\nalignSelf: 'flex-end',\n- paddingBottom: 7,\n+ paddingBottom: Platform.OS === \"ios\" ? 7 : 9,\n},\nexpandoButtons: {\nalignSelf: 'flex-end',\n@@ -451,12 +498,11 @@ const styles = StyleSheet.create({\nexpandIcon: {\nposition: 'absolute',\nright: 0,\n- bottom: 10,\n+ bottom: Platform.OS === \"ios\" ? 10 : 12,\n},\ncameraRollIcon: {\n- position: 'absolute',\n- right: 2,\n- bottom: 5,\n+ paddingRight: 2,\n+ paddingBottom: Platform.OS === \"ios\" ? 5 : 8,\n},\nexplanation: {\ncolor: '#777777',\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "native/media/image-gallery-keyboard.react.js",
"diff": "+// @flow\n+\n+import * as React from 'react';\n+import PropTypes from 'prop-types';\n+import { TouchableOpacity, Text, StyleSheet } from 'react-native';\n+import { KeyboardRegistry } from 'react-native-keyboard-input';\n+\n+class ImageGalleryKeyboard extends React.PureComponent<{||}> {\n+\n+ render() {\n+ return (\n+ <TouchableOpacity onPress={this.onPress}>\n+ <Text style={styles.text}>HELOOOO!!!</Text>\n+ </TouchableOpacity>\n+ );\n+ }\n+\n+ onPress = () => {\n+ KeyboardRegistry.onItemSelected(imageGalleryKeyboardName, {});\n+ }\n+\n+}\n+\n+const styles = StyleSheet.create({\n+ text: {\n+ color: 'red',\n+ },\n+});\n+\n+const imageGalleryKeyboardName = 'ImageGalleryKeyboard';\n+\n+KeyboardRegistry.registerKeyboard(\n+ imageGalleryKeyboardName,\n+ () => ImageGalleryKeyboard,\n+);\n+\n+export {\n+ imageGalleryKeyboardName,\n+};\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] ImageGalleryKeyboard |
129,187 | 26.04.2019 17:47:49 | 14,400 | adbf99e413285813f5b467c85ab7b2ccbe2f0383 | [native] Use current master of reanimated/gesture-handler
Avoids warnings about deprecated components and require cycles | [
{
"change_type": "MODIFY",
"old_path": "native/package.json",
"new_path": "native/package.json",
"diff": "\"react-native-fast-image\": \"^5.2.0\",\n\"react-native-firebase\": \"^5.3.1\",\n\"react-native-floating-action\": \"^1.9.0\",\n- \"react-native-gesture-handler\": \"1.1.0\",\n+ \"react-native-gesture-handler\": \"git+https://git@github.com/kmagiera/react-native-gesture-handler.git#99dce5e787f0c0e87cf748bc78d32fb65fcdb0e8\",\n\"react-native-hyperlink\": \"git+https://git@github.com/ashoat/react-native-hyperlink.git#both\",\n\"react-native-in-app-notification\": \"^2.1.0\",\n\"react-native-keyboard-input\": \"^5.3.1\",\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.5\",\n- \"react-native-reanimated\": \"^1.0.0\",\n+ \"react-native-reanimated\": \"git+https://git@github.com/kmagiera/react-native-reanimated.git#0a6405dc21ed76185969a2970f642911519a59c1\",\n\"react-native-screens\": \"1.0.0-alpha.17\",\n\"react-native-segmented-control-tab\": \"^3.2.1\",\n\"react-native-splash-screen\": \"^3.1.1\",\n"
},
{
"change_type": "MODIFY",
"old_path": "yarn.lock",
"new_path": "yarn.lock",
"diff": "@@ -10571,10 +10571,9 @@ react-native-floating-action@^1.9.0:\nresolved \"https://registry.yarnpkg.com/react-native-floating-action/-/react-native-floating-action-1.13.0.tgz#876ab9227c4eda8630020a6a3adc20041870edf3\"\nintegrity sha512-KqqaEO/nIdims+reWq1pPPDptKqEuG9N8Pt+FtnuVUr35HvyWfiwBf91o9ZMRuO2S+X9AKnq+xuy1iuQK77eQQ==\n-react-native-gesture-handler@1.1.0:\n+\"react-native-gesture-handler@git+https://git@github.com/kmagiera/react-native-gesture-handler.git#99dce5e787f0c0e87cf748bc78d32fb65fcdb0e8\":\nversion \"1.1.0\"\n- resolved \"https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-1.1.0.tgz#2a7d545ad2e0ca23adce22b2af441ad360ecccee\"\n- integrity sha512-E9IKHpmL+sz/iCYkUriTUjBaQBORWV+oheYPQleADkxjo2sYsQfnlyTz4EQYFONkUwJ6WmfTNkYt2/yc5U4Ziw==\n+ resolved \"git+https://git@github.com/kmagiera/react-native-gesture-handler.git#99dce5e787f0c0e87cf748bc78d32fb65fcdb0e8\"\ndependencies:\nhoist-non-react-statics \"^2.3.1\"\ninvariant \"^2.2.2\"\n@@ -10630,10 +10629,9 @@ react-native-orientation-locker@^1.1.5:\nresolved \"https://registry.yarnpkg.com/react-native-orientation-locker/-/react-native-orientation-locker-1.1.5.tgz#695babee0e0b97a9620a12bb677792d0b9b88ef8\"\nintegrity sha512-RY2kwXK1SNq8+nQN0xVCTdi0A08FnUtzR4dOOEm2dGUUIcxSqnseE7adx5cr+oqwd0WUqb043MS+NKDPMUCmMA==\n-react-native-reanimated@^1.0.0:\n- version \"1.0.0\"\n- resolved \"https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-1.0.0.tgz#d4e356e852ec55611de565d8791542eeb25a45ae\"\n- integrity sha512-jfg+lYZ2QeeV+JMibjXwHoLDZIRVwZT2qdvDDmbAsMmxRNGI95evMPXKWa3BqkzWLb2SlZ2T/MBSGrqt/CiCAQ==\n+\"react-native-reanimated@git+https://git@github.com/kmagiera/react-native-reanimated.git#0a6405dc21ed76185969a2970f642911519a59c1\":\n+ version \"1.0.1\"\n+ resolved \"git+https://git@github.com/kmagiera/react-native-reanimated.git#0a6405dc21ed76185969a2970f642911519a59c1\"\nreact-native-safe-area-view@^0.13.0:\nversion \"0.13.1\"\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Use current master of reanimated/gesture-handler
Avoids warnings about deprecated components and require cycles |
129,187 | 30.04.2019 16:35:18 | 14,400 | 673d4db693be68783a7b9e82ebb6b7ddee77c96c | Update yarn cleaninstall to handle CocoaPods | [
{
"change_type": "MODIFY",
"old_path": "native/ios/Podfile.lock",
"new_path": "native/ios/Podfile.lock",
"diff": "@@ -112,7 +112,7 @@ PODS:\n- React\n- RNKeychain (3.0.0):\n- React\n- - RNReanimated (1.0.0):\n+ - RNReanimated (1.0.1):\n- React\n- RNScreens (1.0.0-alpha.17):\n- React\n@@ -227,9 +227,9 @@ SPEC CHECKSUMS:\nreact-native-onepassword: 5b2b7f425f9db40932703e65d350b78cbc598047\nreact-native-orientation-locker: 132a63bab4dddd2a5709f6f7935ad9676b0af7c5\nreact-native-splash-screen: 353334c5ae82d8c74501ea7cbb916cb7cb20c8bf\n- RNGestureHandler: b65d391f4f570178d657b99a16ec99d09b8656b0\n+ RNGestureHandler: 8a75e1d2f83d73aba148653252953e4bcf363b98\nRNKeychain: 3aa3cf891a09a0d18d306862ab2bb9e106079b24\n- RNReanimated: 9497464b378759f538c539df105cda235de496c5\n+ RNReanimated: c8dd490ca98a4edcba229bfa49f2516c95a43afb\nRNScreens: 000c9e6e31c9a483688943155107e4ca9394d37a\nRNVectorIcons: a3c395829c56e2cb054a0730126298bf805a2dca\nSDWebImage: 3f3f0c02f09798048c47a5ed0a13f17b063572d8\n"
},
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "\"postinstall-postinstall\": \"^2.0.0\"\n},\n\"scripts\": {\n- \"clean\": \"rm -rf node_modules/ && rm -rf lib/node_modules/ && rm -rf web/node_modules/ && rm -rf native/node_modules/ && rm -rf server/node_modules/ && rm -rf web/dist/ && rm -rf server/dist/\",\n- \"cleaninstall\": \"npm run clean && yarn\",\n+ \"clean\": \"rm -rf node_modules/ && rm -rf lib/node_modules/ && rm -rf web/node_modules/ && rm -rf native/node_modules/ && rm -rf server/node_modules/ && rm -rf web/dist/ && rm -rf server/dist/ && rm -rf native/ios/Pods\",\n+ \"cleaninstall\": \"npm run clean && yarn && pushd native/ios && pod install && popd\",\n\"postinstall\": \"patch-package\"\n}\n}\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | Update yarn cleaninstall to handle CocoaPods |
129,187 | 30.04.2019 18:26:29 | 14,400 | 5fe2b1a0058c9f2047d54196418960d5a3402787 | [native] Fix react-native-keyboard-input's access to react-native-keyboard-tracking view on iOS | [
{
"change_type": "MODIFY",
"old_path": "patches/react-native-keyboard-input+5.3.1.patch",
"new_path": "patches/react-native-keyboard-input+5.3.1.patch",
"diff": "+diff --git a/node_modules/react-native-keyboard-input/.react-native-keyboard-input.podspec.swp b/node_modules/react-native-keyboard-input/.react-native-keyboard-input.podspec.swp\n+new file mode 100644\n+index 0000000..98b73b6\n+Binary files /dev/null and b/node_modules/react-native-keyboard-input/.react-native-keyboard-input.podspec.swp differ\n+diff --git a/node_modules/react-native-keyboard-input/lib/ios/RCTCustomInputController/RCTCustomKeyboardViewController.m b/node_modules/react-native-keyboard-input/lib/ios/RCTCustomInputController/RCTCustomKeyboardViewController.m\n+index e856264..cc5ba15 100644\n+--- a/node_modules/react-native-keyboard-input/lib/ios/RCTCustomInputController/RCTCustomKeyboardViewController.m\n++++ b/node_modules/react-native-keyboard-input/lib/ios/RCTCustomInputController/RCTCustomKeyboardViewController.m\n+@@ -7,8 +7,8 @@\n+\n+ #import \"RCTCustomKeyboardViewController.h\"\n+\n+-#if __has_include(<KeyboardTrackingView/ObservingInputAccessoryView.h>)\n+- #import <KeyboardTrackingView/ObservingInputAccessoryView.h>\n++#if __has_include(<react-native-keyboard-tracking-view/ObservingInputAccessoryView.h>)\n++ #import <react-native-keyboard-tracking-view/ObservingInputAccessoryView.h>\n+ #define ObservingInputAccessoryView_IsAvailable true\n+ #endif\n+\ndiff --git a/node_modules/react-native-keyboard-input/react-native-keyboard-input.podspec b/node_modules/react-native-keyboard-input/react-native-keyboard-input.podspec\nnew file mode 100644\nindex 0000000..9f724be\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Fix react-native-keyboard-input's access to react-native-keyboard-tracking view on iOS |
129,187 | 30.04.2019 18:29:10 | 14,400 | b6c58893275d0eb2d71f529fa80eb3adc378821a | [native] Have ImageGalleryKeyboard cover home pill on iPhone X | [
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-keyboard.react.js",
"new_path": "native/media/image-gallery-keyboard.react.js",
"diff": "import * as React from 'react';\nimport PropTypes from 'prop-types';\n-import { TouchableOpacity, Text, StyleSheet } from 'react-native';\n+import { View, TouchableOpacity, Text, StyleSheet } from 'react-native';\nimport { KeyboardRegistry } from 'react-native-keyboard-input';\n+import { contentBottomOffset } from '../selectors/dimension-selectors';\n+\nclass ImageGalleryKeyboard extends React.PureComponent<{||}> {\nrender() {\nreturn (\n+ <View style={styles.container}>\n<TouchableOpacity onPress={this.onPress}>\n<Text style={styles.text}>HELOOOO!!!</Text>\n</TouchableOpacity>\n+ </View>\n);\n}\n@@ -22,6 +26,13 @@ class ImageGalleryKeyboard extends React.PureComponent<{||}> {\n}\nconst styles = StyleSheet.create({\n+ container: {\n+ position: 'absolute',\n+ top: 0,\n+ bottom: -contentBottomOffset,\n+ left: 0,\n+ right: 0,\n+ },\ntext: {\ncolor: 'red',\n},\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Have ImageGalleryKeyboard cover home pill on iPhone X |
129,187 | 01.05.2019 17:44:11 | 14,400 | 1d83bf854e2d26aa65229c1a634a6cbde1c925cf | [native] Track keyboard height | [
{
"change_type": "MODIFY",
"old_path": "native/keyboard.js",
"new_path": "native/keyboard.js",
"diff": "// @flow\n-import { AppState, Keyboard, Platform } from 'react-native';\n+import { AppState, Keyboard, Platform, DeviceInfo } from 'react-native';\ntype ScreenRect = $ReadOnly<{|\nscreenX: number,\n@@ -27,6 +27,19 @@ export type EmitterSubscription = {\n// we will call the relevant keyboard callbacks.\nconst appStateChangeDelay = 500;\n+const isIPhoneX = Platform.OS === \"ios\" && DeviceInfo.isIPhoneX_deprecated;\n+const defaultKeyboardHeight = Platform.select({\n+ ios: isIPhoneX ? 335 : 216,\n+ android: 282.28,\n+});\n+let keyboardHeight = null;\n+function getKeyboardHeight(): ?number {\n+ if (keyboardHeight !== null && keyboardHeight !== undefined) {\n+ return keyboardHeight;\n+ }\n+ return defaultKeyboardHeight;\n+}\n+\nlet currentState = AppState.currentState;\nlet recentIgnoredKeyboardEvents: IgnoredKeyboardEvent[] = [];\nfunction handleAppStateChange(nextAppState: ?string) {\n@@ -66,6 +79,12 @@ function decrementAppStateListeners() {\nfunction callCallbackIfAppActive(callback: KeyboardCallback): KeyboardCallback {\nreturn (event: KeyboardEvent) => {\n+ if (event) {\n+ const { height } = event.endCoordinates;\n+ if (height > 0 && (!keyboardHeight || keyboardHeight < height)) {\n+ keyboardHeight = height;\n+ }\n+ }\nif (currentState === \"active\") {\ncallback(event);\n} else {\n@@ -100,6 +119,7 @@ function removeKeyboardListener(listener: EmitterSubscription) {\n}\nexport {\n+ getKeyboardHeight,\naddKeyboardShowListener,\naddKeyboardDismissListener,\naddKeyboardDidDismissListener,\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Track keyboard height |
129,187 | 01.05.2019 18:13:21 | 14,400 | 9c37fe9f7a75479d05b6cf40008b291d06fca549 | [native] Set custom keyboard height on iOS from JS | [
{
"change_type": "MODIFY",
"old_path": "native/chat/chat-input-bar.react.js",
"new_path": "native/chat/chat-input-bar.react.js",
"diff": "@@ -38,7 +38,10 @@ import FAIcon from 'react-native-vector-icons/FontAwesome';\nimport PropTypes from 'prop-types';\nimport invariant from 'invariant';\nimport Animated, { Easing } from 'react-native-reanimated';\n-import { KeyboardAccessoryView } from 'react-native-keyboard-input';\n+import {\n+ KeyboardAccessoryView,\n+ TextInputKeyboardMangerIOS,\n+} from 'react-native-keyboard-input';\nimport { connect } from 'lib/utils/redux-utils';\nimport {\n@@ -56,6 +59,7 @@ import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors';\nimport Button from '../components/button.react';\nimport { nonThreadCalendarQuery } from '../selectors/nav-selectors';\nimport {\n+ getKeyboardHeight,\naddKeyboardShowListener,\naddKeyboardDismissListener,\nremoveKeyboardListener,\n@@ -164,7 +168,23 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nthis.hideButtons();\n} else if (this.state.customKeyboard && !prevState.customKeyboard) {\nthis.expandButtons();\n+ this.setIOSKeyboardHeight();\n+ }\n+ }\n+\n+ setIOSKeyboardHeight() {\n+ if (Platform.OS !== \"ios\") {\n+ return;\n+ }\n+ const { textInput } = this;\n+ if (!textInput) {\n+ return;\n+ }\n+ const keyboardHeight = getKeyboardHeight();\n+ if (keyboardHeight === null || keyboardHeight === undefined) {\n+ return;\n}\n+ TextInputKeyboardMangerIOS.setKeyboardHeight(textInput, keyboardHeight);\n}\nget textInputStyle() {\n"
},
{
"change_type": "MODIFY",
"old_path": "patches/react-native-keyboard-input+5.3.1.patch",
"new_path": "patches/react-native-keyboard-input+5.3.1.patch",
"diff": "-diff --git a/node_modules/react-native-keyboard-input/.react-native-keyboard-input.podspec.swp b/node_modules/react-native-keyboard-input/.react-native-keyboard-input.podspec.swp\n-new file mode 100644\n-index 0000000..98b73b6\n-Binary files /dev/null and b/node_modules/react-native-keyboard-input/.react-native-keyboard-input.podspec.swp differ\n+diff --git a/node_modules/react-native-keyboard-input/lib/ios/RCTCustomInputController/RCTCustomInputController.m b/node_modules/react-native-keyboard-input/lib/ios/RCTCustomInputController/RCTCustomInputController.m\n+index 2a31b47..21090bf 100644\n+--- a/node_modules/react-native-keyboard-input/lib/ios/RCTCustomInputController/RCTCustomInputController.m\n++++ b/node_modules/react-native-keyboard-input/lib/ios/RCTCustomInputController/RCTCustomInputController.m\n+@@ -222,7 +222,7 @@ -(UIView*)getFirstResponder:(UIView*)view\n+ }\n+ }\n+\n+--(void)changeKeyboardHeightForInput:(nonnull NSNumber*)inputFieldTag newHeight:(CGFloat)newHeight\n++RCT_EXPORT_METHOD(changeKeyboardHeightForInput:(nonnull NSNumber*)inputFieldTag newHeight:(CGFloat)newHeight)\n+ {\n+ UIView* inputField = [self.bridge.uiManager viewForReactTag:inputFieldTag];\n+ if(inputField != nil)\ndiff --git a/node_modules/react-native-keyboard-input/lib/ios/RCTCustomInputController/RCTCustomKeyboardViewController.m b/node_modules/react-native-keyboard-input/lib/ios/RCTCustomInputController/RCTCustomKeyboardViewController.m\nindex e856264..cc5ba15 100644\n--- a/node_modules/react-native-keyboard-input/lib/ios/RCTCustomInputController/RCTCustomKeyboardViewController.m\n@@ -41,3 +50,20 @@ index 0000000..9f724be\n+ s.dependency 'react-native-keyboard-tracking-view'\n+\n+end\n+diff --git a/node_modules/react-native-keyboard-input/src/TextInputKeyboardMangerIOS.js b/node_modules/react-native-keyboard-input/src/TextInputKeyboardMangerIOS.js\n+index 20d61c9..13a6493 100644\n+--- a/node_modules/react-native-keyboard-input/src/TextInputKeyboardMangerIOS.js\n++++ b/node_modules/react-native-keyboard-input/src/TextInputKeyboardMangerIOS.js\n+@@ -41,6 +41,12 @@ export default class TextInputKeyboardManagerIOS {\n+ }\n+ }\n+ };\n++\n++ static setKeyboardHeight(textInputRef, keyboardHeight) {\n++ const reactTag = findNodeHandle(textInputRef);\n++ CustomInputController.changeKeyboardHeightForInput(reactTag, keyboardHeight);\n++ }\n++\n+ }\n+\n+ function findNodeHandle(ref) {\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Set custom keyboard height on iOS from JS |
129,187 | 01.05.2019 18:32:03 | 14,400 | dd052fcf4db5c23ce229b76bdb18cb6b69bac21d | [native] Fix types of keyboard hide callbacks
`event` parameter can actually be `null` on Android | [
{
"change_type": "MODIFY",
"old_path": "native/calendar/calendar.react.js",
"new_path": "native/calendar/calendar.react.js",
"diff": "@@ -916,11 +916,11 @@ class InnerCalendar extends React.PureComponent<Props, State> {\nthis.keyboardPartiallyVisible = true;\n}\n- keyboardDismiss = (event: KeyboardEvent) => {\n+ keyboardDismiss = (event: ?KeyboardEvent) => {\nthis.keyboardShownHeight = null;\n}\n- keyboardDidDismiss = (event: KeyboardEvent) => {\n+ keyboardDidDismiss = (event: ?KeyboardEvent) => {\nthis.keyboardPartiallyVisible = false;\nif (!this.props.threadPickerOpen) {\nthis.setState({ disableInputBar: false });\n"
},
{
"change_type": "MODIFY",
"old_path": "native/keyboard.js",
"new_path": "native/keyboard.js",
"diff": "@@ -14,15 +14,27 @@ export type KeyboardEvent = $ReadOnly<{|\nendCoordinates: ScreenRect,\nstartCoordinates?: ScreenRect,\n|}>;\n-type KeyboardCallback = (event: KeyboardEvent) => void;\n-type IgnoredKeyboardEvent = {|\n- callback: KeyboardCallback,\n+\n+type ShowKeyboardCallback = (event: KeyboardEvent) => void;\n+type HideKeyboardCallback = (event: ?KeyboardEvent) => void;\n+type IgnoredKeyboardEvent =\n+ | {|\n+ type: \"show\",\n+ callback: ShowKeyboardCallback,\nevent: KeyboardEvent,\ntime: number,\n+ |}\n+ | {|\n+ type: \"hide\",\n+ callback: HideKeyboardCallback,\n+ event: ?KeyboardEvent,\n+ time: number,\n|};\n+\nexport type EmitterSubscription = {\n+remove: () => void,\n};\n+\n// If the app becomes active within 500ms after a keyboard event is triggered,\n// we will call the relevant keyboard callbacks.\nconst appStateChangeDelay = 500;\n@@ -53,7 +65,13 @@ function handleAppStateChange(nextAppState: ?string) {\nreturn;\n}\nfor (let ignoredEvent of ignoredEvents) {\n- if (ignoredEvent.time + appStateChangeDelay > time) {\n+ if (ignoredEvent.time + appStateChangeDelay <= time) {\n+ continue;\n+ }\n+ // Conditional necessary for Flow :(\n+ if (ignoredEvent.type === \"show\") {\n+ ignoredEvent.callback(ignoredEvent.event);\n+ } else {\nignoredEvent.callback(ignoredEvent.event);\n}\n}\n@@ -77,7 +95,9 @@ function decrementAppStateListeners() {\n}\n}\n-function callCallbackIfAppActive(callback: KeyboardCallback): KeyboardCallback {\n+function callShowCallbackIfAppActive(\n+ callback: ShowKeyboardCallback,\n+): ShowKeyboardCallback {\nreturn (event: KeyboardEvent) => {\nif (event) {\nconst { height } = event.endCoordinates;\n@@ -88,31 +108,60 @@ function callCallbackIfAppActive(callback: KeyboardCallback): KeyboardCallback {\nif (currentState === \"active\") {\ncallback(event);\n} else {\n- recentIgnoredKeyboardEvents.push({ callback, event, time: Date.now() });\n+ recentIgnoredKeyboardEvents.push({\n+ type: \"show\",\n+ callback,\n+ event,\n+ time: Date.now(),\n+ });\n}\n}\n}\n-function addKeyboardShowListener(callback: KeyboardCallback) {\n+function addKeyboardShowListener(callback: ShowKeyboardCallback) {\nincrementAppStateListeners();\nreturn Keyboard.addListener(\nPlatform.OS === \"ios\" ? \"keyboardWillShow\" : \"keyboardDidShow\",\n- callCallbackIfAppActive(callback),\n+ callShowCallbackIfAppActive(callback),\n);\n}\n-function addKeyboardDismissListener(callback: KeyboardCallback) {\n+\n+function callHideCallbackIfAppActive(\n+ callback: HideKeyboardCallback,\n+): HideKeyboardCallback {\n+ return (event: ?KeyboardEvent) => {\n+ if (event) {\n+ const { height } = event.endCoordinates;\n+ if (height > 0 && (!keyboardHeight || keyboardHeight < height)) {\n+ keyboardHeight = height;\n+ }\n+ }\n+ if (currentState === \"active\") {\n+ callback(event);\n+ } else {\n+ recentIgnoredKeyboardEvents.push({\n+ type: \"hide\",\n+ callback,\n+ event,\n+ time: Date.now(),\n+ });\n+ }\n+ }\n+}\n+function addKeyboardDismissListener(callback: HideKeyboardCallback) {\nincrementAppStateListeners();\nreturn Keyboard.addListener(\nPlatform.OS === \"ios\" ? \"keyboardWillHide\" : \"keyboardDidHide\",\n- callCallbackIfAppActive(callback),\n+ callHideCallbackIfAppActive(callback),\n);\n}\n-function addKeyboardDidDismissListener(callback: KeyboardCallback) {\n+function addKeyboardDidDismissListener(callback: HideKeyboardCallback) {\nincrementAppStateListeners();\nreturn Keyboard.addListener(\n\"keyboardDidHide\",\n- callCallbackIfAppActive(callback),\n+ callHideCallbackIfAppActive(callback),\n);\n}\n+\nfunction removeKeyboardListener(listener: EmitterSubscription) {\ndecrementAppStateListeners();\nlistener.remove();\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Fix types of keyboard hide callbacks
`event` parameter can actually be `null` on Android |
129,187 | 01.05.2019 19:07:59 | 14,400 | c4733ab994fc31d4406fcd3f488eddfdd2260d79 | [native] Don't call ChatInputBar.hideButtons when keyboard is closed | [
{
"change_type": "MODIFY",
"old_path": "native/chat/chat-input-bar.react.js",
"new_path": "native/chat/chat-input-bar.react.js",
"diff": "@@ -116,6 +116,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\ncameraRollOpacity: Animated.Value;\nexpandOpacity: Animated.Value;\nexpandoButtonsWidth: Animated.Value;\n+ keyboardShowing = false;\nconstructor(props: Props) {\nsuper(props);\n@@ -137,12 +138,22 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n}\ncomponentDidMount() {\n- this.keyboardShowListener = addKeyboardShowListener(this.hideButtons);\n+ this.keyboardShowListener = addKeyboardShowListener(this.keyboardShow);\nthis.keyboardDismissListener = addKeyboardDismissListener(\n- this.expandButtons,\n+ this.keyboardDismiss,\n);\n}\n+ keyboardShow = () => {\n+ this.keyboardShowing = true;\n+ this.hideButtons();\n+ }\n+\n+ keyboardDismiss = () => {\n+ this.keyboardShowing = false;\n+ this.expandButtons();\n+ }\n+\ncomponentWillUnmount() {\nif (this.keyboardShowListener) {\nremoveKeyboardListener(this.keyboardShowListener);\n@@ -442,7 +453,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n});\n}\n- expandButtons = () => {\n+ expandButtons() {\nif (this.state.buttonsExpanded) {\nreturn;\n}\n@@ -453,8 +464,12 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nthis.setState({ buttonsExpanded: true });\n}\n- hideButtons = () => {\n- if (this.state.customKeyboard || !this.state.buttonsExpanded) {\n+ hideButtons() {\n+ if (\n+ this.state.customKeyboard ||\n+ !this.keyboardShowing ||\n+ !this.state.buttonsExpanded\n+ ) {\nreturn;\n}\nAnimated.timing(\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Don't call ChatInputBar.hideButtons when keyboard is closed |
129,187 | 01.05.2019 19:57:46 | 14,400 | ea3b02ade1cb0ea3202f0cf75a67959d76b6f087 | [native] Fix ChatInputBar custom keyboard dismissal on Android | [
{
"change_type": "MODIFY",
"old_path": "native/chat/chat-input-bar.react.js",
"new_path": "native/chat/chat-input-bar.react.js",
"diff": "@@ -347,10 +347,9 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n}\n}\n- return (\n- <View style={styles.container}>\n- {joinButton}\n- {content}\n+ let keyboardAccessoryView = null;\n+ if (Platform.OS !== \"android\" || this.state.customKeyboard) {\n+ keyboardAccessoryView = (\n<KeyboardAccessoryView\nkbInputRef={this.textInput}\nkbComponent={this.state.customKeyboard}\n@@ -358,6 +357,14 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nonKeyboardResigned={this.hideCustomKeyboard}\nmanageScrollView={false}\n/>\n+ );\n+ }\n+\n+ return (\n+ <View style={styles.container}>\n+ {joinButton}\n+ {content}\n+ {keyboardAccessoryView}\n</View>\n);\n}\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Fix ChatInputBar custom keyboard dismissal on Android |
129,187 | 01.05.2019 21:26:18 | 14,400 | c867425d3d9dd2f024899449e4dba92bee8f6419 | [native] Dismiss custom keyboard when item selected | [
{
"change_type": "MODIFY",
"old_path": "native/chat/chat-input-bar.react.js",
"new_path": "native/chat/chat-input-bar.react.js",
"diff": "@@ -41,6 +41,7 @@ import Animated, { Easing } from 'react-native-reanimated';\nimport {\nKeyboardAccessoryView,\nTextInputKeyboardMangerIOS,\n+ KeyboardUtils,\n} from 'react-native-keyboard-input';\nimport { connect } from 'lib/utils/redux-utils';\n@@ -499,6 +500,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n}\nonImageGalleryItemSelected = () => {\n+ KeyboardUtils.dismiss();\n}\n}\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Dismiss custom keyboard when item selected |
129,187 | 01.05.2019 21:27:04 | 14,400 | 76ab69eb820ed2bccef0ddb3fae7b328c37e9b9f | [native] Set image gallery background color
Including on native in iOS | [
{
"change_type": "MODIFY",
"old_path": "native/chat/chat-input-bar.react.js",
"new_path": "native/chat/chat-input-bar.react.js",
"diff": "@@ -67,6 +67,7 @@ import {\n} from '../keyboard';\nimport {\nimageGalleryKeyboardName,\n+ imageGalleryBackgroundColor,\n} from '../media/image-gallery-keyboard.react';\nconst draftKeyFromThreadID =\n@@ -111,6 +112,9 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nsendTextMessage: PropTypes.func.isRequired,\njoinThread: PropTypes.func.isRequired,\n};\n+ static kbInitialProps = {\n+ backgroundColor: imageGalleryBackgroundColor,\n+ };\ntextInput: ?TextInput;\nkeyboardShowListener: ?Object;\nkeyboardDismissListener: ?Object;\n@@ -354,6 +358,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n<KeyboardAccessoryView\nkbInputRef={this.textInput}\nkbComponent={this.state.customKeyboard}\n+ kbInitialProps={ChatInputBar.kbInitialProps}\nonItemSelected={this.onImageGalleryItemSelected}\nonKeyboardResigned={this.hideCustomKeyboard}\nmanageScrollView={false}\n@@ -511,7 +516,7 @@ const styles = StyleSheet.create({\n},\ninputContainer: {\nflexDirection: 'row',\n- backgroundColor: '#EEEEEEEE',\n+ backgroundColor: '#EEEEEE',\nborderTopWidth: 1,\nborderColor: '#AAAAAAAA',\n},\n"
},
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-keyboard.react.js",
"new_path": "native/media/image-gallery-keyboard.react.js",
"diff": "@@ -25,6 +25,9 @@ class ImageGalleryKeyboard extends React.PureComponent<{||}> {\n}\n+const imageGalleryKeyboardName = 'ImageGalleryKeyboard';\n+const imageGalleryBackgroundColor = '#EEEEEE';\n+\nconst styles = StyleSheet.create({\ncontainer: {\nposition: 'absolute',\n@@ -32,14 +35,13 @@ const styles = StyleSheet.create({\nbottom: -contentBottomOffset,\nleft: 0,\nright: 0,\n+ backgroundColor: imageGalleryBackgroundColor,\n},\ntext: {\ncolor: 'red',\n},\n});\n-const imageGalleryKeyboardName = 'ImageGalleryKeyboard';\n-\nKeyboardRegistry.registerKeyboard(\nimageGalleryKeyboardName,\n() => ImageGalleryKeyboard,\n@@ -47,4 +49,5 @@ KeyboardRegistry.registerKeyboard(\nexport {\nimageGalleryKeyboardName,\n+ imageGalleryBackgroundColor,\n};\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Set image gallery background color
Including on native in iOS |
129,187 | 01.05.2019 22:10:35 | 14,400 | 076233c747f65987bff651d787b6a7208f3e57aa | [native] Move ListLoadingIndicator into components folder | [
{
"change_type": "MODIFY",
"old_path": "native/calendar/calendar.react.js",
"new_path": "native/calendar/calendar.react.js",
"diff": "@@ -76,7 +76,7 @@ import {\ncreateActiveTabSelector,\n} from '../selectors/nav-selectors';\nimport TextHeightMeasurer from '../text-height-measurer.react';\n-import ListLoadingIndicator from '../list-loading-indicator.react';\n+import ListLoadingIndicator from '../components/list-loading-indicator.react';\nimport SectionFooter from './section-footer.react';\nimport CalendarInputBar from './calendar-input-bar.react';\nimport {\n"
},
{
"change_type": "MODIFY",
"old_path": "native/chat/message-list.react.js",
"new_path": "native/chat/message-list.react.js",
"diff": "@@ -33,7 +33,7 @@ import {\nmessageItemHeight,\ntype ChatMessageInfoItemWithHeight,\n} from './message.react';\n-import ListLoadingIndicator from '../list-loading-indicator.react';\n+import ListLoadingIndicator from '../components/list-loading-indicator.react';\ntype Props = {|\nthreadInfo: ThreadInfo,\n"
},
{
"change_type": "RENAME",
"old_path": "native/list-loading-indicator.react.js",
"new_path": "native/components/list-loading-indicator.react.js",
"diff": ""
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Move ListLoadingIndicator into components folder |
129,187 | 01.05.2019 22:51:09 | 14,400 | 26189bf42187f65cee0df10b61ed9b8320fbe7a1 | [native] Dismiss ImageGalleryKeyboard when anything in MessageList pressed | [
{
"change_type": "MODIFY",
"old_path": "native/chat/chat-input-bar.react.js",
"new_path": "native/chat/chat-input-bar.react.js",
"diff": "@@ -32,6 +32,7 @@ import {\nPlatform,\nText,\nActivityIndicator,\n+ TouchableWithoutFeedback,\n} from 'react-native';\nimport Icon from 'react-native-vector-icons/Ionicons';\nimport FAIcon from 'react-native-vector-icons/FontAwesome';\n@@ -367,11 +368,13 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n}\nreturn (\n+ <TouchableWithoutFeedback onPress={KeyboardUtils.dismiss}>\n<View style={styles.container}>\n{joinButton}\n{content}\n{keyboardAccessoryView}\n</View>\n+ </TouchableWithoutFeedback>\n);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "native/chat/message-list.react.js",
"new_path": "native/chat/message-list.react.js",
"diff": "@@ -12,9 +12,15 @@ import type { VerticalBounds } from '../media/vertical-bounds';\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\n-import { View, StyleSheet, FlatList } from 'react-native';\n+import {\n+ View,\n+ StyleSheet,\n+ FlatList,\n+ TouchableWithoutFeedback,\n+} from 'react-native';\nimport _sum from 'lodash/fp/sum';\nimport _find from 'lodash/fp/find';\n+import { KeyboardUtils } from 'react-native-keyboard-input';\nimport { messageKey } from 'lib/shared/message-utils';\nimport { connect } from 'lib/utils/redux-utils';\n@@ -34,6 +40,11 @@ import {\ntype ChatMessageInfoItemWithHeight,\n} from './message.react';\nimport ListLoadingIndicator from '../components/list-loading-indicator.react';\n+import {\n+ addKeyboardShowListener,\n+ addKeyboardDismissListener,\n+ removeKeyboardListener,\n+} from '../keyboard';\ntype Props = {|\nthreadInfo: ThreadInfo,\n@@ -57,6 +68,7 @@ type State = {|\nfocusedMessageKey: ?string,\nscrollDisabled: bool,\nmessageListVerticalBounds: ?VerticalBounds,\n+ keyboardShowing: bool,\n|};\nclass MessageList extends React.PureComponent<Props, State> {\n@@ -74,10 +86,22 @@ class MessageList extends React.PureComponent<Props, State> {\nfocusedMessageKey: null,\nscrollDisabled: false,\nmessageListVerticalBounds: null,\n+ keyboardShowing: false,\n};\nloadingFromScroll = false;\nflatListContainer: ?View;\n+ keyboardShowListener: ?Object;\n+ keyboardDismissListener: ?Object;\n+\n+ keyboardShow = () => {\n+ this.setState({ keyboardShowing: true });\n+ }\n+\n+ keyboardDismiss = () => {\n+ this.setState({ keyboardShowing: false });\n+ }\n+\ncomponentDidMount() {\nconst { threadInfo } = this.props;\nif (!threadInChatList(threadInfo)) {\n@@ -87,6 +111,11 @@ class MessageList extends React.PureComponent<Props, State> {\nthis.props.fetchMostRecentMessages(threadInfo.id),\n);\n}\n+\n+ this.keyboardShowListener = addKeyboardShowListener(this.keyboardShow);\n+ this.keyboardDismissListener = addKeyboardDismissListener(\n+ this.keyboardDismiss,\n+ );\n}\ncomponentWillUnmount() {\n@@ -94,6 +123,15 @@ class MessageList extends React.PureComponent<Props, State> {\nif (!threadInChatList(threadInfo)) {\nthreadWatcher.removeID(threadInfo.id);\n}\n+\n+ if (this.keyboardShowListener) {\n+ removeKeyboardListener(this.keyboardShowListener);\n+ this.keyboardShowListener = null;\n+ }\n+ if (this.keyboardDismissListener) {\n+ removeKeyboardListener(this.keyboardDismissListener);\n+ this.keyboardDismissListener = null;\n+ }\n}\ncomponentDidUpdate(prevProps: Props) {\n@@ -123,7 +161,13 @@ class MessageList extends React.PureComponent<Props, State> {\nrenderItem = (row: { item: ChatMessageItemWithHeight }) => {\nif (row.item.itemType === \"loader\") {\n- return <ListLoadingIndicator />;\n+ return (\n+ <TouchableWithoutFeedback onPress={KeyboardUtils.dismiss}>\n+ <View style={styles.listLoadingIndicator}>\n+ <ListLoadingIndicator />\n+ </View>\n+ </TouchableWithoutFeedback>\n+ );\n}\nconst messageInfoItem: ChatMessageInfoItemWithHeight = row.item;\nconst focused =\n@@ -136,6 +180,7 @@ class MessageList extends React.PureComponent<Props, State> {\ntoggleFocus={this.toggleMessageFocus}\nsetScrollDisabled={this.setScrollDisabled}\nverticalBounds={this.state.messageListVerticalBounds}\n+ keyboardShowing={this.state.keyboardShowing}\n/>\n);\n}\n@@ -292,6 +337,9 @@ const styles = StyleSheet.create({\nheader: {\nheight: 12,\n},\n+ listLoadingIndicator: {\n+ flex: 1,\n+ },\n});\nregisterFetchKey(fetchMessagesBeforeCursorActionTypes);\n"
},
{
"change_type": "MODIFY",
"old_path": "native/chat/message.react.js",
"new_path": "native/chat/message.react.js",
"diff": "@@ -17,10 +17,17 @@ import {\n} from '../media/vertical-bounds';\nimport * as React from 'react';\n-import { Text, StyleSheet, View, LayoutAnimation } from 'react-native';\n+import {\n+ Text,\n+ StyleSheet,\n+ View,\n+ LayoutAnimation,\n+ TouchableWithoutFeedback,\n+} from 'react-native';\nimport _isEqual from 'lodash/fp/isEqual';\nimport invariant from 'invariant';\nimport PropTypes from 'prop-types';\n+import { KeyboardUtils } from 'react-native-keyboard-input';\nimport { longAbsoluteDate } from 'lib/utils/date-utils';\nimport { threadInfoSelector } from 'lib/selectors/thread-selectors';\n@@ -65,6 +72,7 @@ type Props = {|\ntoggleFocus: (messageKey: string) => void,\nsetScrollDisabled: (scrollDisabled: bool) => void,\nverticalBounds: ?VerticalBounds,\n+ keyboardShowing: bool,\n|};\nclass Message extends React.PureComponent<Props> {\n@@ -75,11 +83,12 @@ class Message extends React.PureComponent<Props> {\ntoggleFocus: PropTypes.func.isRequired,\nsetScrollDisabled: PropTypes.func.isRequired,\nverticalBounds: verticalBoundsPropType,\n+ keyboardShowing: PropTypes.bool.isRequired,\n};\n- componentWillReceiveProps(nextProps: Props) {\n+ componentDidUpdate(prevProps: Props) {\nif (\n- (nextProps.focused || nextProps.item.startsConversation) !==\n+ (prevProps.focused || prevProps.item.startsConversation) !==\n(this.props.focused || this.props.item.startsConversation)\n) {\nLayoutAnimation.easeInEaseOut();\n@@ -103,6 +112,7 @@ class Message extends React.PureComponent<Props> {\nfocused={this.props.focused}\ntoggleFocus={this.props.toggleFocus}\nsetScrollDisabled={this.props.setScrollDisabled}\n+ keyboardShowing={this.props.keyboardShowing}\n/>\n);\n} else if (this.props.item.messageShapeType === \"multimedia\") {\n@@ -123,10 +133,12 @@ class Message extends React.PureComponent<Props> {\n);\n}\nreturn (\n+ <TouchableWithoutFeedback onPress={KeyboardUtils.dismiss}>\n<View>\n{conversationHeader}\n{message}\n</View>\n+ </TouchableWithoutFeedback>\n);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "native/chat/text-message.react.js",
"new_path": "native/chat/text-message.react.js",
"diff": "@@ -14,6 +14,7 @@ import invariant from 'invariant';\nimport PropTypes from 'prop-types';\nimport Color from 'color';\nimport Hyperlink from 'react-native-hyperlink';\n+import { KeyboardUtils } from 'react-native-keyboard-input';\nimport { colorIsDark } from 'lib/shared/thread-utils';\nimport { messageKey } from 'lib/shared/message-utils';\n@@ -65,6 +66,7 @@ type Props = {|\nfocused: bool,\ntoggleFocus: (messageKey: string) => void,\nsetScrollDisabled: (scrollDisabled: bool) => void,\n+ keyboardShowing: bool,\n|};\nclass TextMessage extends React.PureComponent<Props> {\n@@ -73,6 +75,7 @@ class TextMessage extends React.PureComponent<Props> {\nfocused: PropTypes.bool.isRequired,\ntoggleFocus: PropTypes.func.isRequired,\nsetScrollDisabled: PropTypes.func.isRequired,\n+ keyboardShowing: PropTypes.bool.isRequired,\n};\ntooltipConfig: $ReadOnlyArray<TooltipItemData>;\ntooltip: ?Tooltip;\n@@ -142,6 +145,7 @@ class TextMessage extends React.PureComponent<Props> {\nlabelStyle={styles.popoverLabelStyle}\nonOpenTooltipMenu={this.onFocus}\nonCloseTooltipMenu={this.onBlur}\n+ onPressOverride={this.onPress}\ninnerRef={this.tooltipRef}\n/>\n</ComposedMessage>\n@@ -171,6 +175,10 @@ class TextMessage extends React.PureComponent<Props> {\n}\nonPress = () => {\n+ if (this.props.keyboardShowing) {\n+ KeyboardUtils.dismiss();\n+ return;\n+ }\nconst tooltip = this.tooltip;\ninvariant(tooltip, \"tooltip should be set\");\nif (this.props.focused) {\n"
},
{
"change_type": "MODIFY",
"old_path": "native/components/tooltip.react.js",
"new_path": "native/components/tooltip.react.js",
"diff": "@@ -48,6 +48,7 @@ type Props = {\nspringConfig?: { tension?: number, friction?: number },\nopacityChangeDuration?: number,\ninnerRef?: (tooltip: ?Tooltip) => void,\n+ onPressOverride?: () => void,\n// Redux state\ndimensions: Dimensions,\n};\n@@ -96,6 +97,7 @@ class Tooltip extends React.PureComponent<Props, State> {\nspringConfig: PropTypes.object,\nopacityChangeDuration: PropTypes.number,\ninnerRef: PropTypes.func,\n+ onPressOverride: PropTypes.func,\ndimensions: dimensionsPropType.isRequired,\n};\nstatic defaultProps = {\n@@ -310,8 +312,8 @@ class Tooltip extends React.PureComponent<Props, State> {\n<TouchableOpacity\nref={this.wrapperRef}\nstyle={this.props.componentWrapperStyle}\n- onPress={this.toggle}\n- onLongPress={this.toggle}\n+ onPress={this.onPress}\n+ onLongPress={this.onPress}\ndelayLongPress={this.props.delayLongPress}\nactiveOpacity={1.0}\n>\n@@ -376,7 +378,7 @@ class Tooltip extends React.PureComponent<Props, State> {\n],\n}}>\n<TouchableOpacity\n- onPress={this.toggle}\n+ onPress={this.onPress}\nactiveOpacity={1.0}\n>\n{this.props.buttonComponent}\n@@ -452,6 +454,14 @@ class Tooltip extends React.PureComponent<Props, State> {\n]).start(this.toggleModal);\n}\n+ onPress = () => {\n+ if (this.props.onPressOverride) {\n+ this.props.onPressOverride();\n+ } else {\n+ this.toggle();\n+ }\n+ }\n+\ntoggle = () => {\nif (this.state.isModalOpen) {\nthis.hideModal();\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Dismiss ImageGalleryKeyboard when anything in MessageList pressed |
129,187 | 01.05.2019 23:06:02 | 14,400 | 7452d8c7e63a9538c4340bb75896b5098c4f9a75 | [native] Lift imageGalleryOpen state
`react-native-keyboard-input`'s Android implementation doesn't call `Keyboard` callbacks for custom keyboards, so we need to track this state ourselves. We lift it to `MessageListContainer` and pass it down to `ChatInputBar` and `MessageList`. | [
{
"change_type": "MODIFY",
"old_path": "native/chat/chat-input-bar.react.js",
"new_path": "native/chat/chat-input-bar.react.js",
"diff": "@@ -76,6 +76,8 @@ const draftKeyFromThreadID =\ntype Props = {|\nthreadInfo: ThreadInfo,\n+ imageGalleryOpen: bool,\n+ setImageGalleryOpen: (imageGalleryOpen: bool) => void,\n// Redux state\nviewerID: ?string,\ndraft: string,\n@@ -97,12 +99,13 @@ type State = {|\ntext: string,\nheight: number,\nbuttonsExpanded: bool,\n- customKeyboard: ?string,\n|};\nclass ChatInputBar extends React.PureComponent<Props, State> {\nstatic propTypes = {\nthreadInfo: threadInfoPropType.isRequired,\n+ imageGalleryOpen: PropTypes.bool.isRequired,\n+ setImageGalleryOpen: PropTypes.func.isRequired,\nviewerID: PropTypes.string,\ndraft: PropTypes.string.isRequired,\njoinThreadLoadingStatus: loadingStatusPropType.isRequired,\n@@ -130,7 +133,6 @@ class ChatInputBar extends React.PureComponent<Props, State> {\ntext: props.draft,\nheight: 0,\nbuttonsExpanded: true,\n- customKeyboard: null,\n};\nthis.cameraRollOpacity = new Animated.Value(1);\nthis.expandOpacity = Animated.sub(1, this.cameraRollOpacity);\n@@ -181,9 +183,9 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nLayoutAnimation.easeInEaseOut();\n}\n- if (!this.state.customKeyboard && prevState.customKeyboard) {\n+ if (!this.props.imageGalleryOpen && prevProps.imageGalleryOpen) {\nthis.hideButtons();\n- } else if (this.state.customKeyboard && !prevState.customKeyboard) {\n+ } else if (this.props.imageGalleryOpen && !prevProps.imageGalleryOpen) {\nthis.expandButtons();\nthis.setIOSKeyboardHeight();\n}\n@@ -354,11 +356,14 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n}\nlet keyboardAccessoryView = null;\n- if (Platform.OS !== \"android\" || this.state.customKeyboard) {\n+ if (Platform.OS !== \"android\" || this.props.imageGalleryOpen) {\n+ const kbComponent = this.props.imageGalleryOpen\n+ ? imageGalleryKeyboardName\n+ : null;\nkeyboardAccessoryView = (\n<KeyboardAccessoryView\nkbInputRef={this.textInput}\n- kbComponent={this.state.customKeyboard}\n+ kbComponent={kbComponent}\nkbInitialProps={ChatInputBar.kbInitialProps}\nonItemSelected={this.onImageGalleryItemSelected}\nonKeyboardResigned={this.hideCustomKeyboard}\n@@ -482,7 +487,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nhideButtons() {\nif (\n- this.state.customKeyboard ||\n+ this.props.imageGalleryOpen ||\n!this.keyboardShowing ||\n!this.state.buttonsExpanded\n) {\n@@ -499,12 +504,12 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nif (!this.state.buttonsExpanded) {\nthis.expandButtons();\n} else {\n- this.setState({ customKeyboard: imageGalleryKeyboardName });\n+ this.props.setImageGalleryOpen(true);\n}\n}\nhideCustomKeyboard = () => {\n- this.setState({ customKeyboard: null });\n+ this.props.setImageGalleryOpen(false);\n}\nonImageGalleryItemSelected = () => {\n"
},
{
"change_type": "MODIFY",
"old_path": "native/chat/message-list-container.react.js",
"new_path": "native/chat/message-list-container.react.js",
"diff": "@@ -63,6 +63,7 @@ type Props = {|\ntype State = {|\ntextToMeasure: TextToMeasure[],\nlistDataWithHeights: ?$ReadOnlyArray<ChatMessageItemWithHeight>,\n+ imageGalleryOpen: bool,\n|};\nclass MessageListContainer extends React.PureComponent<Props, State> {\n@@ -110,7 +111,11 @@ class MessageListContainer extends React.PureComponent<Props, State> {\nprops.messageListData && textToMeasure.length === 0\n? this.mergeHeightsIntoListData()\n: null;\n- this.state = { textToMeasure, listDataWithHeights };\n+ this.state = {\n+ textToMeasure,\n+ listDataWithHeights,\n+ imageGalleryOpen: false,\n+ };\n}\ntextToMeasureFromListData(listData: $ReadOnlyArray<ChatMessageItem>) {\n@@ -199,6 +204,7 @@ class MessageListContainer extends React.PureComponent<Props, State> {\nthreadInfo={threadInfo}\nmessageListData={listDataWithHeights}\nnavigate={this.props.navigation.navigate}\n+ imageGalleryOpen={this.state.imageGalleryOpen}\n/>\n);\n} else {\n@@ -220,11 +226,19 @@ class MessageListContainer extends React.PureComponent<Props, State> {\nallHeightsMeasuredCallback={this.allHeightsMeasured}\n/>\n{messageList}\n- <ChatInputBar threadInfo={threadInfo} />\n+ <ChatInputBar\n+ threadInfo={threadInfo}\n+ imageGalleryOpen={this.state.imageGalleryOpen}\n+ setImageGalleryOpen={this.setImageGalleryOpen}\n+ />\n</View>\n);\n}\n+ setImageGalleryOpen = (imageGalleryOpen: bool) => {\n+ this.setState({ imageGalleryOpen });\n+ }\n+\nallHeightsMeasured = (\ntextToMeasure: TextToMeasure[],\nnewTextHeights: Map<string, number>,\n"
},
{
"change_type": "MODIFY",
"old_path": "native/chat/message-list.react.js",
"new_path": "native/chat/message-list.react.js",
"diff": "@@ -50,6 +50,7 @@ type Props = {|\nthreadInfo: ThreadInfo,\nmessageListData: $ReadOnlyArray<ChatMessageItemWithHeight>,\nnavigate: Navigate,\n+ imageGalleryOpen: bool,\n// Redux state\nviewerID: ?string,\nstartReached: bool,\n@@ -76,6 +77,7 @@ class MessageList extends React.PureComponent<Props, State> {\nthreadInfo: threadInfoPropType.isRequired,\nmessageListData: PropTypes.arrayOf(chatMessageItemPropType).isRequired,\nnavigate: PropTypes.func.isRequired,\n+ imageGalleryOpen: PropTypes.bool.isRequired,\nviewerID: PropTypes.string,\nstartReached: PropTypes.bool.isRequired,\ndispatchActionPromise: PropTypes.func.isRequired,\n@@ -172,6 +174,8 @@ class MessageList extends React.PureComponent<Props, State> {\nconst messageInfoItem: ChatMessageInfoItemWithHeight = row.item;\nconst focused =\nmessageKey(messageInfoItem.messageInfo) === this.state.focusedMessageKey;\n+ const keyboardShowing =\n+ this.state.keyboardShowing || this.props.imageGalleryOpen;\nreturn (\n<Message\nitem={messageInfoItem}\n@@ -180,7 +184,7 @@ class MessageList extends React.PureComponent<Props, State> {\ntoggleFocus={this.toggleMessageFocus}\nsetScrollDisabled={this.setScrollDisabled}\nverticalBounds={this.state.messageListVerticalBounds}\n- keyboardShowing={this.state.keyboardShowing}\n+ keyboardShowing={keyboardShowing}\n/>\n);\n}\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Lift imageGalleryOpen state
`react-native-keyboard-input`'s Android implementation doesn't call `Keyboard` callbacks for custom keyboards, so we need to track this state ourselves. We lift it to `MessageListContainer` and pass it down to `ChatInputBar` and `MessageList`. |
129,187 | 02.05.2019 14:43:27 | 14,400 | 90c9f7b4862c7988b23ec4da4c402c1d15aa2a06 | [native] Don't set keyboard height if keyboard showing for image gallery | [
{
"change_type": "MODIFY",
"old_path": "native/chat/chat-input-bar.react.js",
"new_path": "native/chat/chat-input-bar.react.js",
"diff": "@@ -192,7 +192,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n}\nsetIOSKeyboardHeight() {\n- if (Platform.OS !== \"ios\") {\n+ if (Platform.OS !== \"ios\" || this.keyboardShowing) {\nreturn;\n}\nconst { textInput } = this;\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Don't set keyboard height if keyboard showing for image gallery |
129,187 | 03.05.2019 15:16:49 | 14,400 | dc4a3e42f9971cc0a8a09f99dca874bf6064f3c7 | [lib] Don't bother sending initial platformDetails on web | [
{
"change_type": "MODIFY",
"old_path": "lib/socket/socket.react.js",
"new_path": "lib/socket/socket.react.js",
"diff": "@@ -126,7 +126,7 @@ class Socket extends React.PureComponent<Props, State> {\nlisteners: Set<SocketListener> = new Set();\npingTimeoutID: ?TimeoutID;\nmessageLastReceived: ?number;\n- initialPlatformDetailsSent = getConfig().platformDetails === \"web\";\n+ initialPlatformDetailsSent = getConfig().platformDetails.platform === \"web\";\nreopenConnectionAfterClosing = false;\ninvalidationRecoveryInProgress = false;\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [lib] Don't bother sending initial platformDetails on web |
129,187 | 03.05.2019 15:17:34 | 14,400 | 2a241a4c8e52ed6685863acc01918926911124c8 | [native] Support lack of onscreen keyboard in LoggedOutModal | [
{
"change_type": "MODIFY",
"old_path": "native/account/logged-out-modal.react.js",
"new_path": "native/account/logged-out-modal.react.js",
"diff": "@@ -735,9 +735,10 @@ class LoggedOutModal extends React.PureComponent<Props, State> {\n// If keyboard isn't currently active, keyboardShow will handle the\n// animation. This is so we can run all animations in parallel\nthis.animateToSecondMode();\n- } else if (Platform.OS === \"ios\") {\n- this.expectingKeyboardToAppear = true;\n+ return;\n}\n+ this.expectingKeyboardToAppear = true;\n+ setTimeout(this.animateToSecondIfKeyboardStillHidden, 500);\n}\nonPressRegister = () => {\n@@ -748,9 +749,18 @@ class LoggedOutModal extends React.PureComponent<Props, State> {\n// If keyboard isn't currently active, keyboardShow will handle the\n// animation. This is so we can run all animations in parallel\nthis.animateToSecondMode();\n- } else if (Platform.OS === \"ios\") {\n+ return;\n+ }\nthis.expectingKeyboardToAppear = true;\n+ setTimeout(this.animateToSecondIfKeyboardStillHidden, 500);\n}\n+\n+ animateToSecondIfKeyboardStillHidden = () => {\n+ if (!this.expectingKeyboardToAppear || !this.mounted) {\n+ return;\n+ }\n+ this.expectingKeyboardToAppear = false;\n+ this.animateToSecondMode();\n}\nonPressForgotPassword = () => {\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Support lack of onscreen keyboard in LoggedOutModal |
129,187 | 03.05.2019 17:24:21 | 14,400 | 3c609d3fed0f170d24265091938a1f1ad161b259 | [lib] Refactor update types a little bit | [
{
"change_type": "MODIFY",
"old_path": "lib/types/update-types.js",
"new_path": "lib/types/update-types.js",
"diff": "@@ -38,55 +38,76 @@ export function assertUpdateType(\nreturn ourUpdateType;\n}\n-type AccountDeletionUpdateData = {|\n- type: 0,\n+type AccountDeletionData = {|\n+ deletedUserID: string,\n+|};\n+type ThreadData = {|\n+ threadID: string,\n+|};\n+type ThreadReadStatusData = {|\n+ threadID: string,\n+ unread: bool,\n+|};\n+type ThreadDeletionData = {|\n+ threadID: string,\n+|};\n+type ThreadJoinData = {|\n+ threadID: string,\n+|};\n+type BadDeviceTokenData = {|\n+ deviceToken: string,\n+|};\n+type EntryData = {|\n+ entryID: string,\n+|};\n+type CurrentUserData = {|\n+|};\n+\n+type SharedUpdateData = {|\nuserID: string,\ntime: number,\n- deletedUserID: string,\n+|};\n+type AccountDeletionUpdateData = {|\n+ ...SharedUpdateData,\n+ ...AccountDeletionData,\n+ type: 0,\n|};\ntype ThreadUpdateData = {|\n+ ...SharedUpdateData,\n+ ...ThreadData,\ntype: 1,\n- userID: string,\n- time: number,\n- threadID: string,\n|};\ntype ThreadReadStatusUpdateData = {|\n+ ...SharedUpdateData,\n+ ...ThreadReadStatusData,\ntype: 2,\n- userID: string,\n- time: number,\n- threadID: string,\n- unread: bool,\n|};\ntype ThreadDeletionUpdateData = {|\n+ ...SharedUpdateData,\n+ ...ThreadDeletionData,\ntype: 3,\n- userID: string,\n- time: number,\n- threadID: string,\n|};\ntype ThreadJoinUpdateData = {|\n+ ...SharedUpdateData,\n+ ...ThreadJoinData,\ntype: 4,\n- userID: string,\n- time: number,\n- threadID: string,\n|};\ntype BadDeviceTokenUpdateData = {|\n+ ...SharedUpdateData,\n+ ...BadDeviceTokenData,\ntype: 5,\n- userID: string,\n- time: number,\n- deviceToken: string,\ntargetCookie: string,\n|};\ntype EntryUpdateData = {|\n+ ...SharedUpdateData,\n+ ...EntryData,\ntype: 6,\n- userID: string,\n- time: number,\n- entryID: string,\ntargetSession: string,\n|};\ntype CurrentUserUpdateData = {|\n+ ...SharedUpdateData,\n+ ...CurrentUserData,\ntype: 7,\n- userID: string,\n- time: number,\n|};\nexport type UpdateData =\n| AccountDeletionUpdateData\n@@ -98,53 +119,49 @@ export type UpdateData =\n| EntryUpdateData\n| CurrentUserUpdateData;\n-type AccountDeletionRawUpdateInfo = {|\n- type: 0,\n+type SharedRawUpdateInfo = {|\nid: string,\ntime: number,\n- deletedUserID: string,\n+|};\n+type AccountDeletionRawUpdateInfo = {|\n+ ...SharedRawUpdateInfo,\n+ ...AccountDeletionData,\n+ type: 0,\n|};\ntype ThreadRawUpdateInfo = {|\n+ ...SharedRawUpdateInfo,\n+ ...ThreadData,\ntype: 1,\n- id: string,\n- time: number,\n- threadID: string,\n|};\ntype ThreadReadStatusRawUpdateInfo = {|\n+ ...SharedRawUpdateInfo,\n+ ...ThreadReadStatusData,\ntype: 2,\n- id: string,\n- time: number,\n- threadID: string,\n- unread: bool,\n|};\ntype ThreadDeletionRawUpdateInfo = {|\n+ ...SharedRawUpdateInfo,\n+ ...ThreadDeletionData,\ntype: 3,\n- id: string,\n- time: number,\n- threadID: string,\n|};\ntype ThreadJoinRawUpdateInfo = {|\n+ ...SharedRawUpdateInfo,\n+ ...ThreadJoinData,\ntype: 4,\n- id: string,\n- time: number,\n- threadID: string,\n|};\ntype BadDeviceTokenRawUpdateInfo = {|\n+ ...SharedRawUpdateInfo,\n+ ...BadDeviceTokenData,\ntype: 5,\n- id: string,\n- time: number,\n- deviceToken: string,\n|};\ntype EntryRawUpdateInfo = {|\n+ ...SharedRawUpdateInfo,\n+ ...EntryData,\ntype: 6,\n- id: string,\n- time: number,\n- entryID: string,\n|};\ntype CurrentUserRawUpdateInfo = {|\n+ ...SharedRawUpdateInfo,\n+ ...CurrentUserData,\ntype: 7,\n- id: string,\n- time: number,\n|};\nexport type RawUpdateInfo =\n| AccountDeletionRawUpdateInfo\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [lib] Refactor update types a little bit |
129,187 | 03.05.2019 20:03:45 | 14,400 | eb80eb4695c319e5e66367108e12ed2ee3ce55d9 | [server] Allow createUpdates to be used with bot Viewer | [
{
"change_type": "MODIFY",
"old_path": "server/src/creators/update-creator.js",
"new_path": "server/src/creators/update-creator.js",
"diff": "@@ -107,14 +107,19 @@ const sortFunction = (\n// excluded from the update.\nasync function createUpdates(\nupdateDatas: $ReadOnlyArray<UpdateData>,\n- viewerInfo?: ?ViewerInfo,\n+ passedViewerInfo?: ?ViewerInfo,\n): Promise<CreateUpdatesResult> {\nif (updateDatas.length === 0) {\nreturn defaultUpdateCreationResult;\n}\n- if (viewerInfo && !viewerInfo.viewer.loggedIn) {\n+ if (passedViewerInfo && !passedViewerInfo.viewer.loggedIn) {\nthrow new ServerError('not_logged_in');\n}\n+ let viewerInfo = passedViewerInfo;\n+ if (viewerInfo && viewerInfo.viewer.isBotViewer) {\n+ // viewer.session will throw for a bot Viewer\n+ viewerInfo = null;\n+ }\nconst sortedUpdateDatas = [...updateDatas].sort(sortFunction);\n"
},
{
"change_type": "MODIFY",
"old_path": "server/src/updaters/thread-permission-updaters.js",
"new_path": "server/src/updaters/thread-permission-updaters.js",
"diff": "@@ -585,10 +585,10 @@ async function commitMembershipChangeset(\nviewer,\nserverThreadInfoFetchResult,\n);\n- const viewerInfo = viewer.isBotViewer\n- ? null\n- : { viewer, calendarQuery, ...threadInfoFetchResult };\n- const { viewerUpdates } = await createUpdates(updateDatas, viewerInfo);\n+ const { viewerUpdates } = await createUpdates(\n+ updateDatas,\n+ { viewer, calendarQuery, ...threadInfoFetchResult },\n+ );\nreturn {\n...threadInfoFetchResult,\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [server] Allow createUpdates to be used with bot Viewer |
129,187 | 03.05.2019 20:04:09 | 14,400 | 855c29a6ddc4b61ead8b34b88d8a2e438a42b496 | [server] Allow deleteAccount to be used from scripts | [
{
"change_type": "MODIFY",
"old_path": "server/src/deleters/account-deleters.js",
"new_path": "server/src/deleters/account-deleters.js",
"diff": "@@ -10,6 +10,7 @@ import { updateTypes } from 'lib/types/update-types';\nimport bcrypt from 'twin-bcrypt';\nimport { ServerError } from 'lib/utils/errors';\n+import { promiseAll } from 'lib/utils/promises';\nimport { dbQuery, SQL } from '../database';\nimport { createNewAnonymousCookie } from '../session/cookies';\n@@ -19,12 +20,13 @@ import { handleAsyncPromise } from '../responders/handlers';\nasync function deleteAccount(\nviewer: Viewer,\n- request: DeleteAccountRequest,\n-): Promise<LogOutResponse> {\n- if (!viewer.loggedIn) {\n+ request?: DeleteAccountRequest,\n+): Promise<?LogOutResponse> {\n+ if (!viewer.loggedIn || (!request && !viewer.isBotViewer)) {\nthrow new ServerError('not_logged_in');\n}\n+ if (request) {\nconst hashQuery = SQL`SELECT hash FROM users WHERE id = ${viewer.userID}`;\nconst [ result ] = await dbQuery(hashQuery);\nif (result.length === 0) {\n@@ -34,6 +36,7 @@ async function deleteAccount(\nif (!bcrypt.compareSync(request.password, row.hash)) {\nthrow new ServerError('invalid_credentials');\n}\n+ }\n// TODO: if this results in any orphaned orgs, convert them to chats\nconst deletedUserID = viewer.userID;\n@@ -55,17 +58,28 @@ async function deleteAccount(\nLEFT JOIN ids si ON si.id = s.id\nWHERE u.id = ${deletedUserID}\n`;\n- const [ anonymousViewerData ] = await Promise.all([\n- createNewAnonymousCookie({\n+\n+ const promises = {};\n+ promises.deletion = dbQuery(deletionQuery);\n+ if (request) {\n+ promises.anonymousViewerData = createNewAnonymousCookie({\nplatformDetails: viewer.platformDetails,\ndeviceToken: viewer.deviceToken,\n- }),\n- dbQuery(deletionQuery),\n- ]);\n+ });\n+ }\n+ const { anonymousViewerData } = await promiseAll(promises);\n+ if (anonymousViewerData) {\nviewer.setNewCookie(anonymousViewerData);\n+ }\n- handleAsyncPromise(createAccountDeletionUpdates(deletedUserID));\n+ const deletionUpdatesPromise = createAccountDeletionUpdates(deletedUserID);\n+ if (request) {\n+ handleAsyncPromise(deletionUpdatesPromise);\n+ } else {\n+ await deletionUpdatesPromise;\n+ }\n+ if (request) {\nreturn {\ncurrentUserInfo: {\nid: viewer.id,\n@@ -73,6 +87,8 @@ async function deleteAccount(\n},\n};\n}\n+ return null;\n+}\nasync function createAccountDeletionUpdates(\ndeletedUserID: string,\n"
},
{
"change_type": "MODIFY",
"old_path": "server/src/responders/user-responders.js",
"new_path": "server/src/responders/user-responders.js",
"diff": "@@ -20,6 +20,7 @@ import type { Viewer } from '../session/viewer';\nimport t from 'tcomb';\nimport bcrypt from 'twin-bcrypt';\n+import invariant from 'invariant';\nimport { ServerError } from 'lib/utils/errors';\nimport { promiseAll } from 'lib/utils/promises';\n@@ -152,7 +153,9 @@ async function accountDeletionResponder(\n): Promise<LogOutResponse> {\nconst request: DeleteAccountRequest = input;\nawait validateInput(viewer, deleteAccountRequestInputValidator, request);\n- return await deleteAccount(viewer, request);\n+ const result = await deleteAccount(viewer, request);\n+ invariant(result, \"deleteAccount should return result if handed request\");\n+ return result;\n}\nconst deviceTokenUpdateRequestInputValidator = tShape({\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [server] Allow deleteAccount to be used from scripts |
129,187 | 03.05.2019 20:04:35 | 14,400 | 29046e7c817b0821e320c4b73b66fa5283a75489 | [server] Script to merge one user into another
Because Larry created two accounts... | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "server/src/scripts/merge-users.js",
"diff": "+// @flow\n+\n+import { type UpdateData, updateTypes } from 'lib/types/update-types';\n+import type { ServerThreadInfo } from 'lib/types/thread-types';\n+\n+import { pool, dbQuery, SQL } from '../database';\n+import { fetchServerThreadInfos } from '../fetchers/thread-fetchers';\n+import {\n+ changeRole,\n+ commitMembershipChangeset,\n+} from '../updaters/thread-permission-updaters';\n+import { createUpdates } from '../creators/update-creator';\n+import { createBotViewer } from '../session/bots';\n+import { deleteAccount } from '../deleters/account-deleters';\n+\n+async function main() {\n+ try {\n+ await mergeUsers(\"15972\", \"7147\", { email: true });\n+ pool.end();\n+ } catch (e) {\n+ pool.end();\n+ console.warn(e);\n+ }\n+}\n+\n+type ReplaceUserInfo = $Shape<{|\n+ username: bool,\n+ email: bool,\n+ password: bool,\n+|}>;\n+async function mergeUsers(\n+ fromUserID: string,\n+ toUserID: string,\n+ replaceUserInfo?: ReplaceUserInfo,\n+) {\n+ let updateDatas = [];\n+\n+ if (replaceUserInfo) {\n+ const replaceUpdateDatas = await replaceUser(\n+ fromUserID,\n+ toUserID,\n+ replaceUserInfo,\n+ );\n+ updateDatas = [ ...updateDatas, ...replaceUpdateDatas ];\n+ }\n+\n+ const usersGettingUpdate = new Set();\n+ const usersNeedingUpdate = new Set();\n+ const needUserInfoUpdate = replaceUserInfo && replaceUserInfo.username;\n+ const setGettingUpdate = (threadInfo: ServerThreadInfo) => {\n+ if (!needUserInfoUpdate) {\n+ return;\n+ }\n+ for (let { id } of threadInfo.members) {\n+ usersGettingUpdate.add(id);\n+ usersNeedingUpdate.delete(id);\n+ }\n+ };\n+ const setNeedingUpdate = (threadInfo: ServerThreadInfo) => {\n+ if (!needUserInfoUpdate) {\n+ return;\n+ }\n+ for (let { id } of threadInfo.members) {\n+ if (!usersGettingUpdate.has(id)) {\n+ usersNeedingUpdate.add(id);\n+ }\n+ }\n+ };\n+\n+ const newThreadRolePairs = [];\n+ const { threadInfos } = await fetchServerThreadInfos();\n+ for (let threadID in threadInfos) {\n+ const threadInfo = threadInfos[threadID];\n+ const fromUserExistingMember = threadInfo.members.find(\n+ memberInfo => memberInfo.id === fromUserID,\n+ );\n+ if (!fromUserExistingMember) {\n+ setNeedingUpdate(threadInfo);\n+ continue;\n+ }\n+ const { role } = fromUserExistingMember;\n+ if (!role) {\n+ // Only transfer explicit memberships\n+ setNeedingUpdate(threadInfo);\n+ continue;\n+ }\n+ const toUserExistingMember = threadInfo.members.find(\n+ memberInfo => memberInfo.id === toUserID,\n+ );\n+ if (!toUserExistingMember || !toUserExistingMember.role) {\n+ setGettingUpdate(threadInfo);\n+ newThreadRolePairs.push([ threadID, role ]);\n+ } else {\n+ setNeedingUpdate(threadInfo);\n+ }\n+ }\n+\n+ const time = Date.now();\n+ for (let userID of usersNeedingUpdate) {\n+ updateDatas.push({\n+ type: updateTypes.UPDATE_USER,\n+ userID,\n+ time,\n+ updatedUserID: toUserID,\n+ });\n+ }\n+ await createUpdates(updateDatas);\n+\n+ const changesets = await Promise.all(newThreadRolePairs.map(\n+ ([ threadID, role ]) => changeRole(threadID, [ toUserID ], role),\n+ ));\n+ let changeset = [];\n+ for (let currentChangeset of changesets) {\n+ if (!currentChangeset) {\n+ throw new Error(\"changeRole returned null\");\n+ }\n+ changeset = [ ...changeset, ...currentChangeset ];\n+ }\n+ if (changeset.length > 0) {\n+ const toViewer = createBotViewer(toUserID);\n+ await commitMembershipChangeset(toViewer, changeset);\n+ }\n+\n+ const fromViewer = createBotViewer(fromUserID);\n+ await deleteAccount(fromViewer);\n+}\n+\n+async function replaceUser(\n+ fromUserID: string,\n+ toUserID: string,\n+ replaceUserInfo: ReplaceUserInfo,\n+): Promise<UpdateData[]> {\n+ if (Object.keys(replaceUserInfo).length === 0) {\n+ return [];\n+ }\n+\n+ const fromUserQuery = SQL`\n+ SELECT username, hash, email, email_verified\n+ FROM users\n+ WHERE id = ${fromUserID}\n+ `;\n+ const [ fromUserResult ] = await dbQuery(fromUserQuery);\n+ const [ firstResult ] = fromUserResult;\n+ if (!firstResult) {\n+ throw new Error(`couldn't fetch fromUserID ${fromUserID}`);\n+ }\n+\n+ const changedFields = {};\n+ if (replaceUserInfo.username) {\n+ changedFields.username = firstResult.username;\n+ }\n+ if (replaceUserInfo.email) {\n+ changedFields.email = firstResult.email;\n+ changedFields.email_verified = firstResult.email_verified;\n+ }\n+ if (replaceUserInfo.password) {\n+ changedFields.hash = firstResult.hash;\n+ }\n+\n+ const updateUserRowQuery = SQL`\n+ UPDATE users SET ${changedFields} WHERE id = ${toUserID}\n+ `;\n+ await dbQuery(updateUserRowQuery);\n+\n+ const updateDatas = [];\n+ if (replaceUserInfo.username || replaceUserInfo.email) {\n+ updateDatas.push({\n+ type: updateTypes.UPDATE_CURRENT_USER,\n+ userID: toUserID,\n+ time: Date.now(),\n+ });\n+ }\n+ return updateDatas;\n+}\n+\n+main();\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [server] Script to merge one user into another
Because Larry created two accounts... |
129,187 | 03.05.2019 20:25:49 | 14,400 | 59a27f46d1d90931848fb35397c667e264845898 | [server] Dry run support | [
{
"change_type": "MODIFY",
"old_path": "server/src/database.js",
"new_path": "server/src/database.js",
"diff": "@@ -5,6 +5,7 @@ import mysql from 'mysql2';\nimport SQL from 'sql-template-strings';\nimport dbConfig from '../secrets/db_config';\n+import { isDryRun } from './scripts/dry-run';\nconst SQLStatement = SQL.SQLStatement;\n@@ -57,8 +58,25 @@ function mergeOrConditions(andConditions: $ReadOnlyArray<SQLStatement>) {\nreturn mergeConditions(andConditions, SQL` OR `);\n}\n+// We use this fake result for dry runs\n+function FakeSQLResult() {\n+ this.insertId = -1;\n+}\n+FakeSQLResult.prototype = Array.prototype;\n+const fakeResult: any = new FakeSQLResult();\n+\nasync function dbQuery(statement: SQLStatement) {\ntry {\n+ const sql = statement.sql.trim();\n+ if (\n+ isDryRun() &&\n+ (sql.startsWith(\"INSERT\") ||\n+ sql.startsWith(\"DELETE\") ||\n+ sql.startsWith(\"UPDATE\"))\n+ ) {\n+ console.log(rawSQL(statement));\n+ return [ fakeResult ];\n+ }\nreturn await pool.query(statement);\n} catch (e) {\ne.query = statement.sql;\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "server/src/scripts/dry-run.js",
"diff": "+// @flow\n+\n+// I flip this bit when testing things sometimes\n+const dryRun = false;\n+function isDryRun() {\n+ return dryRun;\n+}\n+\n+export {\n+ isDryRun,\n+};\n"
},
{
"change_type": "MODIFY",
"old_path": "server/src/socket/redis.js",
"new_path": "server/src/socket/redis.js",
"diff": "@@ -11,6 +11,8 @@ import {\nimport redis from 'redis';\nimport uuidv4 from 'uuid/v4';\n+import { isDryRun } from '../scripts/dry-run';\n+\nfunction channelNameForUpdateTarget(updateTarget: UpdateTarget): string {\nif (updateTarget.sessionID) {\nreturn `user.${updateTarget.userID}.${updateTarget.sessionID}`;\n@@ -28,10 +30,13 @@ class RedisPublisher {\n}\nsendMessage(target: UpdateTarget, message: RedisMessage) {\n- this.pub.publish(\n- channelNameForUpdateTarget(target),\n- JSON.stringify(message),\n- );\n+ const channelName = channelNameForUpdateTarget(target);\n+ const stringifiedMessage = JSON.stringify(message);\n+ if (isDryRun()) {\n+ console.log(`Redis publish to ${channelName}: ${stringifiedMessage}`);\n+ return;\n+ }\n+ this.pub.publish(channelName, stringifiedMessage);\n}\n}\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [server] Dry run support |
129,187 | 03.05.2019 20:35:43 | 14,400 | 0b81ec6cbc46da5c15548c3f3a5f629a90e06baa | [server] createScriptViewer | [
{
"change_type": "MODIFY",
"old_path": "server/src/creators/update-creator.js",
"new_path": "server/src/creators/update-creator.js",
"diff": "@@ -116,8 +116,8 @@ async function createUpdates(\nthrow new ServerError('not_logged_in');\n}\nlet viewerInfo = passedViewerInfo;\n- if (viewerInfo && viewerInfo.viewer.isBotViewer) {\n- // viewer.session will throw for a bot Viewer\n+ if (viewerInfo && viewerInfo.viewer.isScriptViewer) {\n+ // viewer.session will throw for a script Viewer\nviewerInfo = null;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "server/src/deleters/account-deleters.js",
"new_path": "server/src/deleters/account-deleters.js",
"diff": "@@ -22,7 +22,7 @@ async function deleteAccount(\nviewer: Viewer,\nrequest?: DeleteAccountRequest,\n): Promise<?LogOutResponse> {\n- if (!viewer.loggedIn || (!request && !viewer.isBotViewer)) {\n+ if (!viewer.loggedIn || (!request && !viewer.isScriptViewer)) {\nthrow new ServerError('not_logged_in');\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "server/src/scripts/merge-users.js",
"new_path": "server/src/scripts/merge-users.js",
"diff": "@@ -10,7 +10,7 @@ import {\ncommitMembershipChangeset,\n} from '../updaters/thread-permission-updaters';\nimport { createUpdates } from '../creators/update-creator';\n-import { createBotViewer } from '../session/bots';\n+import { createScriptViewer } from '../session/scripts';\nimport { deleteAccount } from '../deleters/account-deleters';\nasync function main() {\n@@ -117,11 +117,11 @@ async function mergeUsers(\nchangeset = [ ...changeset, ...currentChangeset ];\n}\nif (changeset.length > 0) {\n- const toViewer = createBotViewer(toUserID);\n+ const toViewer = createScriptViewer(toUserID);\nawait commitMembershipChangeset(toViewer, changeset);\n}\n- const fromViewer = createBotViewer(fromUserID);\n+ const fromViewer = createScriptViewer(fromUserID);\nawait deleteAccount(fromViewer);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "server/src/session/bots.js",
"new_path": "server/src/session/bots.js",
"diff": "@@ -30,7 +30,7 @@ function createBotViewer(userID: string): Viewer {\ncookiePassword: null,\nsessionID: null,\nsessionInfo: null,\n- isBotViewer: true,\n+ isScriptViewer: true,\n});\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "server/src/session/cookies.js",
"new_path": "server/src/session/cookies.js",
"diff": "@@ -150,7 +150,7 @@ async function fetchUserViewer(\nsessionIdentifierType: sessionParameterInfo.sessionIdentifierType,\nsessionID,\nsessionInfo,\n- isBotViewer: false,\n+ isScriptViewer: false,\n});\nreturn { type: \"valid\", viewer };\n}\n@@ -232,7 +232,7 @@ async function fetchAnonymousViewer(\nsessionIdentifierType: sessionParameterInfo.sessionIdentifierType,\nsessionID,\nsessionInfo,\n- isBotViewer: false,\n+ isScriptViewer: false,\n});\nreturn { type: \"valid\", viewer };\n}\n@@ -592,7 +592,7 @@ async function createNewAnonymousCookie(\nsessionID: undefined,\nsessionInfo: null,\ncookieInsertedThisRequest: true,\n- isBotViewer: false,\n+ isScriptViewer: false,\n};\n}\n@@ -651,7 +651,7 @@ async function createNewUserCookie(\nsessionInfo: null,\ncookiePassword,\ncookieInsertedThisRequest: true,\n- isBotViewer: false,\n+ isScriptViewer: false,\n};\n}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "server/src/session/scripts.js",
"diff": "+// @flow\n+\n+import { Viewer } from './viewer';\n+\n+// Note that since the returned Viewer doesn't have a valid cookieID or\n+// sessionID, a lot of things can go wrong when trying to use it with certain\n+// functions.\n+function createScriptViewer(userID: string): Viewer {\n+ return new Viewer({\n+ isSocket: true,\n+ loggedIn: true,\n+ id: userID,\n+ platformDetails: null,\n+ deviceToken: null,\n+ userID,\n+ cookieID: null,\n+ cookiePassword: null,\n+ sessionID: null,\n+ sessionInfo: null,\n+ isScriptViewer: true,\n+ });\n+}\n+\n+export {\n+ createScriptViewer,\n+};\n"
},
{
"change_type": "MODIFY",
"old_path": "server/src/session/viewer.js",
"new_path": "server/src/session/viewer.js",
"diff": "@@ -26,7 +26,7 @@ export type UserViewerData = {|\n+sessionIdentifierType?: SessionIdentifierType,\n+sessionID: ?string,\n+sessionInfo: ?SessionInfo,\n- +isBotViewer: bool,\n+ +isScriptViewer: bool,\n+isSocket?: bool,\n|};\n@@ -42,7 +42,7 @@ export type AnonymousViewerData = {|\n+sessionIdentifierType?: SessionIdentifierType,\n+sessionID: ?string,\n+sessionInfo: ?SessionInfo,\n- +isBotViewer: bool,\n+ +isScriptViewer: bool,\n+isSocket?: bool,\n|};\n@@ -273,8 +273,8 @@ class Viewer {\nreturn this.data.deviceToken;\n}\n- get isBotViewer(): bool {\n- return this.data.isBotViewer;\n+ get isScriptViewer(): bool {\n+ return this.data.isScriptViewer;\n}\nget isSocket(): bool {\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [server] createScriptViewer |
129,187 | 03.05.2019 20:52:22 | 14,400 | 8d0f11c5474f646ff8e1d3736386aa153340ca0a | [server] endScript | [
{
"change_type": "MODIFY",
"old_path": "server/flow-typed/npm/redis_v2.x.x.js",
"new_path": "server/flow-typed/npm/redis_v2.x.x.js",
"diff": "@@ -249,6 +249,7 @@ declare module \"redis\" {\nincrement: number,\ncallback: (error: ?Error, result: ?string) => void\n) => void;\n+ unref: () => void;\n}\ndeclare class RedisClientPromisified extends RedisClient {\n"
},
{
"change_type": "MODIFY",
"old_path": "server/src/scripts/image-size.js",
"new_path": "server/src/scripts/image-size.js",
"diff": "import sizeOf from 'buffer-image-size';\n-import { pool, dbQuery, SQL } from '../database';\n+import { dbQuery, SQL } from '../database';\n+import { endScript } from './utils';\nasync function main() {\ntry {\nawait addImageSizeToUploadsTable();\n- pool.end();\n+ endScript();\n} catch (e) {\n- pool.end();\n+ endScript();\nconsole.warn(e);\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "server/src/scripts/merge-users.js",
"new_path": "server/src/scripts/merge-users.js",
"diff": "import { type UpdateData, updateTypes } from 'lib/types/update-types';\nimport type { ServerThreadInfo } from 'lib/types/thread-types';\n-import { pool, dbQuery, SQL } from '../database';\n+import { dbQuery, SQL } from '../database';\nimport { fetchServerThreadInfos } from '../fetchers/thread-fetchers';\nimport {\nchangeRole,\n@@ -12,13 +12,14 @@ import {\nimport { createUpdates } from '../creators/update-creator';\nimport { createScriptViewer } from '../session/scripts';\nimport { deleteAccount } from '../deleters/account-deleters';\n+import { endScript } from './utils';\nasync function main() {\ntry {\nawait mergeUsers(\"15972\", \"7147\", { email: true });\n- pool.end();\n+ endScript();\n} catch (e) {\n- pool.end();\n+ endScript();\nconsole.warn(e);\n}\n}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "server/src/scripts/utils.js",
"diff": "+// @flow\n+\n+import { pool } from '../database';\n+import { publisher } from '../socket/redis';\n+\n+function endScript() {\n+ pool.end();\n+ publisher.end();\n+}\n+\n+export {\n+ endScript,\n+};\n"
},
{
"change_type": "MODIFY",
"old_path": "server/src/socket/redis.js",
"new_path": "server/src/socket/redis.js",
"diff": "@@ -39,6 +39,10 @@ class RedisPublisher {\nthis.pub.publish(channelName, stringifiedMessage);\n}\n+ end() {\n+ this.pub.unref();\n+ }\n+\n}\nconst publisher = new RedisPublisher();\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [server] endScript |
129,187 | 03.05.2019 21:00:24 | 14,400 | 17dd0b40241ae4942c0124cc2fd7b47994cc98ea | [server] Don't update toUser user row until deleting fromUser user row
To avoid violating SQL constraints. | [
{
"change_type": "MODIFY",
"old_path": "server/src/scripts/merge-users.js",
"new_path": "server/src/scripts/merge-users.js",
"diff": "import { type UpdateData, updateTypes } from 'lib/types/update-types';\nimport type { ServerThreadInfo } from 'lib/types/thread-types';\n-import { dbQuery, SQL } from '../database';\n+import { dbQuery, SQL, SQLStatement } from '../database';\nimport { fetchServerThreadInfos } from '../fetchers/thread-fetchers';\nimport {\nchangeRole,\n@@ -34,15 +34,18 @@ async function mergeUsers(\ntoUserID: string,\nreplaceUserInfo?: ReplaceUserInfo,\n) {\n+ let updateUserRowQuery = null;\nlet updateDatas = [];\n-\nif (replaceUserInfo) {\n- const replaceUpdateDatas = await replaceUser(\n+ const replaceUserResult = await replaceUser(\nfromUserID,\ntoUserID,\nreplaceUserInfo,\n);\n- updateDatas = [ ...updateDatas, ...replaceUpdateDatas ];\n+ ({\n+ sql: updateUserRowQuery,\n+ updateDatas,\n+ } = replaceUserResult);\n}\nconst usersGettingUpdate = new Set();\n@@ -124,15 +127,26 @@ async function mergeUsers(\nconst fromViewer = createScriptViewer(fromUserID);\nawait deleteAccount(fromViewer);\n+\n+ if (updateUserRowQuery) {\n+ await dbQuery(updateUserRowQuery);\n+ }\n}\n+type ReplaceUserResult = {|\n+ sql: ?SQLStatement,\n+ updateDatas: UpdateData[],\n+|};\nasync function replaceUser(\nfromUserID: string,\ntoUserID: string,\nreplaceUserInfo: ReplaceUserInfo,\n-): Promise<UpdateData[]> {\n+): Promise<ReplaceUserResult> {\nif (Object.keys(replaceUserInfo).length === 0) {\n- return [];\n+ return {\n+ sql: null,\n+ updateDatas: [],\n+ };\n}\nconst fromUserQuery = SQL`\n@@ -161,7 +175,6 @@ async function replaceUser(\nconst updateUserRowQuery = SQL`\nUPDATE users SET ${changedFields} WHERE id = ${toUserID}\n`;\n- await dbQuery(updateUserRowQuery);\nconst updateDatas = [];\nif (replaceUserInfo.username || replaceUserInfo.email) {\n@@ -171,7 +184,10 @@ async function replaceUser(\ntime: Date.now(),\n});\n}\n- return updateDatas;\n+ return {\n+ sql: updateUserRowQuery,\n+ updateDatas,\n+ };\n}\nmain();\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [server] Don't update toUser user row until deleting fromUser user row
To avoid violating SQL constraints. |
129,187 | 03.05.2019 21:07:05 | 14,400 | f5f2f7478b237c113bc7c7b6884f91b3aacd6b3f | [server] Allow pod install to fail
This is to fix server push script | [
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "},\n\"scripts\": {\n\"clean\": \"rm -rf node_modules/ && rm -rf lib/node_modules/ && rm -rf web/node_modules/ && rm -rf native/node_modules/ && rm -rf server/node_modules/ && rm -rf web/dist/ && rm -rf server/dist/ && rm -rf native/ios/Pods\",\n- \"cleaninstall\": \"npm run clean && yarn && cd native/ios && pod install\",\n+ \"cleaninstall\": \"npm run clean && yarn && cd native/ios && (pod install || true)\",\n\"postinstall\": \"patch-package\"\n}\n}\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [server] Allow pod install to fail
This is to fix server push script |
129,187 | 03.05.2019 21:22:27 | 14,400 | 618e2e9d28be7182e7229f5b9feef765c54639a0 | [server] Final tuning for merge-users script | [
{
"change_type": "MODIFY",
"old_path": "server/src/scripts/merge-users.js",
"new_path": "server/src/scripts/merge-users.js",
"diff": "@@ -16,7 +16,7 @@ import { endScript } from './utils';\nasync function main() {\ntry {\n- await mergeUsers(\"15972\", \"7147\", { email: true });\n+ await mergeUsers(\"7147\", \"15972\", { username: true, password: true });\nendScript();\n} catch (e) {\nendScript();\n@@ -99,6 +99,13 @@ async function mergeUsers(\n}\n}\n+ const fromViewer = createScriptViewer(fromUserID);\n+ await deleteAccount(fromViewer);\n+\n+ if (updateUserRowQuery) {\n+ await dbQuery(updateUserRowQuery);\n+ }\n+\nconst time = Date.now();\nfor (let userID of usersNeedingUpdate) {\nupdateDatas.push({\n@@ -124,13 +131,6 @@ async function mergeUsers(\nconst toViewer = createScriptViewer(toUserID);\nawait commitMembershipChangeset(toViewer, changeset);\n}\n-\n- const fromViewer = createScriptViewer(fromUserID);\n- await deleteAccount(fromViewer);\n-\n- if (updateUserRowQuery) {\n- await dbQuery(updateUserRowQuery);\n- }\n}\ntype ReplaceUserResult = {|\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [server] Final tuning for merge-users script |
129,187 | 04.05.2019 19:03:37 | 14,400 | 3eaa8e08b277e947aa0a9df0af969122865d8f82 | [server] Rework app version update bot message conditions
Only look at the newest `codeVersion` for a given platform | [
{
"change_type": "MODIFY",
"old_path": "server/src/bots/app-version-update.js",
"new_path": "server/src/bots/app-version-update.js",
"diff": "@@ -18,24 +18,24 @@ const { squadbot } = bots;\nasync function botherMonthlyActivesToUpdateAppVersion(): Promise<void> {\nconst cutoff = Date.now() - thirtyDays;\nconst query = SQL`\n- SELECT x.user, x.min_code_version, MIN(t.id) AS squadbot_thread\n+ SELECT x.user,\n+ MIN(x.max_code_version) AS code_version,\n+ MIN(t.id) AS squadbot_thread\nFROM (\n- SELECT s.user,\n- MIN(JSON_EXTRACT(c.versions, \"$.codeVersion\")) AS min_code_version\n+ SELECT s.user, c.platform,\n+ MAX(JSON_EXTRACT(c.versions, \"$.codeVersion\")) AS max_code_version\nFROM sessions s\nLEFT JOIN cookies c ON c.id = s.cookie\n- LEFT JOIN versions v ON v.platform = c.platform AND v.code_version = (\n- SELECT MAX(code_version)\n- FROM versions\n- WHERE platform = c.platform AND deploy_time IS NOT NULL\n- )\nWHERE s.last_update > ${cutoff}\nAND c.platform != \"web\"\n- AND v.id IS NOT NULL\nAND JSON_EXTRACT(c.versions, \"$.codeVersion\") IS NOT NULL\n- AND v.code_version > JSON_EXTRACT(c.versions, \"$.codeVersion\")\n- GROUP BY s.user\n+ GROUP BY s.user, c.platform\n) x\n+ LEFT JOIN versions v ON v.platform = x.platform AND v.code_version = (\n+ SELECT MAX(code_version)\n+ FROM versions\n+ WHERE platform = x.platform AND deploy_time IS NOT NULL\n+ )\nLEFT JOIN (\nSELECT t.id, m1.user, COUNT(m3.user) AS user_count\nFROM threads t\n@@ -47,7 +47,8 @@ async function botherMonthlyActivesToUpdateAppVersion(): Promise<void> {\nWHERE m1.user IS NOT NULL AND m2.user IS NOT NULL\nGROUP BY t.id, m1.user\n) t ON t.user = x.user AND t.user_count = 2\n- GROUP BY x.user, x.min_code_version\n+ WHERE v.id IS NOT NULL AND x.max_code_version < v.code_version\n+ GROUP BY x.user\n`;\nconst [ result ] = await dbQuery(query);\n@@ -56,8 +57,8 @@ async function botherMonthlyActivesToUpdateAppVersion(): Promise<void> {\nconst usersToSquadbotThreadPromises = {};\nfor (let row of result) {\nconst userID = row.user.toString();\n- const minCodeVersion = row.min_code_version;\n- codeVersions.set(userID, minCodeVersion);\n+ const codeVersion = row.code_version;\n+ codeVersions.set(userID, codeVersion);\nif (row.squadbot_thread) {\nconst squadbotThread = row.squadbot_thread.toString();\nsquadbotThreads.set(userID, squadbotThread);\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [server] Rework app version update bot message conditions
Only look at the newest `codeVersion` for a given platform |
129,187 | 07.05.2019 14:57:52 | 14,400 | 4523ffa496375226969f0c4691a1ae9144bf33e4 | [native] Pull images from CameraRoll to show in ImageGalleryKeyboard | [
{
"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.VIBRATE\" />\n<uses-permission android:name=\"android.permission.READ_PHONE_STATE\" tools:node=\"remove\" />\n<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />\n+ <uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" />\n<application\nandroid:name=\".MainApplication\"\n"
},
{
"change_type": "MODIFY",
"old_path": "native/ios/SquadCal.xcodeproj/project.pbxproj",
"new_path": "native/ios/SquadCal.xcodeproj/project.pbxproj",
"diff": "50114777890342C69E1A0D53 /* Feather.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1BACB9A55ECC42C38F5FE331 /* Feather.ttf */; };\n5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; };\n7F761E602201141E001B6FB7 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F761E292201141E001B6FB7 /* JavaScriptCore.framework */; };\n+ 7F7DF6EC227B89E3006A4263 /* libRCTCameraRoll.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F7DF6CF227B8962006A4263 /* libRCTCameraRoll.a */; };\n7FB58ABE1E7F6BD500B4C1B1 /* Anaheim-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 7FB58ABB1E7F6BC600B4C1B1 /* Anaheim-Regular.ttf */; };\n7FB58ABF1E7F6BD600B4C1B1 /* 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 */; };\nremoteGlobalIDString = ED296FEE214C9CF800B7C4FE;\nremoteInfo = \"jsiexecutor-tvOS\";\n};\n+ 7F7DF6CE227B8962006A4263 /* PBXContainerItemProxy */ = {\n+ isa = PBXContainerItemProxy;\n+ containerPortal = 7F7DF6C8227B8962006A4263 /* RCTCameraRoll.xcodeproj */;\n+ proxyType = 2;\n+ remoteGlobalIDString = 58B5115D1A9E6B3D00147676;\n+ remoteInfo = RCTCameraRoll;\n+ };\n832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = {\nisa = PBXContainerItemProxy;\ncontainerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;\n76DBEB73A008439E97F240AC /* Entypo.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Entypo.ttf; path = \"../node_modules/react-native-vector-icons/Fonts/Entypo.ttf\"; sourceTree = \"<group>\"; };\n78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTLinking.xcodeproj; path = \"../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj\"; sourceTree = \"<group>\"; };\n7F761E292201141E001B6FB7 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };\n+ 7F7DF6C8227B8962006A4263 /* RCTCameraRoll.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = RCTCameraRoll.xcodeproj; path = \"../../node_modules/react-native/Libraries/CameraRoll/RCTCameraRoll.xcodeproj\"; 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>\"; };\n00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */,\n832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,\n139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,\n+ 7F7DF6EC227B89E3006A4263 /* libRCTCameraRoll.a in Frameworks */,\n164ABF33429CFE672F0D2509 /* libPods-SquadCal.a in Frameworks */,\n);\nrunOnlyForDeploymentPostprocessing = 0;\nname = \"Recovered References\";\nsourceTree = \"<group>\";\n};\n+ 7F7DF6C9227B8962006A4263 /* Products */ = {\n+ isa = PBXGroup;\n+ children = (\n+ 7F7DF6CF227B8962006A4263 /* libRCTCameraRoll.a */,\n+ );\n+ name = Products;\n+ sourceTree = \"<group>\";\n+ };\n7FF0870B1E833C3F000A1ACF /* Frameworks */ = {\nisa = PBXGroup;\nchildren = (\n00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */,\n832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,\n139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,\n+ 7F7DF6C8227B8962006A4263 /* RCTCameraRoll.xcodeproj */,\n);\nname = Libraries;\nsourceTree = \"<group>\";\nProductGroup = 5E91572E1DD0AC6500FF2AA8 /* Products */;\nProjectRef = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */;\n},\n+ {\n+ ProductGroup = 7F7DF6C9227B8962006A4263 /* Products */;\n+ ProjectRef = 7F7DF6C8227B8962006A4263 /* RCTCameraRoll.xcodeproj */;\n+ },\n{\nProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */;\nProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;\nremoteRef = 7F761E562201141E001B6FB7 /* PBXContainerItemProxy */;\nsourceTree = BUILT_PRODUCTS_DIR;\n};\n+ 7F7DF6CF227B8962006A4263 /* libRCTCameraRoll.a */ = {\n+ isa = PBXReferenceProxy;\n+ fileType = archive.ar;\n+ path = libRCTCameraRoll.a;\n+ remoteRef = 7F7DF6CE227B8962006A4263 /* PBXContainerItemProxy */;\n+ sourceTree = BUILT_PRODUCTS_DIR;\n+ };\n832341B51AAA6A8300B99B32 /* libRCTText.a */ = {\nisa = PBXReferenceProxy;\nfileType = archive.ar;\n"
},
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-keyboard.react.js",
"new_path": "native/media/image-gallery-keyboard.react.js",
"diff": "// @flow\n+import type { Dimensions } from 'lib/types/media-types';\n+\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\n-import { View, TouchableOpacity, Text, StyleSheet } from 'react-native';\n+import {\n+ View,\n+ TouchableOpacity,\n+ Text,\n+ StyleSheet,\n+ CameraRoll,\n+ Platform,\n+ PermissionsAndroid,\n+ FlatList,\n+ Image,\n+} from 'react-native';\nimport { KeyboardRegistry } from 'react-native-keyboard-input';\n+import invariant from 'invariant';\nimport { contentBottomOffset } from '../selectors/dimension-selectors';\n-class ImageGalleryKeyboard extends React.PureComponent<{||}> {\n+type ImageInfo = {|\n+ ...Dimensions,\n+ uri: string,\n+|};\n+type State = {|\n+ imageInfos: ?$ReadOnlyArray<ImageInfo>,\n+ error: ?string,\n+ containerHeight: ?number,\n+|};\n+class ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\n+\n+ state = {\n+ imageInfos: null,\n+ error: null,\n+ containerHeight: null,\n+ };\n+\n+ async componentDidMount() {\n+ try {\n+ if (Platform.OS === \"android\") {\n+ const hasPermission = await this.getAndroidPermissions();\n+ if (!hasPermission) {\n+ return;\n+ }\n+ }\n+ const photoResults = await CameraRoll.getPhotos({\n+ first: 10,\n+ groupTypes: \"All\",\n+ assetType: \"Photos\",\n+ });\n+ const existingURIs = new Set();\n+ const imageInfos = photoResults.edges.map(\n+ ({ node }) => {\n+ const { uri, height, width } = node.image;\n+ if (existingURIs.has(uri)) {\n+ return null;\n+ }\n+ existingURIs.add(uri);\n+ return { uri, height, width };\n+ },\n+ ).filter(Boolean);\n+ this.setState({ imageInfos });\n+ } catch (e) {\n+ this.setState({ error: \"something went wrong :(\" });\n+ }\n+ }\n+\n+ async getAndroidPermissions() {\n+ try {\n+ const granted = await PermissionsAndroid.request(\n+ PermissionsAndroid.PERMISSIONS.READ_EXTERNAL_STORAGE,\n+ {\n+ title: \"Access Your Photos\",\n+ message: \"Requesting access to your external storage\",\n+ },\n+ )\n+ if (granted !== PermissionsAndroid.RESULTS.GRANTED) {\n+ throw new Error('android_permissions');\n+ }\n+ return true;\n+ } catch (err) {\n+ this.setState({ error: \"don't have permissions :(\" });\n+ return false;\n+ }\n+ }\n+\n+ renderItem = (row: { item: ImageInfo }) => {\n+ const { containerHeight } = this.state;\n+ invariant(containerHeight, \"should be set\");\n+ const { uri, width, height } = row.item;\n+ const source = { uri };\n+ const style = {\n+ height: containerHeight,\n+ width: width / height * containerHeight,\n+ };\n+ return (\n+ <Image\n+ source={source}\n+ style={[ styles.image, style ]}\n+ />\n+ );\n+ }\n+\n+ static keyExtractor(item: ImageInfo) {\n+ return item.uri;\n+ }\nrender() {\n+ let content;\n+ const { imageInfos, error, containerHeight } = this.state;\n+ if (imageInfos && containerHeight) {\n+ content = (\n+ <FlatList\n+ horizontal={true}\n+ data={imageInfos}\n+ renderItem={this.renderItem}\n+ keyExtractor={ImageGalleryKeyboard.keyExtractor}\n+ scrollsToTop={false}\n+ showsHorizontalScrollIndicator={false}\n+ extraData={this.state.containerHeight}\n+ />\n+ );\n+ } else {\n+ const message = error ? error : \"Loading...\";\n+ content = <Text style={styles.text}>{message}</Text>;\n+ }\nreturn (\n- <View style={styles.container}>\n- <TouchableOpacity onPress={this.onPress}>\n- <Text style={styles.text}>HELOOOO!!!</Text>\n- </TouchableOpacity>\n+ <View style={styles.container} onLayout={this.onContainerLayout}>\n+ {content}\n</View>\n);\n}\n+ onContainerLayout = (\n+ event: { nativeEvent: { layout: { height: number } } },\n+ ) => {\n+ this.setState({ containerHeight: event.nativeEvent.layout.height });\n+ }\n+\nonPress = () => {\nKeyboardRegistry.onItemSelected(imageGalleryKeyboardName, {});\n}\n@@ -36,10 +156,14 @@ const styles = StyleSheet.create({\nleft: 0,\nright: 0,\nbackgroundColor: imageGalleryBackgroundColor,\n+ flexDirection: 'row',\n},\ntext: {\ncolor: 'red',\n},\n+ image: {\n+ marginRight: 2,\n+ },\n});\nKeyboardRegistry.registerKeyboard(\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Pull images from CameraRoll to show in ImageGalleryKeyboard |
129,187 | 07.05.2019 15:10:26 | 14,400 | ce5ffe0476a65cf5083e9eacbc8f88ecafc97bb7 | [native] ImageGalleryImage | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "native/media/image-gallery-image.react.js",
"diff": "+// @flow\n+\n+import type { Dimensions } from 'lib/types/media-types';\n+\n+import * as React from 'react';\n+import PropTypes from 'prop-types';\n+import { Image, StyleSheet, TouchableOpacity } from 'react-native';\n+\n+export type GalleryImageInfo = {|\n+ ...Dimensions,\n+ uri: string,\n+|};\n+\n+type Props = {|\n+ imageInfo: GalleryImageInfo,\n+ containerHeight: number,\n+ onSelect: (imageInfo: GalleryImageInfo) => void,\n+|};\n+class ImageGalleryImage extends React.PureComponent<Props> {\n+\n+ static propTypes = {\n+ imageInfo: PropTypes.shape({\n+ height: PropTypes.number.isRequired,\n+ width: PropTypes.number.isRequired,\n+ uri: PropTypes.string.isRequired,\n+ }).isRequired,\n+ containerHeight: PropTypes.number.isRequired,\n+ onSelect: PropTypes.func.isRequired,\n+ };\n+\n+ render() {\n+ const { imageInfo, containerHeight } = this.props;\n+ const { uri, width, height } = imageInfo;\n+ const source = { uri };\n+ const style = {\n+ height: containerHeight,\n+ width: width / height * containerHeight,\n+ };\n+ return (\n+ <TouchableOpacity onPress={this.onPress}>\n+ <Image\n+ source={source}\n+ style={[ styles.image, style ]}\n+ />\n+ </TouchableOpacity>\n+ );\n+ }\n+\n+ onPress = () => {\n+ this.props.onSelect(this.props.imageInfo);\n+ }\n+\n+}\n+\n+const styles = StyleSheet.create({\n+ image: {\n+ marginRight: 2,\n+ },\n+});\n+\n+export default ImageGalleryImage;\n"
},
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-keyboard.react.js",
"new_path": "native/media/image-gallery-keyboard.react.js",
"diff": "// @flow\n-import type { Dimensions } from 'lib/types/media-types';\n+import type { GalleryImageInfo } from './image-gallery-image.react';\nimport * as React from 'react';\n-import PropTypes from 'prop-types';\nimport {\nView,\n- TouchableOpacity,\nText,\nStyleSheet,\nCameraRoll,\nPlatform,\nPermissionsAndroid,\nFlatList,\n- Image,\n} from 'react-native';\nimport { KeyboardRegistry } from 'react-native-keyboard-input';\nimport invariant from 'invariant';\nimport { contentBottomOffset } from '../selectors/dimension-selectors';\n+import ImageGalleryImage from './image-gallery-image.react';\n-type ImageInfo = {|\n- ...Dimensions,\n- uri: string,\n-|};\ntype State = {|\n- imageInfos: ?$ReadOnlyArray<ImageInfo>,\n+ imageInfos: ?$ReadOnlyArray<GalleryImageInfo>,\nerror: ?string,\ncontainerHeight: ?number,\n|};\n@@ -86,24 +80,19 @@ class ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\n}\n}\n- renderItem = (row: { item: ImageInfo }) => {\n+ renderItem = (row: { item: GalleryImageInfo }) => {\nconst { containerHeight } = this.state;\ninvariant(containerHeight, \"should be set\");\n- const { uri, width, height } = row.item;\n- const source = { uri };\n- const style = {\n- height: containerHeight,\n- width: width / height * containerHeight,\n- };\nreturn (\n- <Image\n- source={source}\n- style={[ styles.image, style ]}\n+ <ImageGalleryImage\n+ imageInfo={row.item}\n+ containerHeight={containerHeight}\n+ onSelect={this.onSelectImage}\n/>\n);\n}\n- static keyExtractor(item: ImageInfo) {\n+ static keyExtractor(item: GalleryImageInfo) {\nreturn item.uri;\n}\n@@ -139,8 +128,8 @@ class ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\nthis.setState({ containerHeight: event.nativeEvent.layout.height });\n}\n- onPress = () => {\n- KeyboardRegistry.onItemSelected(imageGalleryKeyboardName, {});\n+ onSelectImage = (imageInfo: GalleryImageInfo) => {\n+ KeyboardRegistry.onItemSelected(imageGalleryKeyboardName, imageInfo);\n}\n}\n@@ -161,9 +150,6 @@ const styles = StyleSheet.create({\ntext: {\ncolor: 'red',\n},\n- image: {\n- marginRight: 2,\n- },\n});\nKeyboardRegistry.registerKeyboard(\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] ImageGalleryImage |
129,187 | 07.05.2019 15:37:20 | 14,400 | ba9091774f7c9b5bff2b7dc1574e36f49f50c3b0 | [native] Infinite scroll for ImageGalleryKeyboard | [
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-keyboard.react.js",
"new_path": "native/media/image-gallery-keyboard.react.js",
"diff": "@@ -22,6 +22,8 @@ type State = {|\nimageInfos: ?$ReadOnlyArray<GalleryImageInfo>,\nerror: ?string,\ncontainerHeight: ?number,\n+ // null means end reached; undefined means no fetch yet\n+ cursor: ?string,\n|};\nclass ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\n@@ -29,9 +31,31 @@ class ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\nimageInfos: null,\nerror: null,\ncontainerHeight: null,\n+ cursor: undefined,\n};\n+ mounted = false;\n+ fetchingPhotos = false;\n- async componentDidMount() {\n+ componentDidMount() {\n+ this.mounted = true;\n+ return this.fetchPhotos();\n+ }\n+\n+ componentWillUnmount() {\n+ this.mounted = false;\n+ }\n+\n+ guardedSetState(change) {\n+ if (this.mounted) {\n+ this.setState(change);\n+ }\n+ }\n+\n+ async fetchPhotos(after?: ?string) {\n+ if (this.fetchingPhotos) {\n+ return;\n+ }\n+ this.fetchingPhotos = true;\ntry {\nif (Platform.OS === \"android\") {\nconst hasPermission = await this.getAndroidPermissions();\n@@ -39,13 +63,17 @@ class ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\nreturn;\n}\n}\n- const photoResults = await CameraRoll.getPhotos({\n- first: 10,\n+ const { edges, page_info } = await CameraRoll.getPhotos({\n+ first: 20,\n+ after,\ngroupTypes: \"All\",\nassetType: \"Photos\",\n});\n- const existingURIs = new Set();\n- const imageInfos = photoResults.edges.map(\n+ const imageURIs = this.state.imageInfos\n+ ? this.state.imageInfos.map(({ uri }) => uri)\n+ : [];\n+ const existingURIs = new Set(imageURIs);\n+ const imageInfos = edges.map(\n({ node }) => {\nconst { uri, height, width } = node.image;\nif (existingURIs.has(uri)) {\n@@ -55,10 +83,26 @@ class ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\nreturn { uri, height, width };\n},\n).filter(Boolean);\n- this.setState({ imageInfos });\n+ this.guardedSetState((prevState: State) => {\n+ const updatedImageInfos = prevState.imageInfos\n+ ? [ ...prevState.imageInfos, ...imageInfos ]\n+ : imageInfos;\n+ const cursor = page_info.has_next_page\n+ ? page_info.end_cursor\n+ : null;\n+ return {\n+ imageInfos: updatedImageInfos,\n+ error: null,\n+ cursor,\n+ };\n+ });\n} catch (e) {\n- this.setState({ error: \"something went wrong :(\" });\n+ this.guardedSetState({\n+ imageInfos: null,\n+ error: \"something went wrong :(\",\n+ });\n}\n+ this.fetchingPhotos = false;\n}\nasync getAndroidPermissions() {\n@@ -75,7 +119,7 @@ class ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\n}\nreturn true;\n} catch (err) {\n- this.setState({ error: \"don't have permissions :(\" });\n+ this.guardedSetState({ error: \"don't have permissions :(\" });\nreturn false;\n}\n}\n@@ -108,6 +152,8 @@ class ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\nkeyExtractor={ImageGalleryKeyboard.keyExtractor}\nscrollsToTop={false}\nshowsHorizontalScrollIndicator={false}\n+ onEndReached={this.onEndReached}\n+ onEndReachedThreshold={5}\nextraData={this.state.containerHeight}\n/>\n);\n@@ -125,13 +171,20 @@ class ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\nonContainerLayout = (\nevent: { nativeEvent: { layout: { height: number } } },\n) => {\n- this.setState({ containerHeight: event.nativeEvent.layout.height });\n+ this.guardedSetState({ containerHeight: event.nativeEvent.layout.height });\n}\nonSelectImage = (imageInfo: GalleryImageInfo) => {\nKeyboardRegistry.onItemSelected(imageGalleryKeyboardName, imageInfo);\n}\n+ onEndReached = () => {\n+ const { cursor } = this.state;\n+ if (cursor !== null) {\n+ this.fetchPhotos(cursor);\n+ }\n+ }\n+\n}\nconst imageGalleryKeyboardName = 'ImageGalleryKeyboard';\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Infinite scroll for ImageGalleryKeyboard |
129,187 | 08.05.2019 14:51:30 | 14,400 | 7a55447f9a9de37c068fcc9b4217be6ca68c347a | [native] ItemSeparatorComponent for ImageGalleryKeyboard | [
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-image.react.js",
"new_path": "native/media/image-gallery-image.react.js",
"diff": "@@ -4,7 +4,7 @@ import type { Dimensions } from 'lib/types/media-types';\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\n-import { Image, StyleSheet, TouchableOpacity } from 'react-native';\n+import { Image, TouchableOpacity } from 'react-native';\nexport type GalleryImageInfo = {|\n...Dimensions,\n@@ -38,10 +38,7 @@ class ImageGalleryImage extends React.PureComponent<Props> {\n};\nreturn (\n<TouchableOpacity onPress={this.onPress}>\n- <Image\n- source={source}\n- style={[ styles.image, style ]}\n- />\n+ <Image source={source} style={style} />\n</TouchableOpacity>\n);\n}\n@@ -52,10 +49,4 @@ class ImageGalleryImage extends React.PureComponent<Props> {\n}\n-const styles = StyleSheet.create({\n- image: {\n- marginRight: 2,\n- },\n-});\n-\nexport default ImageGalleryImage;\n"
},
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-keyboard.react.js",
"new_path": "native/media/image-gallery-keyboard.react.js",
"diff": "@@ -136,6 +136,10 @@ class ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\n);\n}\n+ static renderItemSeparator() {\n+ return <View style={styles.separator} />;\n+ }\n+\nstatic keyExtractor(item: GalleryImageInfo) {\nreturn item.uri;\n}\n@@ -149,6 +153,7 @@ class ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\nhorizontal={true}\ndata={imageInfos}\nrenderItem={this.renderItem}\n+ ItemSeparatorComponent={ImageGalleryKeyboard.renderItemSeparator}\nkeyExtractor={ImageGalleryKeyboard.keyExtractor}\nscrollsToTop={false}\nshowsHorizontalScrollIndicator={false}\n@@ -203,6 +208,9 @@ const styles = StyleSheet.create({\ntext: {\ncolor: 'red',\n},\n+ separator: {\n+ width: 2,\n+ },\n});\nKeyboardRegistry.registerKeyboard(\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] ItemSeparatorComponent for ImageGalleryKeyboard |
129,187 | 08.05.2019 16:09:53 | 14,400 | 1cde30a6d616c5cc9fc88ba3fb79fd225815337c | [native] Handle loading/error cases in ImageGalleryKeyboard | [
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-keyboard.react.js",
"new_path": "native/media/image-gallery-keyboard.react.js",
"diff": "@@ -11,6 +11,7 @@ import {\nPlatform,\nPermissionsAndroid,\nFlatList,\n+ ActivityIndicator,\n} from 'react-native';\nimport { KeyboardRegistry } from 'react-native-keyboard-input';\nimport invariant from 'invariant';\n@@ -162,9 +163,16 @@ class ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\nextraData={this.state.containerHeight}\n/>\n);\n+ } else if (error) {\n+ content = <Text style={styles.error}>{error}</Text>;\n} else {\n- const message = error ? error : \"Loading...\";\n- content = <Text style={styles.text}>{message}</Text>;\n+ content = (\n+ <ActivityIndicator\n+ color=\"black\"\n+ size=\"large\"\n+ style={styles.loadingIndicator}\n+ />\n+ );\n}\nreturn (\n<View style={styles.container} onLayout={this.onContainerLayout}>\n@@ -204,13 +212,21 @@ const styles = StyleSheet.create({\nright: 0,\nbackgroundColor: imageGalleryBackgroundColor,\nflexDirection: 'row',\n+ alignItems: 'center',\n},\n- text: {\n- color: 'red',\n+ error: {\n+ flex: 1,\n+ fontSize: 28,\n+ textAlign: 'center',\n+ marginBottom: contentBottomOffset,\n},\nseparator: {\nwidth: 2,\n},\n+ loadingIndicator: {\n+ flex: 1,\n+ marginBottom: contentBottomOffset,\n+ },\n});\nKeyboardRegistry.registerKeyboard(\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Handle loading/error cases in ImageGalleryKeyboard |
129,187 | 08.05.2019 23:16:44 | 14,400 | 0799994895207ac799369e789cc0cd9b113743b5 | [native] Sticky opacity style for ImageGalleryImage | [
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-image.react.js",
"new_path": "native/media/image-gallery-image.react.js",
"diff": "@@ -4,7 +4,7 @@ import type { Dimensions } from 'lib/types/media-types';\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\n-import { Image, TouchableOpacity } from 'react-native';\n+import { Image, TouchableOpacity, StyleSheet } from 'react-native';\nexport type GalleryImageInfo = {|\n...Dimensions,\n@@ -16,7 +16,10 @@ type Props = {|\ncontainerHeight: number,\nonSelect: (imageInfo: GalleryImageInfo) => void,\n|};\n-class ImageGalleryImage extends React.PureComponent<Props> {\n+type State = {|\n+ selected: bool,\n+|};\n+class ImageGalleryImage extends React.PureComponent<Props, State> {\nstatic propTypes = {\nimageInfo: PropTypes.shape({\n@@ -27,26 +30,60 @@ class ImageGalleryImage extends React.PureComponent<Props> {\ncontainerHeight: PropTypes.number.isRequired,\nonSelect: PropTypes.func.isRequired,\n};\n+ state = {\n+ selected: false,\n+ };\n+ button: ?TouchableOpacity;\n+\n+ componentDidUpdate(prevProps: Props, prevState: State) {\n+ const { button } = this;\n+ if (!button) {\n+ return;\n+ }\n+ if (this.state.selected && !prevState.selected) {\n+ button.setOpacityTo(0.2, 0);\n+ } else if (!this.state.selected && prevState.selected) {\n+ button.setOpacityTo(1, 0);\n+ }\n+ }\nrender() {\nconst { imageInfo, containerHeight } = this.props;\nconst { uri, width, height } = imageInfo;\nconst source = { uri };\n- const style = {\n+ const imageStyle = {\nheight: containerHeight,\nwidth: width / height * containerHeight,\n};\n+ const buttonStyle = {\n+ opacity: this.state.selected ? 0.2 : 1,\n+ };\nreturn (\n- <TouchableOpacity onPress={this.onPress}>\n- <Image source={source} style={style} />\n+ <TouchableOpacity\n+ onPress={this.onPress}\n+ style={[ styles.button, buttonStyle ]}\n+ ref={this.buttonRef}\n+ >\n+ <Image source={source} style={imageStyle} />\n</TouchableOpacity>\n);\n}\n+ buttonRef = (button: ?TouchableOpacity) => {\n+ this.button = button;\n+ }\n+\nonPress = () => {\n- this.props.onSelect(this.props.imageInfo);\n+ //this.props.onSelect(this.props.imageInfo);\n+ this.setState({ selected: true });\n}\n}\n+const styles = StyleSheet.create({\n+ button: {\n+ flex: 1,\n+ },\n+});\n+\nexport default ImageGalleryImage;\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Sticky opacity style for ImageGalleryImage |
129,187 | 09.05.2019 11:45:29 | 14,400 | 246c0dd9726a43f91644e6936a68c17a019af86b | [native] State for queueing images in ImageGalleryKeyboard | [
{
"change_type": "MODIFY",
"old_path": "native/chat/chat-input-bar.react.js",
"new_path": "native/chat/chat-input-bar.react.js",
"diff": "@@ -21,6 +21,7 @@ import type { LoadingStatus } from 'lib/types/loading-types';\nimport { loadingStatusPropType } from 'lib/types/loading-types';\nimport type { CalendarQuery } from 'lib/types/entry-types';\nimport type { KeyboardEvent } from '../keyboard';\n+import type { GalleryImageInfo } from '../media/image-gallery-image.react';\nimport * as React from 'react';\nimport {\n@@ -512,7 +513,10 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nthis.props.setImageGalleryOpen(false);\n}\n- onImageGalleryItemSelected = () => {\n+ onImageGalleryItemSelected = (\n+ keyboardName: string,\n+ imageInfos: $ReadOnlyArray<GalleryImageInfo>,\n+ ) => {\nKeyboardUtils.dismiss();\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-image.react.js",
"new_path": "native/media/image-gallery-image.react.js",
"diff": "@@ -14,7 +14,10 @@ export type GalleryImageInfo = {|\ntype Props = {|\nimageInfo: GalleryImageInfo,\ncontainerHeight: number,\n- onSelect: (imageInfo: GalleryImageInfo) => void,\n+ queueModeActive: bool,\n+ isQueued: bool,\n+ setImageQueued: (image: GalleryImageInfo, isQueued: bool) => void,\n+ sendImage: (image: GalleryImageInfo) => void,\n|};\ntype State = {|\nselected: bool,\n@@ -28,7 +31,10 @@ class ImageGalleryImage extends React.PureComponent<Props, State> {\nuri: PropTypes.string.isRequired,\n}).isRequired,\ncontainerHeight: PropTypes.number.isRequired,\n- onSelect: PropTypes.func.isRequired,\n+ queueModeActive: PropTypes.bool.isRequired,\n+ isQueued: PropTypes.bool.isRequired,\n+ setImageQueued: PropTypes.func.isRequired,\n+ sendImage: PropTypes.func.isRequired,\n};\nstate = {\nselected: false,\n@@ -74,7 +80,6 @@ class ImageGalleryImage extends React.PureComponent<Props, State> {\n}\nonPress = () => {\n- //this.props.onSelect(this.props.imageInfo);\nthis.setState({ selected: true });\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-keyboard.react.js",
"new_path": "native/media/image-gallery-keyboard.react.js",
"diff": "@@ -25,6 +25,7 @@ type State = {|\ncontainerHeight: ?number,\n// null means end reached; undefined means no fetch yet\ncursor: ?string,\n+ queuedImageURIs: Set<string>,\n|};\nclass ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\n@@ -33,6 +34,7 @@ class ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\nerror: null,\ncontainerHeight: null,\ncursor: undefined,\n+ queuedImageURIs: new Set(),\n};\nmounted = false;\nfetchingPhotos = false;\n@@ -125,14 +127,23 @@ class ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\n}\n}\n+ get queueModeActive() {\n+ return this.state.queuedImageURIs.size > 0;\n+ }\n+\nrenderItem = (row: { item: GalleryImageInfo }) => {\n- const { containerHeight } = this.state;\n+ const { containerHeight, queuedImageURIs } = this.state;\ninvariant(containerHeight, \"should be set\");\n+ const isQueued = queuedImageURIs.has(row.item.uri);\n+ const { queueModeActive } = this;\nreturn (\n<ImageGalleryImage\nimageInfo={row.item}\ncontainerHeight={containerHeight}\n- onSelect={this.onSelectImage}\n+ queueModeActive={queueModeActive}\n+ isQueued={isQueued}\n+ setImageQueued={this.setImageQueued}\n+ sendImage={this.sendImage}\n/>\n);\n}\n@@ -187,10 +198,6 @@ class ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\nthis.guardedSetState({ containerHeight: event.nativeEvent.layout.height });\n}\n- onSelectImage = (imageInfo: GalleryImageInfo) => {\n- KeyboardRegistry.onItemSelected(imageGalleryKeyboardName, imageInfo);\n- }\n-\nonEndReached = () => {\nconst { cursor } = this.state;\nif (cursor !== null) {\n@@ -198,6 +205,50 @@ class ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\n}\n}\n+ setImageQueued = (imageInfo: GalleryImageInfo, isQueued: bool) => {\n+ this.setState((prevState: State) => {\n+ const prevQueuedImageURIs = [ ...prevState.queuedImageURIs ];\n+ if (isQueued) {\n+ return {\n+ queuedImageURIs: new Set([\n+ ...prevQueuedImageURIs,\n+ imageInfo.uri,\n+ ]),\n+ };\n+ }\n+ const queuedImageURIs = prevQueuedImageURIs.filter(\n+ uri => uri !== imageInfo.uri,\n+ );\n+ if (queuedImageURIs.length < prevQueuedImageURIs.length) {\n+ return { queuedImageURIs: new Set(queuedImageURIs) };\n+ }\n+ return null;\n+ });\n+ }\n+\n+ sendImage = (imageInfo: GalleryImageInfo) => {\n+ this.sendImages([ imageInfo ]);\n+ }\n+\n+ sendQueuedImages = () => {\n+ const { imageInfos, queuedImageURIs } = this.state;\n+ invariant(imageInfos, \"should be set\");\n+ const queuedImageInfos = [];\n+ for (let uri of this.state.queuedImageURIs) {\n+ for (let imageInfo of imageInfos) {\n+ if (imageInfo.uri === uri) {\n+ queuedImageInfos.push(imageInfo);\n+ break;\n+ }\n+ }\n+ }\n+ this.sendImages(queuedImageInfos);\n+ }\n+\n+ sendImages(imageInfos: $ReadOnlyArray<GalleryImageInfo>) {\n+ KeyboardRegistry.onItemSelected(imageGalleryKeyboardName, imageInfos);\n+ }\n+\n}\nconst imageGalleryKeyboardName = 'ImageGalleryKeyboard';\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] State for queueing images in ImageGalleryKeyboard |
129,187 | 09.05.2019 13:08:35 | 14,400 | 037c5f5d527d24669ef37edae2d7fa17f15972d6 | [native] Lift image focused state to ImageGalleryKeyboard
Now only one image can be focused at once. | [
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-image.react.js",
"new_path": "native/media/image-gallery-image.react.js",
"diff": "@@ -18,11 +18,10 @@ type Props = {|\nisQueued: bool,\nsetImageQueued: (image: GalleryImageInfo, isQueued: bool) => void,\nsendImage: (image: GalleryImageInfo) => void,\n+ isFocused: bool,\n+ setFocus: (image: GalleryImageInfo) => void,\n|};\n-type State = {|\n- selected: bool,\n-|};\n-class ImageGalleryImage extends React.PureComponent<Props, State> {\n+class ImageGalleryImage extends React.PureComponent<Props> {\nstatic propTypes = {\nimageInfo: PropTypes.shape({\n@@ -35,20 +34,25 @@ class ImageGalleryImage extends React.PureComponent<Props, State> {\nisQueued: PropTypes.bool.isRequired,\nsetImageQueued: PropTypes.func.isRequired,\nsendImage: PropTypes.func.isRequired,\n- };\n- state = {\n- selected: false,\n+ isFocused: PropTypes.bool.isRequired,\n+ setFocus: PropTypes.func.isRequired,\n};\nbutton: ?TouchableOpacity;\n- componentDidUpdate(prevProps: Props, prevState: State) {\n+ static isActive(props: Props) {\n+ return props.isFocused || props.isQueued;\n+ }\n+\n+ componentDidUpdate(prevProps: Props) {\nconst { button } = this;\nif (!button) {\nreturn;\n}\n- if (this.state.selected && !prevState.selected) {\n+ const isActive = ImageGalleryImage.isActive(this.props);\n+ const wasActive = ImageGalleryImage.isActive(prevProps);\n+ if (isActive && !wasActive) {\nbutton.setOpacityTo(0.2, 0);\n- } else if (!this.state.selected && prevState.selected) {\n+ } else if (!isActive && wasActive) {\nbutton.setOpacityTo(1, 0);\n}\n}\n@@ -62,7 +66,7 @@ class ImageGalleryImage extends React.PureComponent<Props, State> {\nwidth: width / height * containerHeight,\n};\nconst buttonStyle = {\n- opacity: this.state.selected ? 0.2 : 1,\n+ opacity: ImageGalleryImage.isActive(this.props) ? 0.2 : 1,\n};\nreturn (\n<TouchableOpacity\n@@ -80,7 +84,7 @@ class ImageGalleryImage extends React.PureComponent<Props, State> {\n}\nonPress = () => {\n- this.setState({ selected: true });\n+ this.props.setFocus(this.props.imageInfo);\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-keyboard.react.js",
"new_path": "native/media/image-gallery-keyboard.react.js",
"diff": "@@ -26,6 +26,7 @@ type State = {|\n// null means end reached; undefined means no fetch yet\ncursor: ?string,\nqueuedImageURIs: Set<string>,\n+ focusedImageURI: ?string,\n|};\nclass ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\n@@ -35,6 +36,7 @@ class ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\ncontainerHeight: null,\ncursor: undefined,\nqueuedImageURIs: new Set(),\n+ focusedImageURI: null,\n};\nmounted = false;\nfetchingPhotos = false;\n@@ -134,7 +136,8 @@ class ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\nrenderItem = (row: { item: GalleryImageInfo }) => {\nconst { containerHeight, queuedImageURIs } = this.state;\ninvariant(containerHeight, \"should be set\");\n- const isQueued = queuedImageURIs.has(row.item.uri);\n+ const { uri } = row.item;\n+ const isQueued = queuedImageURIs.has(uri);\nconst { queueModeActive } = this;\nreturn (\n<ImageGalleryImage\n@@ -144,6 +147,8 @@ class ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\nisQueued={isQueued}\nsetImageQueued={this.setImageQueued}\nsendImage={this.sendImage}\n+ isFocused={this.state.focusedImageURI === uri}\n+ setFocus={this.setFocus}\n/>\n);\n}\n@@ -171,7 +176,7 @@ class ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\nshowsHorizontalScrollIndicator={false}\nonEndReached={this.onEndReached}\nonEndReachedThreshold={5}\n- extraData={this.state.containerHeight}\n+ extraData={this.state}\n/>\n);\n} else if (error) {\n@@ -226,6 +231,10 @@ class ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\n});\n}\n+ setFocus = (imageInfo: GalleryImageInfo) => {\n+ this.setState({ focusedImageURI: imageInfo.uri });\n+ }\n+\nsendImage = (imageInfo: GalleryImageInfo) => {\nthis.sendImages([ imageInfo ]);\n}\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Lift image focused state to ImageGalleryKeyboard
Now only one image can be focused at once. |
129,187 | 09.05.2019 16:30:46 | 14,400 | fb292d08e7a2f8de6917eeddc6cd7faeaea772b4 | [native] Keep ImageGalleryImage width below screen width | [
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-image.react.js",
"new_path": "native/media/image-gallery-image.react.js",
"diff": "@@ -20,6 +20,7 @@ type Props = {|\nsendImage: (image: GalleryImageInfo) => void,\nisFocused: bool,\nsetFocus: (image: GalleryImageInfo) => void,\n+ screenWidth: number,\n|};\nclass ImageGalleryImage extends React.PureComponent<Props> {\n@@ -36,6 +37,7 @@ class ImageGalleryImage extends React.PureComponent<Props> {\nsendImage: PropTypes.func.isRequired,\nisFocused: PropTypes.bool.isRequired,\nsetFocus: PropTypes.func.isRequired,\n+ screenWidth: PropTypes.number.isRequired,\n};\nbutton: ?TouchableOpacity;\n@@ -63,7 +65,10 @@ class ImageGalleryImage extends React.PureComponent<Props> {\nconst source = { uri };\nconst imageStyle = {\nheight: containerHeight,\n- width: width / height * containerHeight,\n+ width: Math.min(\n+ width / height * containerHeight,\n+ this.props.screenWidth,\n+ ),\n};\nconst buttonStyle = {\nopacity: ImageGalleryImage.isActive(this.props) ? 0.2 : 1,\n"
},
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-keyboard.react.js",
"new_path": "native/media/image-gallery-keyboard.react.js",
"diff": "// @flow\nimport type { GalleryImageInfo } from './image-gallery-image.react';\n+import type { AppState } from '../redux/redux-setup';\n+import { type Dimensions, dimensionsPropType } from 'lib/types/media-types';\nimport * as React from 'react';\nimport {\n@@ -15,10 +17,21 @@ import {\n} from 'react-native';\nimport { KeyboardRegistry } from 'react-native-keyboard-input';\nimport invariant from 'invariant';\n+import { Provider } from 'react-redux';\n-import { contentBottomOffset } from '../selectors/dimension-selectors';\n+import { connect } from 'lib/utils/redux-utils';\n+\n+import { store } from '../redux/redux-setup';\n+import {\n+ dimensionsSelector,\n+ contentBottomOffset,\n+} from '../selectors/dimension-selectors';\nimport ImageGalleryImage from './image-gallery-image.react';\n+type Props = {|\n+ // Redux state\n+ screenDimensions: Dimensions,\n+|};\ntype State = {|\nimageInfos: ?$ReadOnlyArray<GalleryImageInfo>,\nerror: ?string,\n@@ -28,8 +41,11 @@ type State = {|\nqueuedImageURIs: Set<string>,\nfocusedImageURI: ?string,\n|};\n-class ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\n+class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\n+ static propTypes = {\n+ screenDimensions: dimensionsPropType.isRequired,\n+ };\nstate = {\nimageInfos: null,\nerror: null,\n@@ -149,6 +165,7 @@ class ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\nsendImage={this.sendImage}\nisFocused={this.state.focusedImageURI === uri}\nsetFocus={this.setFocus}\n+ screenWidth={this.props.screenDimensions.width}\n/>\n);\n}\n@@ -177,6 +194,7 @@ class ImageGalleryKeyboard extends React.PureComponent<{||}, State> {\nonEndReached={this.onEndReached}\nonEndReachedThreshold={5}\nextraData={this.state}\n+ anotherExtraData={this.props.screenDimensions.width}\n/>\n);\n} else if (error) {\n@@ -289,9 +307,23 @@ const styles = StyleSheet.create({\n},\n});\n+const ReduxConnectedImageGalleryKeyboard = connect(\n+ (state: AppState) => ({\n+ screenDimensions: dimensionsSelector(state)\n+ }),\n+)(ImageGalleryKeyboard);\n+\n+function ReduxImageGalleryKeyboard(props: {||}) {\n+ return (\n+ <Provider store={store}>\n+ <ReduxConnectedImageGalleryKeyboard />\n+ </Provider>\n+ );\n+}\n+\nKeyboardRegistry.registerKeyboard(\nimageGalleryKeyboardName,\n- () => ImageGalleryKeyboard,\n+ () => ReduxImageGalleryKeyboard,\n);\nexport {\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Keep ImageGalleryImage width below screen width |
129,187 | 09.05.2019 18:16:08 | 14,400 | fcbf518168975891ed0fdaf2ed7271f453eeca69 | [native] Basic action buttons for ImageGalleryImage | [
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-image.react.js",
"new_path": "native/media/image-gallery-image.react.js",
"diff": "@@ -4,7 +4,7 @@ import type { Dimensions } from 'lib/types/media-types';\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\n-import { Image, TouchableOpacity, StyleSheet } from 'react-native';\n+import { Image, TouchableOpacity, StyleSheet, View, Text } from 'react-native';\nexport type GalleryImageInfo = {|\n...Dimensions,\n@@ -39,23 +39,23 @@ class ImageGalleryImage extends React.PureComponent<Props> {\nsetFocus: PropTypes.func.isRequired,\nscreenWidth: PropTypes.number.isRequired,\n};\n- button: ?TouchableOpacity;\n+ backdrop: ?TouchableOpacity;\nstatic isActive(props: Props) {\nreturn props.isFocused || props.isQueued;\n}\ncomponentDidUpdate(prevProps: Props) {\n- const { button } = this;\n- if (!button) {\n+ const { backdrop } = this;\n+ if (!backdrop) {\nreturn;\n}\nconst isActive = ImageGalleryImage.isActive(this.props);\nconst wasActive = ImageGalleryImage.isActive(prevProps);\nif (isActive && !wasActive) {\n- button.setOpacityTo(0.2, 0);\n+ backdrop.setOpacityTo(0.2, 0);\n} else if (!isActive && wasActive) {\n- button.setOpacityTo(1, 0);\n+ backdrop.setOpacityTo(1, 0);\n}\n}\n@@ -63,41 +63,117 @@ class ImageGalleryImage extends React.PureComponent<Props> {\nconst { imageInfo, containerHeight } = this.props;\nconst { uri, width, height } = imageInfo;\nconst source = { uri };\n- const imageStyle = {\n+ const active = ImageGalleryImage.isActive(this.props);\n+ const dimensionsStyle = {\nheight: containerHeight,\nwidth: Math.min(\nwidth / height * containerHeight,\nthis.props.screenWidth,\n),\n};\n- const buttonStyle = {\n- opacity: ImageGalleryImage.isActive(this.props) ? 0.2 : 1,\n+ const backdropStyle = {\n+ opacity: active ? 0.2 : 1,\n};\n+\n+ let buttons = null;\n+ if (active) {\n+ const buttonList = [];\n+ const { queueModeActive } = this.props;\n+ if (!queueModeActive) {\n+ buttonList.push(\n+ <TouchableOpacity\n+ onPress={this.onPressSend}\n+ style={styles.sendButton}\n+ key=\"send\"\n+ >\n+ <Text style={styles.buttonText}>\n+ Send\n+ </Text>\n+ </TouchableOpacity>\n+ );\n+ }\n+ const enqueueButtonText = queueModeActive ? \"Select\" : \"Queue\";\n+ buttonList.push(\n+ <TouchableOpacity\n+ onPress={this.onPressEnqueue}\n+ style={styles.enqueueButton}\n+ key=\"queue\"\n+ >\n+ <Text style={styles.buttonText}>\n+ {enqueueButtonText}\n+ </Text>\n+ </TouchableOpacity>\n+ );\n+ buttons = (\n+ <View style={styles.buttons}>\n+ {buttonList}\n+ </View>\n+ );\n+ }\n+\nreturn (\n+ <View style={[ styles.container, dimensionsStyle ]}>\n<TouchableOpacity\n- onPress={this.onPress}\n- style={[ styles.button, buttonStyle ]}\n- ref={this.buttonRef}\n+ onPress={this.onPressBackdrop}\n+ style={[ styles.container, backdropStyle ]}\n+ ref={this.backdropRef}\n>\n- <Image source={source} style={imageStyle} />\n+ <Image source={source} style={dimensionsStyle} />\n</TouchableOpacity>\n+ {buttons}\n+ </View>\n);\n}\n- buttonRef = (button: ?TouchableOpacity) => {\n- this.button = button;\n+ backdropRef = (backdrop: ?TouchableOpacity) => {\n+ this.backdrop = backdrop;\n}\n- onPress = () => {\n+ onPressBackdrop = () => {\nthis.props.setFocus(this.props.imageInfo);\n}\n+ onPressSend = () => {\n+ this.props.sendImage(this.props.imageInfo);\n+ }\n+\n+ onPressEnqueue = () => {\n+ this.props.setImageQueued(this.props.imageInfo, !this.props.isQueued);\n+ }\n+\n}\nconst styles = StyleSheet.create({\n- button: {\n+ container: {\nflex: 1,\n},\n+ buttons: {\n+ position: 'absolute',\n+ top: 0,\n+ bottom: 0,\n+ left: 0,\n+ right: 0,\n+ alignItems: 'center',\n+ justifyContent: 'center',\n+ },\n+ sendButton: {\n+ margin: 10,\n+ borderRadius: 20,\n+ padding: 10,\n+ borderColor: 'black',\n+ borderWidth: 1,\n+ },\n+ enqueueButton: {\n+ margin: 10,\n+ borderRadius: 20,\n+ padding: 10,\n+ borderColor: 'black',\n+ borderWidth: 1,\n+ },\n+ buttonText: {\n+ color: 'black',\n+ fontSize: 16,\n+ },\n});\nexport default ImageGalleryImage;\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Basic action buttons for ImageGalleryImage |
129,187 | 10.05.2019 13:46:37 | 14,400 | 1be5c10139c07dfeb5eb4ab34d58c17ae3d07db2 | [native] Keep keyboardHeight updated even if it shrinks | [
{
"change_type": "MODIFY",
"old_path": "native/keyboard.js",
"new_path": "native/keyboard.js",
"diff": "@@ -101,7 +101,9 @@ function callShowCallbackIfAppActive(\nreturn (event: KeyboardEvent) => {\nif (event) {\nconst { height } = event.endCoordinates;\n- if (height > 0 && (!keyboardHeight || keyboardHeight < height)) {\n+ // On iOS simulator, when the keyboard is disabled we still trigger here,\n+ // but with small values. This condition should filter that out\n+ if (Platform.OS !== \"ios\" || height > 100) {\nkeyboardHeight = height;\n}\n}\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Keep keyboardHeight updated even if it shrinks |
129,187 | 10.05.2019 13:55:19 | 14,400 | f119fbb23ebc86b7f1355c6c8b348150fbf74f8f | [native] Keep all ImageGalleryKeyboard extraData in state | [
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-keyboard.react.js",
"new_path": "native/media/image-gallery-keyboard.react.js",
"diff": "@@ -40,22 +40,28 @@ type State = {|\ncursor: ?string,\nqueuedImageURIs: Set<string>,\nfocusedImageURI: ?string,\n+ screenWidth: number,\n|};\nclass ImageGalleryKeyboard extends React.PureComponent<Props, State> {\nstatic propTypes = {\nscreenDimensions: dimensionsPropType.isRequired,\n};\n- state = {\n+ mounted = false;\n+ fetchingPhotos = false;\n+\n+ constructor(props: Props) {\n+ super(props);\n+ this.state = {\nimageInfos: null,\nerror: null,\ncontainerHeight: null,\ncursor: undefined,\nqueuedImageURIs: new Set(),\nfocusedImageURI: null,\n+ screenWidth: props.screenDimensions.width,\n};\n- mounted = false;\n- fetchingPhotos = false;\n+ }\ncomponentDidMount() {\nthis.mounted = true;\n@@ -66,6 +72,15 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\nthis.mounted = false;\n}\n+ componentDidUpdate(prevProps: Props) {\n+ const { width } = this.props.screenDimensions;\n+ if (width !== prevProps.screenDimensions.width) {\n+ // We keep screenWidth in this.state since that's what we pass in as\n+ // FlatList's extraData\n+ this.setState({ screenWidth: width });\n+ }\n+ }\n+\nguardedSetState(change) {\nif (this.mounted) {\nthis.setState(change);\n@@ -175,7 +190,7 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\nsendImage={this.sendImage}\nisFocused={this.state.focusedImageURI === uri}\nsetFocus={this.setFocus}\n- screenWidth={this.props.screenDimensions.width}\n+ screenWidth={this.state.screenWidth}\n/>\n);\n}\n@@ -204,7 +219,6 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\nonEndReached={this.onEndReached}\nonEndReachedThreshold={5}\nextraData={this.state}\n- anotherExtraData={this.props.screenDimensions.width}\n/>\n);\n} else if (error) {\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Keep all ImageGalleryKeyboard extraData in state |
129,187 | 14.05.2019 18:11:43 | 14,400 | caa490faa90441d66db38c2801de672dac2f3045 | [native] Fix ChatInputBar press for Android 4.4 | [
{
"change_type": "MODIFY",
"old_path": "native/chat/message.react.js",
"new_path": "native/chat/message.react.js",
"diff": "@@ -23,6 +23,7 @@ import {\nView,\nLayoutAnimation,\nTouchableWithoutFeedback,\n+ Platform,\n} from 'react-native';\nimport _isEqual from 'lodash/fp/isEqual';\nimport invariant from 'invariant';\n@@ -132,12 +133,21 @@ class Message extends React.PureComponent<Props> {\n/>\n);\n}\n- return (\n- <TouchableWithoutFeedback onPress={KeyboardUtils.dismiss}>\n+ const messageView = (\n<View>\n{conversationHeader}\n{message}\n</View>\n+ );\n+ if (Platform.OS === \"android\" && Platform.Version < 21) {\n+ // On old Android 4.4 devices, we can get a stack overflow during draw\n+ // when we use the TouchableWithoutFeedback below. It's just too deep of\n+ // a stack for the old hardware to handle\n+ return messageView;\n+ }\n+ return (\n+ <TouchableWithoutFeedback onPress={KeyboardUtils.dismiss}>\n+ {messageView}\n</TouchableWithoutFeedback>\n);\n}\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Fix ChatInputBar press for Android 4.4 |
129,187 | 15.05.2019 13:12:48 | 14,400 | ac87476aa10903bc2ecad7982c22fa693d0a6564 | [native] Style ImageGalleryImage buttons | [
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-image.react.js",
"new_path": "native/media/image-gallery-image.react.js",
"diff": "@@ -4,7 +4,16 @@ import type { Dimensions } from 'lib/types/media-types';\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\n-import { Image, TouchableOpacity, StyleSheet, View, Text } from 'react-native';\n+import {\n+ Image,\n+ TouchableOpacity,\n+ StyleSheet,\n+ View,\n+ Text,\n+ Platform,\n+} from 'react-native';\n+import Icon from 'react-native-vector-icons/FontAwesome';\n+import MaterialIcon from 'react-native-vector-icons/MaterialIcons';\nexport type GalleryImageInfo = {|\n...Dimensions,\n@@ -84,8 +93,10 @@ class ImageGalleryImage extends React.PureComponent<Props> {\n<TouchableOpacity\nonPress={this.onPressSend}\nstyle={styles.sendButton}\n+ activeOpacity={0.6}\nkey=\"send\"\n>\n+ <Icon name=\"send\" style={styles.buttonIcon} />\n<Text style={styles.buttonText}>\nSend\n</Text>\n@@ -97,8 +108,10 @@ class ImageGalleryImage extends React.PureComponent<Props> {\n<TouchableOpacity\nonPress={this.onPressEnqueue}\nstyle={styles.enqueueButton}\n+ activeOpacity={0.6}\nkey=\"queue\"\n>\n+ <MaterialIcon name=\"add-to-photos\" style={styles.buttonIcon} />\n<Text style={styles.buttonText}>\n{enqueueButtonText}\n</Text>\n@@ -143,6 +156,16 @@ class ImageGalleryImage extends React.PureComponent<Props> {\n}\n+const buttonStyle = {\n+ flexDirection: 'row',\n+ alignItems: 'flex-start',\n+ margin: 10,\n+ borderRadius: 20,\n+ paddingLeft: 20,\n+ paddingRight: 20,\n+ paddingTop: 10,\n+ paddingBottom: 10,\n+};\nconst styles = StyleSheet.create({\ncontainer: {\nflex: 1,\n@@ -157,21 +180,23 @@ const styles = StyleSheet.create({\njustifyContent: 'center',\n},\nsendButton: {\n- margin: 10,\n- borderRadius: 20,\n- padding: 10,\n- borderColor: 'black',\n- borderWidth: 1,\n+ ...buttonStyle,\n+ backgroundColor: '#0D9314',\n+ paddingLeft: 18,\n},\nenqueueButton: {\n- margin: 10,\n- borderRadius: 20,\n- padding: 10,\n- borderColor: 'black',\n- borderWidth: 1,\n+ ...buttonStyle,\n+ backgroundColor: '#0C3092',\n+ },\n+ buttonIcon: {\n+ alignSelf: Platform.OS === \"android\" ? 'center' : 'flex-end',\n+ marginRight: 6,\n+ color: 'white',\n+ fontSize: 18,\n+ paddingRight: 5,\n},\nbuttonText: {\n- color: 'black',\n+ color: 'white',\nfontSize: 16,\n},\n});\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Style ImageGalleryImage buttons |
129,187 | 15.05.2019 18:59:07 | 14,400 | e247653b68f933b253bf6b8fecd9feb026db05c9 | [native] ImageGalleryImage animation on focus | [
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-image.react.js",
"new_path": "native/media/image-gallery-image.react.js",
"diff": "// @flow\nimport type { Dimensions } from 'lib/types/media-types';\n+import type { ViewStyle, ImageStyle } from '../types/styles';\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\n@@ -14,6 +15,7 @@ import {\n} from 'react-native';\nimport Icon from 'react-native-vector-icons/FontAwesome';\nimport MaterialIcon from 'react-native-vector-icons/MaterialIcons';\n+import Animated, { Easing } from 'react-native-reanimated';\nexport type GalleryImageInfo = {|\n...Dimensions,\n@@ -49,22 +51,63 @@ class ImageGalleryImage extends React.PureComponent<Props> {\nscreenWidth: PropTypes.number.isRequired,\n};\nbackdrop: ?TouchableOpacity;\n+ focusProgress = new Animated.Value(0);\n+ buttonsStyle: ViewStyle;\n+ imageStyle: ImageStyle;\n+\n+ constructor(props: Props) {\n+ super(props);\n+ const buttonsScale = Animated.interpolate(\n+ this.focusProgress,\n+ {\n+ inputRange: [ 0, 1 ],\n+ outputRange: [ 1.3, 1 ],\n+ },\n+ );\n+ this.buttonsStyle = {\n+ ...styles.buttons,\n+ opacity: this.focusProgress,\n+ transform: [\n+ { scale: buttonsScale },\n+ ],\n+ };\n+ const imageScale = Animated.interpolate(\n+ this.focusProgress,\n+ {\n+ inputRange: [ 0, 1 ],\n+ outputRange: [ 1, 1.3 ],\n+ },\n+ );\n+ this.imageStyle = {\n+ transform: [\n+ { scale: imageScale },\n+ ],\n+ };\n+ }\nstatic isActive(props: Props) {\nreturn props.isFocused || props.isQueued;\n}\ncomponentDidUpdate(prevProps: Props) {\n- const { backdrop } = this;\n- if (!backdrop) {\n- return;\n- }\nconst isActive = ImageGalleryImage.isActive(this.props);\nconst wasActive = ImageGalleryImage.isActive(prevProps);\nif (isActive && !wasActive) {\n- backdrop.setOpacityTo(0.2, 0);\n+ if (this.backdrop) {\n+ this.backdrop.setOpacityTo(0.2, 0);\n+ }\n+ Animated.timing(\n+ this.focusProgress,\n+ { duration: 400, toValue: 1, easing: Easing.inOut(Easing.ease) },\n+ ).start();\n} else if (!isActive && wasActive) {\n- backdrop.setOpacityTo(1, 0);\n+ if (this.backdrop) {\n+ this.backdrop.setOpacityTo(1, 0);\n+ }\n+ Animated.timing(\n+ this.focusProgress,\n+ { duration: 400, toValue: 0, easing: Easing.inOut(Easing.ease) },\n+ ).start();\n}\n}\n@@ -118,9 +161,9 @@ class ImageGalleryImage extends React.PureComponent<Props> {\n</TouchableOpacity>\n);\nbuttons = (\n- <View style={styles.buttons}>\n+ <Animated.View style={this.buttonsStyle}>\n{buttonList}\n- </View>\n+ </Animated.View>\n);\n}\n@@ -128,10 +171,13 @@ class ImageGalleryImage extends React.PureComponent<Props> {\n<View style={[ styles.container, dimensionsStyle ]}>\n<TouchableOpacity\nonPress={this.onPressBackdrop}\n- style={[ styles.container, backdropStyle ]}\n+ style={[ backdropStyle ]}\nref={this.backdropRef}\n>\n- <Image source={source} style={dimensionsStyle} />\n+ <Animated.Image\n+ source={source}\n+ style={[ this.imageStyle, dimensionsStyle ]}\n+ />\n</TouchableOpacity>\n{buttons}\n</View>\n@@ -169,6 +215,7 @@ const buttonStyle = {\nconst styles = StyleSheet.create({\ncontainer: {\nflex: 1,\n+ overflow: 'hidden',\n},\nbuttons: {\nposition: 'absolute',\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] ImageGalleryImage animation on focus |
129,187 | 15.05.2019 19:31:43 | 14,400 | 7ddc6ffe60fbd5b653749f559a656c61de8c0afb | [native] Scroll ImageGalleryKeyboard to full visibility when pressed | [
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-keyboard.react.js",
"new_path": "native/media/image-gallery-keyboard.react.js",
"diff": "import type { GalleryImageInfo } from './image-gallery-image.react';\nimport type { AppState } from '../redux/redux-setup';\nimport { type Dimensions, dimensionsPropType } from 'lib/types/media-types';\n+import type { ViewToken } from 'react-native/Libraries/Lists/ViewabilityHelper';\nimport * as React from 'react';\nimport {\n@@ -49,6 +50,8 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\n};\nmounted = false;\nfetchingPhotos = false;\n+ flatList: ?FlatList;\n+ viewableIndices: number[] = [];\nconstructor(props: Props) {\nsuper(props);\n@@ -72,13 +75,33 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\nthis.mounted = false;\n}\n- componentDidUpdate(prevProps: Props) {\n+ componentDidUpdate(prevProps: Props, prevState: State) {\nconst { width } = this.props.screenDimensions;\nif (width !== prevProps.screenDimensions.width) {\n// We keep screenWidth in this.state since that's what we pass in as\n// FlatList's extraData\nthis.setState({ screenWidth: width });\n}\n+\n+ const { flatList, viewableIndices } = this;\n+ const { imageInfos, focusedImageURI } = this.state;\n+ if (\n+ flatList &&\n+ imageInfos &&\n+ focusedImageURI &&\n+ focusedImageURI !== prevState.focusedImageURI\n+ ) {\n+ const index = imageInfos.findIndex(({ uri }) => uri === focusedImageURI);\n+ invariant(\n+ index !== null && index !== undefined,\n+ `could not find ${focusedImageURI} in imageInfos state!`,\n+ );\n+ if (index === this.viewableIndices[0]) {\n+ flatList.scrollToIndex({ index });\n+ } else if (index === viewableIndices[viewableIndices.length - 1]) {\n+ flatList.scrollToIndex({ index, viewPosition: 1 });\n+ }\n+ }\n}\nguardedSetState(change) {\n@@ -218,7 +241,9 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\nshowsHorizontalScrollIndicator={false}\nonEndReached={this.onEndReached}\nonEndReachedThreshold={5}\n+ onViewableItemsChanged={this.onViewableItemsChanged}\nextraData={this.state}\n+ ref={this.flatListRef}\n/>\n);\n} else if (error) {\n@@ -239,6 +264,10 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\n);\n}\n+ flatListRef = (flatList: ?FlatList) => {\n+ this.flatList = flatList;\n+ }\n+\nonContainerLayout = (\nevent: { nativeEvent: { layout: { height: number } } },\n) => {\n@@ -252,6 +281,19 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\n}\n}\n+ onViewableItemsChanged = (info: {\n+ viewableItems: ViewToken[],\n+ changed: ViewToken[],\n+ }) => {\n+ const viewableIndices = [];\n+ for (let { index } of info.viewableItems) {\n+ if (index !== null && index !== undefined) {\n+ viewableIndices.push(index);\n+ }\n+ }\n+ this.viewableIndices = viewableIndices;\n+ }\n+\nsetImageQueued = (imageInfo: GalleryImageInfo, isQueued: bool) => {\nthis.setState((prevState: State) => {\nconst prevQueuedImageURIs = [ ...prevState.queuedImageURIs ];\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Scroll ImageGalleryKeyboard to full visibility when pressed |
129,187 | 15.05.2019 19:52:43 | 14,400 | 8ed65831a0f89a6baa4460854c64638683aa5c48 | [native] lottie-react-native | [
{
"change_type": "MODIFY",
"old_path": "native/android/app/build.gradle",
"new_path": "native/android/app/build.gradle",
"diff": "@@ -147,6 +147,7 @@ android {\n}\ndependencies {\n+ implementation project(':lottie-react-native')\nimplementation project(':@react-native-community_cameraroll')\nimplementation project(':react-native-firebase')\nimplementation \"com.google.android.gms:play-services-base:16.1.0\"\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": "@@ -3,6 +3,7 @@ package org.squadcal;\nimport android.app.Application;\nimport com.facebook.react.ReactApplication;\n+import com.airbnb.android.react.lottie.LottiePackage;\nimport com.reactnativecommunity.cameraroll.CameraRollPackage;\nimport io.invertase.firebase.RNFirebasePackage;\nimport io.invertase.firebase.messaging.RNFirebaseMessagingPackage;\n@@ -39,6 +40,7 @@ public class MainApplication extends Application implements ReactApplication {\nprotected List<ReactPackage> getPackages() {\nreturn Arrays.<ReactPackage>asList(\nnew MainReactPackage(),\n+ new LottiePackage(),\nnew CameraRollPackage(),\nnew RNFirebasePackage(),\nnew RNFirebaseMessagingPackage(),\n"
},
{
"change_type": "MODIFY",
"old_path": "native/android/settings.gradle",
"new_path": "native/android/settings.gradle",
"diff": "rootProject.name = 'SquadCal'\n+include ':lottie-react-native'\n+project(':lottie-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/lottie-react-native/src/android')\ninclude ':@react-native-community_cameraroll'\nproject(':@react-native-community_cameraroll').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/cameraroll/android')\ninclude ':react-native-firebase'\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "native/flow-typed/npm/lottie-react-native_vx.x.x.js",
"diff": "+// flow-typed signature: f943172ee1af2d7c7075fa81a12aab11\n+// flow-typed version: <<STUB>>/lottie-react-native_v^2.6.1/flow_v0.92.0\n+\n+/**\n+ * This is an autogenerated libdef stub for:\n+ *\n+ * 'lottie-react-native'\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 'lottie-react-native' {\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 'lottie-react-native/lib/index' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'lottie-react-native/lib/LottieView' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'lottie-react-native/src/js/index' {\n+ declare module.exports: any;\n+}\n+\n+declare module 'lottie-react-native/src/js/LottieView' {\n+ declare module.exports: any;\n+}\n+\n+// Filename aliases\n+declare module 'lottie-react-native/lib/index.js' {\n+ declare module.exports: $Exports<'lottie-react-native/lib/index'>;\n+}\n+declare module 'lottie-react-native/lib/LottieView.js' {\n+ declare module.exports: $Exports<'lottie-react-native/lib/LottieView'>;\n+}\n+declare module 'lottie-react-native/src/js/index.js' {\n+ declare module.exports: $Exports<'lottie-react-native/src/js/index'>;\n+}\n+declare module 'lottie-react-native/src/js/LottieView.js' {\n+ declare module.exports: $Exports<'lottie-react-native/src/js/LottieView'>;\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "native/ios/Podfile",
"new_path": "native/ios/Podfile",
"diff": "@@ -40,6 +40,7 @@ target 'SquadCal' do\npod 'react-native-keyboard-tracking-view', :path => '../../node_modules/react-native-keyboard-tracking-view'\npod 'react-native-keyboard-input', :path => '../../node_modules/react-native-keyboard-input'\npod 'react-native-cameraroll', :path => '../../node_modules/@react-native-community/cameraroll'\n+ pod 'lottie-react-native', :path => '../../node_modules/lottie-react-native'\ntarget 'SquadCalTests' do\ninherit! :search_paths\n"
},
{
"change_type": "MODIFY",
"old_path": "native/ios/Podfile.lock",
"new_path": "native/ios/Podfile.lock",
"diff": "@@ -32,6 +32,10 @@ PODS:\n- libwebp/utils (1.0.2):\n- libwebp/core\n- libwebp/webp (1.0.2)\n+ - lottie-ios (2.5.3)\n+ - lottie-react-native (2.6.1):\n+ - lottie-ios (~> 2.5.0)\n+ - React\n- React (0.59.4):\n- React/Core (= 0.59.4)\n- react-native-async-storage (1.3.0):\n@@ -133,6 +137,7 @@ DEPENDENCIES:\n- DoubleConversion (from `../../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)\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-react-native (from `../../node_modules/lottie-react-native`)\n- \"react-native-async-storage (from `../../node_modules/@react-native-community/async-storage`)\"\n- \"react-native-cameraroll (from `../../node_modules/@react-native-community/cameraroll`)\"\n- react-native-exit-app (from `../../node_modules/react-native-exit-app`)\n@@ -167,6 +172,7 @@ SPEC REPOS:\n- boost-for-react-native\n- FLAnimatedImage\n- libwebp\n+ - lottie-ios\n- SDWebImage\nEXTERNAL SOURCES:\n@@ -176,6 +182,8 @@ EXTERNAL SOURCES:\n:podspec: \"../../node_modules/react-native/third-party-podspecs/Folly.podspec\"\nglog:\n:podspec: \"../../node_modules/react-native/third-party-podspecs/glog.podspec\"\n+ lottie-react-native:\n+ :path: \"../../node_modules/lottie-react-native\"\nReact:\n:path: \"../../node_modules/react-native\"\nreact-native-async-storage:\n@@ -221,6 +229,8 @@ SPEC CHECKSUMS:\nFolly: de497beb10f102453a1afa9edbf8cf8a251890de\nglog: aefd1eb5dda2ab95ba0938556f34b98e2da3a60d\nlibwebp: b068a3bd7c45f7460f6715be7bed1a18fd5d6b48\n+ lottie-ios: a50d5c0160425cd4b01b852bb9578963e6d92d31\n+ lottie-react-native: 3d8181d43619b1fe804c828bd5a09d20fe8bdea7\nReact: 5cb71fb1a15b5ce04794ab49e24b48ebe4c94e65\nreact-native-async-storage: 6aa3086d7b4f45e49adc8e087b4a03e47279aa1b\nreact-native-cameraroll: 63207a7daac2786786b301545a709c19f285aec6\n@@ -241,6 +251,6 @@ SPEC CHECKSUMS:\nSDWebImage: 3f3f0c02f09798048c47a5ed0a13f17b063572d8\nyoga: 596e61c9b57751d08a22b07aba310dbd3e65ab75\n-PODFILE CHECKSUM: c5dd2e520f9a9151f0af2081ebe40fcb63e74e0a\n+PODFILE CHECKSUM: 4eb375e902364646a45875bc7e829aa6b00f5de5\nCOCOAPODS: 1.6.1\n"
},
{
"change_type": "MODIFY",
"old_path": "native/package.json",
"new_path": "native/package.json",
"diff": "\"invariant\": \"^2.2.2\",\n\"lib\": \"0.0.1\",\n\"lodash\": \"^4.17.5\",\n+ \"lottie-react-native\": \"^2.6.1\",\n\"react\": \"16.8.3\",\n\"react-native\": \"0.59.4\",\n\"react-native-exit-app\": \"git+https://github.com/wumke/react-native-exit-app.git#460d40aaacb1aa95d7ed5f21e7906ba930c74301\",\n"
},
{
"change_type": "MODIFY",
"old_path": "yarn.lock",
"new_path": "yarn.lock",
"diff": "@@ -4118,6 +4118,11 @@ decompress-response@^3.2.0:\ndependencies:\nmimic-response \"^1.0.0\"\n+dedent@^0.6.0:\n+ version \"0.6.0\"\n+ resolved \"https://registry.yarnpkg.com/dedent/-/dedent-0.6.0.tgz#0e6da8f0ce52838ef5cec5c8f9396b0c1b64a3cb\"\n+ integrity sha1-Dm2o8M5Sg471zsXI+TlrDBtko8s=\n+\ndeep-equal@^1.0.1:\nversion \"1.0.1\"\nresolved \"https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5\"\n@@ -7753,6 +7758,21 @@ loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3\ndependencies:\njs-tokens \"^3.0.0 || ^4.0.0\"\n+lottie-ios@2.5.0:\n+ version \"2.5.0\"\n+ resolved \"https://registry.yarnpkg.com/lottie-ios/-/lottie-ios-2.5.0.tgz#55c808e785d4a6933b0c10b395530b17098b05de\"\n+ integrity sha1-VcgI54XUppM7DBCzlVMLFwmLBd4=\n+\n+lottie-react-native@^2.6.1:\n+ version \"2.6.1\"\n+ resolved \"https://registry.yarnpkg.com/lottie-react-native/-/lottie-react-native-2.6.1.tgz#330d24fa6aac5928ea63f8e181b9b7d930a1a119\"\n+ integrity sha512-Z+6lARvWWhB8n8OSmW7/aHkV71ftsmO7hYXFt0D+REy/G40mpkQt1H7Cdy1HqY4cKAp7EYDWVxhu5+fkdD6o4g==\n+ dependencies:\n+ invariant \"^2.2.2\"\n+ lottie-ios \"2.5.0\"\n+ prop-types \"^15.5.10\"\n+ react-native-safe-module \"^1.1.0\"\n+\nloud-rejection@^1.0.0:\nversion \"1.6.0\"\nresolved \"https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f\"\n@@ -10645,6 +10665,13 @@ react-native-safe-area-view@^0.13.0:\ndependencies:\nhoist-non-react-statics \"^2.3.1\"\n+react-native-safe-module@^1.1.0:\n+ version \"1.2.0\"\n+ resolved \"https://registry.yarnpkg.com/react-native-safe-module/-/react-native-safe-module-1.2.0.tgz#a23824ca24edc2901913694a76646475113d570d\"\n+ integrity sha1-ojgkyiTtwpAZE2lKdmRkdRE9Vw0=\n+ dependencies:\n+ dedent \"^0.6.0\"\n+\nreact-native-screens@1.0.0-alpha.17:\nversion \"1.0.0-alpha.17\"\nresolved \"https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-1.0.0-alpha.17.tgz#8c1a7224b967c476670963fce7d06b946e7158e9\"\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] lottie-react-native |
129,187 | 15.05.2019 20:42:26 | 14,400 | 71d886277e8ea1fe38e65c744618c89c363425d1 | [native] Animation for ImageGalleryKeyboard queue mode | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "native/animations/check.json",
"diff": "+{\"v\":\"4.12.0\",\"fr\":29.9700012207031,\"ip\":0,\"op\":30.0000012219251,\"w\":60,\"h\":60,\"nm\":\"check_draw_outline\",\"ddd\":0,\"assets\":[],\"layers\":[{\"ddd\":0,\"ind\":1,\"ty\":4,\"nm\":\"Shape Layer 1\",\"sr\":1,\"ks\":{\"o\":{\"a\":0,\"k\":100,\"ix\":11},\"r\":{\"a\":0,\"k\":0,\"ix\":10},\"p\":{\"a\":0,\"k\":[30,30,0],\"ix\":2},\"a\":{\"a\":0,\"k\":[0,0,0],\"ix\":1},\"s\":{\"a\":0,\"k\":[100,100,100],\"ix\":6}},\"ao\":0,\"shapes\":[{\"ty\":\"gr\",\"it\":[{\"ind\":0,\"ty\":\"sh\",\"ix\":1,\"ks\":{\"a\":0,\"k\":{\"i\":[[0,0],[0,0],[0,0]],\"o\":[[0,0],[0,0],[0,0]],\"v\":[[-14.75,-3],[-1.25,8.25],[14.25,-11.25]],\"c\":false},\"ix\":2},\"nm\":\"Path 1\",\"mn\":\"ADBE Vector Shape - Group\",\"hd\":false},{\"ty\":\"tm\",\"s\":{\"a\":0,\"k\":0,\"ix\":1},\"e\":{\"a\":1,\"k\":[{\"i\":{\"x\":[0.274],\"y\":[1]},\"o\":{\"x\":[0.556],\"y\":[0]},\"n\":[\"0p274_1_0p556_0\"],\"t\":3,\"s\":[0],\"e\":[100]},{\"t\":14.0000005702317}],\"ix\":2},\"o\":{\"a\":0,\"k\":0,\"ix\":3},\"m\":1,\"ix\":2,\"nm\":\"Trim Paths 1\",\"mn\":\"ADBE Vector Filter - Trim\",\"hd\":false},{\"ty\":\"st\",\"c\":{\"a\":0,\"k\":[1,1,1,1],\"ix\":3},\"o\":{\"a\":0,\"k\":100,\"ix\":4},\"w\":{\"a\":0,\"k\":7,\"ix\":5},\"lc\":1,\"lj\":1,\"ml\":4,\"nm\":\"Stroke 1\",\"mn\":\"ADBE Vector Graphic - Stroke\",\"hd\":false},{\"ty\":\"tr\",\"p\":{\"a\":0,\"k\":[0,0],\"ix\":2},\"a\":{\"a\":0,\"k\":[0,0],\"ix\":1},\"s\":{\"a\":0,\"k\":[100,100],\"ix\":3},\"r\":{\"a\":0,\"k\":0,\"ix\":6},\"o\":{\"a\":0,\"k\":100,\"ix\":7},\"sk\":{\"a\":0,\"k\":0,\"ix\":4},\"sa\":{\"a\":0,\"k\":0,\"ix\":5},\"nm\":\"Transform\"}],\"nm\":\"Shape 1\",\"np\":3,\"cix\":2,\"ix\":1,\"mn\":\"ADBE Vector Group\",\"hd\":false}],\"ip\":3.00000012219251,\"op\":30.0000012219251,\"st\":-15.0000006109625,\"bm\":0},{\"ddd\":0,\"ind\":3,\"ty\":4,\"nm\":\"Circ\",\"sr\":1,\"ks\":{\"o\":{\"a\":0,\"k\":100,\"ix\":11},\"r\":{\"a\":0,\"k\":0,\"ix\":10},\"p\":{\"a\":0,\"k\":[30,29.25,0],\"ix\":2},\"a\":{\"a\":0,\"k\":[0,0,0],\"ix\":1},\"s\":{\"a\":1,\"k\":[{\"i\":{\"x\":[0.432,0.432,0.601],\"y\":[1.002,1.002,3.751]},\"o\":{\"x\":[0.052,0.052,0.172],\"y\":[0.12,0.12,-1.405]},\"n\":[\"0p432_1p002_0p052_0p12\",\"0p432_1p002_0p052_0p12\",\"0p601_3p751_0p172_-1p405\"],\"t\":1,\"s\":[17.895,17.895,100],\"e\":[94.836,94.836,100]},{\"i\":{\"x\":[0.368,0.368,0.691],\"y\":[1.118,1.118,0.734]},\"o\":{\"x\":[0.453,0.453,0.35],\"y\":[-0.038,-0.038,-2.656]},\"n\":[\"0p368_1p118_0p453_-0p038\",\"0p368_1p118_0p453_-0p038\",\"0p691_0p734_0p35_-2p656\"],\"t\":11,\"s\":[94.836,94.836,100],\"e\":[88.847,88.847,100]},{\"t\":22.0000008960784}],\"ix\":6}},\"ao\":0,\"shapes\":[{\"ty\":\"gr\",\"it\":[{\"d\":1,\"ty\":\"el\",\"s\":{\"a\":0,\"k\":[59.396,59.396],\"ix\":2},\"p\":{\"a\":0,\"k\":[0,0],\"ix\":3},\"nm\":\"Ellipse Path 1\",\"mn\":\"ADBE Vector Shape - Ellipse\",\"hd\":false},{\"ty\":\"st\",\"c\":{\"a\":0,\"k\":[1,1,1,1],\"ix\":3},\"o\":{\"a\":0,\"k\":100,\"ix\":4},\"w\":{\"a\":0,\"k\":3,\"ix\":5},\"lc\":1,\"lj\":1,\"ml\":4,\"nm\":\"Stroke 1\",\"mn\":\"ADBE Vector Graphic - Stroke\",\"hd\":false},{\"ty\":\"fl\",\"c\":{\"a\":0,\"k\":[0.494117647409,0.827450990677,0.129411771894,1],\"ix\":4},\"o\":{\"a\":0,\"k\":100,\"ix\":5},\"r\":1,\"nm\":\"Fill 1\",\"mn\":\"ADBE Vector Graphic - Fill\",\"hd\":false},{\"ty\":\"tr\",\"p\":{\"a\":0,\"k\":[0,0.75],\"ix\":2},\"a\":{\"a\":0,\"k\":[0,0],\"ix\":1},\"s\":{\"a\":0,\"k\":[100,100],\"ix\":3},\"r\":{\"a\":0,\"k\":0,\"ix\":6},\"o\":{\"a\":0,\"k\":100,\"ix\":7},\"sk\":{\"a\":0,\"k\":0,\"ix\":4},\"sa\":{\"a\":0,\"k\":0,\"ix\":5},\"nm\":\"Transform\"}],\"nm\":\"Ellipse 1\",\"np\":3,\"cix\":2,\"ix\":1,\"mn\":\"ADBE Vector Group\",\"hd\":false}],\"ip\":1.00000004073083,\"op\":30.000001221925,\"st\":-3.00000012219251,\"bm\":0}]}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-image.react.js",
"new_path": "native/media/image-gallery-image.react.js",
"diff": "@@ -16,6 +16,7 @@ import {\nimport Icon from 'react-native-vector-icons/FontAwesome';\nimport MaterialIcon from 'react-native-vector-icons/MaterialIcons';\nimport Animated, { Easing } from 'react-native-reanimated';\n+import LottieView from 'lottie-react-native';\nexport type GalleryImageInfo = {|\n...Dimensions,\n@@ -128,41 +129,42 @@ class ImageGalleryImage extends React.PureComponent<Props> {\n};\nlet buttons = null;\n- if (active) {\n- const buttonList = [];\n- const { queueModeActive } = this.props;\n- if (!queueModeActive) {\n- buttonList.push(\n+ const { queueModeActive, isQueued } = this.props;\n+ if (isQueued) {\n+ buttons = (\n+ <View style={styles.buttons} pointerEvents='box-none'>\n+ <LottieView\n+ source={require('../animations/check.json')}\n+ style={styles.checkAnimation}\n+ loop={false}\n+ resizeMode=\"cover\"\n+ autoPlay\n+ />\n+ </View>\n+ );\n+ } else if (!queueModeActive && active) {\n+ buttons = (\n+ <Animated.View style={this.buttonsStyle} pointerEvents='box-none'>\n<TouchableOpacity\nonPress={this.onPressSend}\nstyle={styles.sendButton}\nactiveOpacity={0.6}\n- key=\"send\"\n>\n<Icon name=\"send\" style={styles.buttonIcon} />\n<Text style={styles.buttonText}>\nSend\n</Text>\n</TouchableOpacity>\n- );\n- }\n- const enqueueButtonText = queueModeActive ? \"Select\" : \"Queue\";\n- buttonList.push(\n<TouchableOpacity\nonPress={this.onPressEnqueue}\nstyle={styles.enqueueButton}\nactiveOpacity={0.6}\n- key=\"queue\"\n>\n<MaterialIcon name=\"add-to-photos\" style={styles.buttonIcon} />\n<Text style={styles.buttonText}>\n- {enqueueButtonText}\n+ Queue\n</Text>\n</TouchableOpacity>\n- );\n- buttons = (\n- <Animated.View style={this.buttonsStyle}>\n- {buttonList}\n</Animated.View>\n);\n}\n@@ -189,15 +191,21 @@ class ImageGalleryImage extends React.PureComponent<Props> {\n}\nonPressBackdrop = () => {\n+ if (this.props.isQueued) {\n+ this.props.setImageQueued(this.props.imageInfo, false);\n+ } else if (this.props.queueModeActive) {\n+ this.props.setImageQueued(this.props.imageInfo, true);\n+ } else {\nthis.props.setFocus(this.props.imageInfo);\n}\n+ }\nonPressSend = () => {\nthis.props.sendImage(this.props.imageInfo);\n}\nonPressEnqueue = () => {\n- this.props.setImageQueued(this.props.imageInfo, !this.props.isQueued);\n+ this.props.setImageQueued(this.props.imageInfo, true);\n}\n}\n@@ -246,6 +254,9 @@ const styles = StyleSheet.create({\ncolor: 'white',\nfontSize: 16,\n},\n+ checkAnimation: {\n+ width: 128,\n+ },\n});\nexport default ImageGalleryImage;\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Animation for ImageGalleryKeyboard queue mode |
129,187 | 15.05.2019 22:41:50 | 14,400 | 90d802f45dc22f0545b36ef73b9b3b86e0c7bf60 | [native] Fix ImageGalleryImage queue animation and avoid accidental closure on Android | [
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-image.react.js",
"new_path": "native/media/image-gallery-image.react.js",
"diff": "@@ -12,16 +12,23 @@ import {\nView,\nText,\nPlatform,\n+ TouchableWithoutFeedback,\n+ Animated,\n+ Easing,\n} from 'react-native';\nimport Icon from 'react-native-vector-icons/FontAwesome';\nimport MaterialIcon from 'react-native-vector-icons/MaterialIcons';\n-import Animated, { Easing } from 'react-native-reanimated';\nimport LottieView from 'lottie-react-native';\nexport type GalleryImageInfo = {|\n...Dimensions,\nuri: string,\n|};\n+const animationSpec = {\n+ duration: 400,\n+ easing: Easing.inOut(Easing.ease),\n+ useNativeDriver: true,\n+};\ntype Props = {|\nimageInfo: GalleryImageInfo,\n@@ -55,16 +62,14 @@ class ImageGalleryImage extends React.PureComponent<Props> {\nfocusProgress = new Animated.Value(0);\nbuttonsStyle: ViewStyle;\nimageStyle: ImageStyle;\n+ checkProgress = new Animated.Value(0);\nconstructor(props: Props) {\nsuper(props);\n- const buttonsScale = Animated.interpolate(\n- this.focusProgress,\n- {\n+ const buttonsScale = this.focusProgress.interpolate({\ninputRange: [ 0, 1 ],\noutputRange: [ 1.3, 1 ],\n- },\n- );\n+ });\nthis.buttonsStyle = {\n...styles.buttons,\nopacity: this.focusProgress,\n@@ -72,13 +77,10 @@ class ImageGalleryImage extends React.PureComponent<Props> {\n{ scale: buttonsScale },\n],\n};\n- const imageScale = Animated.interpolate(\n- this.focusProgress,\n- {\n+ const imageScale = this.focusProgress.interpolate({\ninputRange: [ 0, 1 ],\noutputRange: [ 1, 1.3 ],\n- },\n- );\n+ });\nthis.imageStyle = {\ntransform: [\n{ scale: imageScale },\n@@ -91,24 +93,42 @@ class ImageGalleryImage extends React.PureComponent<Props> {\n}\ncomponentDidUpdate(prevProps: Props) {\n+ const animations = [];\n+\nconst isActive = ImageGalleryImage.isActive(this.props);\nconst wasActive = ImageGalleryImage.isActive(prevProps);\nif (isActive && !wasActive) {\nif (this.backdrop) {\nthis.backdrop.setOpacityTo(0.2, 0);\n}\n- Animated.timing(\n+ animations.push(Animated.timing(\nthis.focusProgress,\n- { duration: 400, toValue: 1, easing: Easing.inOut(Easing.ease) },\n- ).start();\n+ { ...animationSpec, toValue: 1 },\n+ ));\n} else if (!isActive && wasActive) {\nif (this.backdrop) {\nthis.backdrop.setOpacityTo(1, 0);\n}\n- Animated.timing(\n+ animations.push(Animated.timing(\nthis.focusProgress,\n- { duration: 400, toValue: 0, easing: Easing.inOut(Easing.ease) },\n- ).start();\n+ { ...animationSpec, toValue: 0 },\n+ ));\n+ }\n+\n+ if (this.props.isQueued && !prevProps.isQueued) {\n+ animations.push(Animated.timing(\n+ this.checkProgress,\n+ { ...animationSpec, toValue: 1 },\n+ ));\n+ } else if (!this.props.isQueued && prevProps.isQueued) {\n+ animations.push(Animated.timing(\n+ this.checkProgress,\n+ { ...animationSpec, toValue: 0 },\n+ ));\n+ }\n+\n+ if (animations.length > 0) {\n+ Animated.parallel(animations).start();\n}\n}\n@@ -130,21 +150,9 @@ class ImageGalleryImage extends React.PureComponent<Props> {\nlet buttons = null;\nconst { queueModeActive, isQueued } = this.props;\n- if (isQueued) {\n- buttons = (\n- <View style={styles.buttons} pointerEvents='box-none'>\n- <LottieView\n- source={require('../animations/check.json')}\n- style={styles.checkAnimation}\n- loop={false}\n- resizeMode=\"cover\"\n- autoPlay\n- />\n- </View>\n- );\n- } else if (!queueModeActive && active) {\n+ if (!queueModeActive && active) {\nbuttons = (\n- <Animated.View style={this.buttonsStyle} pointerEvents='box-none'>\n+ <React.Fragment>\n<TouchableOpacity\nonPress={this.onPressSend}\nstyle={styles.sendButton}\n@@ -165,7 +173,7 @@ class ImageGalleryImage extends React.PureComponent<Props> {\nQueue\n</Text>\n</TouchableOpacity>\n- </Animated.View>\n+ </React.Fragment>\n);\n}\n@@ -181,7 +189,21 @@ class ImageGalleryImage extends React.PureComponent<Props> {\nstyle={[ this.imageStyle, dimensionsStyle ]}\n/>\n</TouchableOpacity>\n+ <Animated.View style={this.buttonsStyle} pointerEvents=\"box-none\">\n+ <TouchableWithoutFeedback\n+ style={styles.buttons}\n+ onPress={this.onPressBackdrop}\n+ >\n+ <LottieView\n+ source={require('../animations/check.json')}\n+ progress={this.checkProgress}\n+ style={styles.checkAnimation}\n+ pointerEvents=\"box-none\"\n+ resizeMode=\"cover\"\n+ />\n+ </TouchableWithoutFeedback>\n{buttons}\n+ </Animated.View>\n</View>\n);\n}\n@@ -255,6 +277,7 @@ const styles = StyleSheet.create({\nfontSize: 16,\n},\ncheckAnimation: {\n+ position: 'absolute',\nwidth: 128,\n},\n});\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Fix ImageGalleryImage queue animation and avoid accidental closure on Android |
129,187 | 15.05.2019 22:51:14 | 14,400 | 5bc1e2ecbca767210fe74be33b638ef1163343f1 | [native] Scroll ImageGalleryKeyboard to newly queued ImageGalleryImage | [
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-keyboard.react.js",
"new_path": "native/media/image-gallery-keyboard.react.js",
"diff": "@@ -84,25 +84,33 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\n}\nconst { flatList, viewableIndices } = this;\n- const { imageInfos, focusedImageURI } = this.state;\n- if (\n- flatList &&\n- imageInfos &&\n- focusedImageURI &&\n- focusedImageURI !== prevState.focusedImageURI\n- ) {\n- const index = imageInfos.findIndex(({ uri }) => uri === focusedImageURI);\n- invariant(\n- index !== null && index !== undefined,\n- `could not find ${focusedImageURI} in imageInfos state!`,\n- );\n- if (index === this.viewableIndices[0]) {\n+ const { imageInfos, focusedImageURI, queuedImageURIs } = this.state;\n+ if (flatList && imageInfos) {\n+ let newURI;\n+ if (focusedImageURI && focusedImageURI !== prevState.focusedImageURI) {\n+ newURI = focusedImageURI;\n+ } else if (queuedImageURIs.size > prevState.queuedImageURIs.size) {\n+ for (let queuedImageURI of queuedImageURIs) {\n+ if (prevState.queuedImageURIs.has(queuedImageURI)) {\n+ continue;\n+ }\n+ newURI = queuedImageURI;\n+ break;\n+ }\n+ }\n+ let index;\n+ if (newURI !== null & newURI !== undefined) {\n+ index = imageInfos.findIndex(({ uri }) => uri === newURI);\n+ }\n+ if (index !== null && index !== undefined) {\n+ if (index === viewableIndices[0]) {\nflatList.scrollToIndex({ index });\n} else if (index === viewableIndices[viewableIndices.length - 1]) {\nflatList.scrollToIndex({ index, viewPosition: 1 });\n}\n}\n}\n+ }\nguardedSetState(change) {\nif (this.mounted) {\n@@ -303,13 +311,17 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\n...prevQueuedImageURIs,\nimageInfo.uri,\n]),\n+ focusedImageURI: null,\n};\n}\nconst queuedImageURIs = prevQueuedImageURIs.filter(\nuri => uri !== imageInfo.uri,\n);\nif (queuedImageURIs.length < prevQueuedImageURIs.length) {\n- return { queuedImageURIs: new Set(queuedImageURIs) };\n+ return {\n+ queuedImageURIs: new Set(queuedImageURIs),\n+ focusedImageURI: null,\n+ };\n}\nreturn null;\n});\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Scroll ImageGalleryKeyboard to newly queued ImageGalleryImage |
129,187 | 15.05.2019 22:58:01 | 14,400 | a178a201ce08906cb9a33c22ddf350f7adadfe21 | [native] Keep ImageGalleryKeyboard queue mode on once activated | [
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-keyboard.react.js",
"new_path": "native/media/image-gallery-keyboard.react.js",
"diff": "@@ -39,7 +39,7 @@ type State = {|\ncontainerHeight: ?number,\n// null means end reached; undefined means no fetch yet\ncursor: ?string,\n- queuedImageURIs: Set<string>,\n+ queuedImageURIs: ?Set<string>,\nfocusedImageURI: ?string,\nscreenWidth: number,\n|};\n@@ -60,7 +60,7 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\nerror: null,\ncontainerHeight: null,\ncursor: undefined,\n- queuedImageURIs: new Set(),\n+ queuedImageURIs: null,\nfocusedImageURI: null,\nscreenWidth: props.screenDimensions.width,\n};\n@@ -85,13 +85,18 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\nconst { flatList, viewableIndices } = this;\nconst { imageInfos, focusedImageURI, queuedImageURIs } = this.state;\n+ const prevQueuedImageURIs = prevState.queuedImageURIs;\nif (flatList && imageInfos) {\nlet newURI;\nif (focusedImageURI && focusedImageURI !== prevState.focusedImageURI) {\nnewURI = focusedImageURI;\n- } else if (queuedImageURIs.size > prevState.queuedImageURIs.size) {\n+ } else if (\n+ queuedImageURIs &&\n+ (!prevQueuedImageURIs ||\n+ queuedImageURIs.size > prevQueuedImageURIs.size)\n+ ) {\nfor (let queuedImageURI of queuedImageURIs) {\n- if (prevState.queuedImageURIs.has(queuedImageURI)) {\n+ if (prevQueuedImageURIs && prevQueuedImageURIs.has(queuedImageURI)) {\ncontinue;\n}\nnewURI = queuedImageURI;\n@@ -99,7 +104,7 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\n}\n}\nlet index;\n- if (newURI !== null & newURI !== undefined) {\n+ if (newURI !== null && newURI !== undefined) {\nindex = imageInfos.findIndex(({ uri }) => uri === newURI);\n}\nif (index !== null && index !== undefined) {\n@@ -202,14 +207,14 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\n}\nget queueModeActive() {\n- return this.state.queuedImageURIs.size > 0;\n+ return !!this.state.queuedImageURIs;\n}\nrenderItem = (row: { item: GalleryImageInfo }) => {\nconst { containerHeight, queuedImageURIs } = this.state;\ninvariant(containerHeight, \"should be set\");\nconst { uri } = row.item;\n- const isQueued = queuedImageURIs.has(uri);\n+ const isQueued = !!(queuedImageURIs && queuedImageURIs.has(uri));\nconst { queueModeActive } = this;\nreturn (\n<ImageGalleryImage\n@@ -304,7 +309,9 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\nsetImageQueued = (imageInfo: GalleryImageInfo, isQueued: bool) => {\nthis.setState((prevState: State) => {\n- const prevQueuedImageURIs = [ ...prevState.queuedImageURIs ];\n+ const prevQueuedImageURIs = prevState.queuedImageURIs\n+ ? [ ...prevState.queuedImageURIs ]\n+ : [];\nif (isQueued) {\nreturn {\nqueuedImageURIs: new Set([\n@@ -337,9 +344,9 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\nsendQueuedImages = () => {\nconst { imageInfos, queuedImageURIs } = this.state;\n- invariant(imageInfos, \"should be set\");\n+ invariant(imageInfos && queuedImageURIs, \"should be set\");\nconst queuedImageInfos = [];\n- for (let uri of this.state.queuedImageURIs) {\n+ for (let uri of queuedImageURIs) {\nfor (let imageInfo of imageInfos) {\nif (imageInfo.uri === uri) {\nqueuedImageInfos.push(imageInfo);\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Keep ImageGalleryKeyboard queue mode on once activated |
129,187 | 15.05.2019 23:04:33 | 14,400 | 2eff98731fc71b4ac6352dc86d7998d93aa89d8e | [native] Allow ImageGalleryImage unfocus on backdrop press | [
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-image.react.js",
"new_path": "native/media/image-gallery-image.react.js",
"diff": "@@ -38,7 +38,7 @@ type Props = {|\nsetImageQueued: (image: GalleryImageInfo, isQueued: bool) => void,\nsendImage: (image: GalleryImageInfo) => void,\nisFocused: bool,\n- setFocus: (image: GalleryImageInfo) => void,\n+ setFocus: (image: GalleryImageInfo, isFocused: bool) => void,\nscreenWidth: number,\n|};\nclass ImageGalleryImage extends React.PureComponent<Props> {\n@@ -150,7 +150,7 @@ class ImageGalleryImage extends React.PureComponent<Props> {\nlet buttons = null;\nconst { queueModeActive, isQueued } = this.props;\n- if (!queueModeActive && active) {\n+ if (!queueModeActive) {\nbuttons = (\n<React.Fragment>\n<TouchableOpacity\n@@ -218,7 +218,7 @@ class ImageGalleryImage extends React.PureComponent<Props> {\n} else if (this.props.queueModeActive) {\nthis.props.setImageQueued(this.props.imageInfo, true);\n} else {\n- this.props.setFocus(this.props.imageInfo);\n+ this.props.setFocus(this.props.imageInfo, !this.props.isFocused);\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-keyboard.react.js",
"new_path": "native/media/image-gallery-keyboard.react.js",
"diff": "@@ -334,8 +334,13 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\n});\n}\n- setFocus = (imageInfo: GalleryImageInfo) => {\n- this.setState({ focusedImageURI: imageInfo.uri });\n+ setFocus = (imageInfo: GalleryImageInfo, isFocused: bool) => {\n+ const { uri } = imageInfo;\n+ if (isFocused) {\n+ this.setState({ focusedImageURI: uri });\n+ } else if (this.state.focusedImageURI === uri) {\n+ this.setState({ focusedImageURI: null });\n+ }\n}\nsendImage = (imageInfo: GalleryImageInfo) => {\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Allow ImageGalleryImage unfocus on backdrop press |
129,187 | 16.05.2019 01:51:26 | 14,400 | a0148650c1a04a6a6d289199609907307883a795 | [native] Final fixes to make ImageGalleryKeyboard transitions smooth
Uses `GenericTouchable` from `react-native-gesture-handler` directly | [
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-image.react.js",
"new_path": "native/media/image-gallery-image.react.js",
"diff": "@@ -19,6 +19,10 @@ import {\nimport Icon from 'react-native-vector-icons/FontAwesome';\nimport MaterialIcon from 'react-native-vector-icons/MaterialIcons';\nimport LottieView from 'lottie-react-native';\n+import\n+ GenericTouchable,\n+ { TOUCHABLE_STATE }\n+from 'react-native-gesture-handler/touchables/GenericTouchable';\nexport type GalleryImageInfo = {|\n...Dimensions,\n@@ -58,9 +62,9 @@ class ImageGalleryImage extends React.PureComponent<Props> {\nsetFocus: PropTypes.func.isRequired,\nscreenWidth: PropTypes.number.isRequired,\n};\n- backdrop: ?TouchableOpacity;\nfocusProgress = new Animated.Value(0);\nbuttonsStyle: ViewStyle;\n+ backdropProgress = new Animated.Value(0);\nimageStyle: ImageStyle;\ncheckProgress = new Animated.Value(0);\n@@ -77,11 +81,16 @@ class ImageGalleryImage extends React.PureComponent<Props> {\n{ scale: buttonsScale },\n],\n};\n+ const backdropOpacity = this.backdropProgress.interpolate({\n+ inputRange: [ 0, 1 ],\n+ outputRange: [ 1, 0.2 ],\n+ });\nconst imageScale = this.focusProgress.interpolate({\ninputRange: [ 0, 1 ],\noutputRange: [ 1, 1.3 ],\n});\nthis.imageStyle = {\n+ opacity: backdropOpacity,\ntransform: [\n{ scale: imageScale },\n],\n@@ -98,37 +107,35 @@ class ImageGalleryImage extends React.PureComponent<Props> {\nconst isActive = ImageGalleryImage.isActive(this.props);\nconst wasActive = ImageGalleryImage.isActive(prevProps);\nif (isActive && !wasActive) {\n- if (this.backdrop) {\n- this.backdrop.setOpacityTo(0.2, 0);\n- }\n- animations.push(Animated.timing(\n+ Animated.timing(\n+ this.backdropProgress,\n+ { ...animationSpec, toValue: 1 },\n+ ).start();\n+ Animated.timing(\nthis.focusProgress,\n{ ...animationSpec, toValue: 1 },\n- ));\n+ ).start();\n} else if (!isActive && wasActive) {\n- if (this.backdrop) {\n- this.backdrop.setOpacityTo(1, 0);\n- }\n- animations.push(Animated.timing(\n+ Animated.timing(\n+ this.backdropProgress,\n+ { ...animationSpec, toValue: 0 },\n+ ).start();\n+ Animated.timing(\nthis.focusProgress,\n{ ...animationSpec, toValue: 0 },\n- ));\n+ ).start();\n}\nif (this.props.isQueued && !prevProps.isQueued) {\n- animations.push(Animated.timing(\n+ Animated.timing(\nthis.checkProgress,\n{ ...animationSpec, toValue: 1 },\n- ));\n+ ).start();\n} else if (!this.props.isQueued && prevProps.isQueued) {\n- animations.push(Animated.timing(\n+ Animated.timing(\nthis.checkProgress,\n{ ...animationSpec, toValue: 0 },\n- ));\n- }\n-\n- if (animations.length > 0) {\n- Animated.parallel(animations).start();\n+ ).start();\n}\n}\n@@ -144,9 +151,6 @@ class ImageGalleryImage extends React.PureComponent<Props> {\nthis.props.screenWidth,\n),\n};\n- const backdropStyle = {\n- opacity: active ? 0.2 : 1,\n- };\nlet buttons = null;\nconst { queueModeActive, isQueued } = this.props;\n@@ -157,6 +161,7 @@ class ImageGalleryImage extends React.PureComponent<Props> {\nonPress={this.onPressSend}\nstyle={styles.sendButton}\nactiveOpacity={0.6}\n+ disabled={!active}\n>\n<Icon name=\"send\" style={styles.buttonIcon} />\n<Text style={styles.buttonText}>\n@@ -167,6 +172,7 @@ class ImageGalleryImage extends React.PureComponent<Props> {\nonPress={this.onPressEnqueue}\nstyle={styles.enqueueButton}\nactiveOpacity={0.6}\n+ disabled={!active}\n>\n<MaterialIcon name=\"add-to-photos\" style={styles.buttonIcon} />\n<Text style={styles.buttonText}>\n@@ -179,39 +185,31 @@ class ImageGalleryImage extends React.PureComponent<Props> {\nreturn (\n<View style={[ styles.container, dimensionsStyle ]}>\n- <TouchableOpacity\n+ <GenericTouchable\nonPress={this.onPressBackdrop}\n- style={[ backdropStyle ]}\n- ref={this.backdropRef}\n+ onStateChange={this.onBackdropStateChange}\n+ delayPressOut={1}\n>\n<Animated.Image\nsource={source}\nstyle={[ this.imageStyle, dimensionsStyle ]}\n/>\n- </TouchableOpacity>\n- <Animated.View style={this.buttonsStyle} pointerEvents=\"box-none\">\n- <TouchableWithoutFeedback\n- style={styles.buttons}\n- onPress={this.onPressBackdrop}\n- >\n+ <Animated.View style={this.buttonsStyle}>\n<LottieView\nsource={require('../animations/check.json')}\nprogress={this.checkProgress}\nstyle={styles.checkAnimation}\n- pointerEvents=\"box-none\"\nresizeMode=\"cover\"\n/>\n- </TouchableWithoutFeedback>\n+ </Animated.View>\n+ </GenericTouchable>\n+ <Animated.View style={this.buttonsStyle} pointerEvents=\"box-none\">\n{buttons}\n</Animated.View>\n</View>\n);\n}\n- backdropRef = (backdrop: ?TouchableOpacity) => {\n- this.backdrop = backdrop;\n- }\n-\nonPressBackdrop = () => {\nif (this.props.isQueued) {\nthis.props.setImageQueued(this.props.imageInfo, false);\n@@ -222,6 +220,21 @@ class ImageGalleryImage extends React.PureComponent<Props> {\n}\n}\n+ onBackdropStateChange = (from: number, to: number) => {\n+ if (to === TOUCHABLE_STATE.BEGAN) {\n+ this.backdropProgress.setValue(1);\n+ } else if (\n+ !ImageGalleryImage.isActive(this.props) &&\n+ (to === TOUCHABLE_STATE.UNDETERMINED ||\n+ to === TOUCHABLE_STATE.MOVED_OUTSIDE)\n+ ) {\n+ Animated.timing(\n+ this.backdropProgress,\n+ { ...animationSpec, duration: 150, toValue: 0 },\n+ ).start();\n+ }\n+ }\n+\nonPressSend = () => {\nthis.props.sendImage(this.props.imageInfo);\n}\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Final fixes to make ImageGalleryKeyboard transitions smooth
Uses `GenericTouchable` from `react-native-gesture-handler` directly |
129,187 | 16.05.2019 01:54:47 | 14,400 | 67eb5023d971e93ba90ac7f1e41aff315936c594 | [native] Avoid wrapping KeyboardAccessoryView with Touchable
On Android this ends up wrapping the whole `ImageGalleryKeyboard`. | [
{
"change_type": "MODIFY",
"old_path": "native/chat/chat-input-bar.react.js",
"new_path": "native/chat/chat-input-bar.react.js",
"diff": "@@ -286,6 +286,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n);\n}\ncontent = (\n+ <TouchableWithoutFeedback onPress={KeyboardUtils.dismiss}>\n<View style={styles.inputContainer}>\n<Animated.View style={this.expandoButtonsStyle}>\n<TouchableOpacity\n@@ -324,6 +325,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n</View>\n{button}\n</View>\n+ </TouchableWithoutFeedback>\n);\n} else if (isMember) {\ncontent = (\n@@ -374,13 +376,11 @@ class ChatInputBar extends React.PureComponent<Props, State> {\n}\nreturn (\n- <TouchableWithoutFeedback onPress={KeyboardUtils.dismiss}>\n<View style={styles.container}>\n{joinButton}\n{content}\n{keyboardAccessoryView}\n</View>\n- </TouchableWithoutFeedback>\n);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-image.react.js",
"new_path": "native/media/image-gallery-image.react.js",
"diff": "@@ -203,7 +203,10 @@ class ImageGalleryImage extends React.PureComponent<Props> {\n/>\n</Animated.View>\n</GenericTouchable>\n- <Animated.View style={this.buttonsStyle} pointerEvents=\"box-none\">\n+ <Animated.View\n+ style={this.buttonsStyle}\n+ pointerEvents={active ? 'box-none' : 'none'}\n+ >\n{buttons}\n</Animated.View>\n</View>\n@@ -271,12 +274,12 @@ const styles = StyleSheet.create({\n},\nsendButton: {\n...buttonStyle,\n- backgroundColor: '#0D9314',\n+ backgroundColor: '#7ED321',\npaddingLeft: 18,\n},\nenqueueButton: {\n...buttonStyle,\n- backgroundColor: '#0C3092',\n+ backgroundColor: '#2A78E5',\n},\nbuttonIcon: {\nalignSelf: Platform.OS === \"android\" ? 'center' : 'flex-end',\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Avoid wrapping KeyboardAccessoryView with Touchable
On Android this ends up wrapping the whole `ImageGalleryKeyboard`. |
129,187 | 16.05.2019 02:56:21 | 14,400 | 4340c7441509410194388029d3d2319089f7e9e1 | [native] Floating send button in ImageGalleryKeyboard | [
{
"change_type": "MODIFY",
"old_path": "native/media/image-gallery-keyboard.react.js",
"new_path": "native/media/image-gallery-keyboard.react.js",
"diff": "@@ -14,11 +14,13 @@ import {\nPermissionsAndroid,\nFlatList,\nActivityIndicator,\n+ TouchableOpacity,\n} from 'react-native';\nimport { KeyboardRegistry } from 'react-native-keyboard-input';\nimport invariant from 'invariant';\nimport { Provider } from 'react-redux';\nimport CameraRoll from '@react-native-community/cameraroll';\n+import Icon from 'react-native-vector-icons/FontAwesome';\nimport { connect } from 'lib/utils/redux-utils';\n@@ -270,9 +272,30 @@ class ImageGalleryKeyboard extends React.PureComponent<Props, State> {\n/>\n);\n}\n+\n+ let floatingSendButton = null;\n+ const { queuedImageURIs } = this.state;\n+ if (queuedImageURIs && queuedImageURIs.size > 0) {\n+ floatingSendButton = (\n+ <TouchableOpacity\n+ onPress={this.sendQueuedImages}\n+ style={styles.sendButton}\n+ activeOpacity={0.6}\n+ >\n+ <Icon name=\"send\" style={styles.sendIcon} />\n+ <View style={styles.queueCountBubble}>\n+ <Text style={styles.queueCountText}>\n+ {queuedImageURIs.size}\n+ </Text>\n+ </View>\n+ </TouchableOpacity>\n+ );\n+ }\n+\nreturn (\n<View style={styles.container} onLayout={this.onContainerLayout}>\n{content}\n+ {floatingSendButton}\n</View>\n);\n}\n@@ -395,6 +418,40 @@ const styles = StyleSheet.create({\nflex: 1,\nmarginBottom: contentBottomOffset,\n},\n+ sendButton: {\n+ position: 'absolute',\n+ bottom: 30,\n+ right: 30,\n+ backgroundColor: '#7ED321',\n+ borderRadius: 30,\n+ paddingLeft: 14,\n+ paddingRight: 16,\n+ paddingTop: 14,\n+ paddingBottom: 16,\n+ borderWidth: 4,\n+ borderColor: 'white',\n+ },\n+ sendIcon: {\n+ color: 'white',\n+ fontSize: 22,\n+ },\n+ queueCountBubble: {\n+ backgroundColor: '#222222',\n+ position: 'absolute',\n+ top: -8,\n+ right: -8,\n+ width: 25,\n+ height: 25,\n+ paddingLeft: 1,\n+ paddingBottom: Platform.OS === \"android\" ? 2 : 0,\n+ borderRadius: 25,\n+ alignItems: 'center',\n+ justifyContent: 'center',\n+ },\n+ queueCountText: {\n+ textAlign: 'center',\n+ color: 'white',\n+ },\n});\nconst ReduxConnectedImageGalleryKeyboard = connect(\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Floating send button in ImageGalleryKeyboard |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.