Skip to content
This repository was archived by the owner on Mar 12, 2020. It is now read-only.

Commit 0b0c266

Browse files
authored
Changes manifest setting from singleInstance => singleTask (#1286)
* singleInstance => singleTask
1 parent 6e148b3 commit 0b0c266

File tree

17 files changed

+117
-59
lines changed

17 files changed

+117
-59
lines changed

App/Components/ProcessingThread.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ const mapDispatchToProps = (dispatch: Dispatch<RootAction>): DispatchProps => {
279279
)
280280
},
281281
retryInternal: (inviteId: string, threadName?: string) => {
282-
dispatch(ThreadsActions.acceptInviteRequest(inviteId, threadName))
282+
dispatch(ThreadsActions.acceptInviteRequest(inviteId, threadName, true))
283283
},
284284
dismiss: (inviteId: string) => {
285285
dispatch(ThreadsActions.acceptInviteDismiss(inviteId))

App/Containers/AddCaptionScreen.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ class AddCaptionScreen extends React.Component<Props> {
5050

5151
static navigationOptions = ({ navigation }: NavigationScreenProps) => {
5252
const params = navigation.state.params || {}
53+
// I can't explain why yet, but the two callbacks remain null for 500ms after page loads
54+
// if you click and these are null, nothing happens.
55+
const unavailable = !params.shareToNewThread
5356
return {
5457
headerTitle: 'Share Photo',
5558
headerLeft: (
@@ -70,11 +73,11 @@ class AddCaptionScreen extends React.Component<Props> {
7073
headerRight: (
7174
<TextileHeaderButtons>
7275
<Item
73-
color={params.disableShare ? '#99c0ef' : 'blue'}
76+
color={unavailable || params.disableShare ? '#99c0ef' : 'blue'}
7477
title="Share"
7578
/* tslint:disable-next-line */
7679
onPress={() => {
77-
if (params.disableShare) {
80+
if (unavailable || params.disableShare) {
7881
return
7982
}
8083
if (params.withPhoto && params.withThreadName) {
@@ -99,7 +102,7 @@ class AddCaptionScreen extends React.Component<Props> {
99102
this.props.updateComment(text)
100103
}
101104

102-
componentWillMount() {
105+
componentDidMount() {
103106
// TODO: Investigate why share would ever be null? https://github.com/textileio/textile-mobile/issues/888
104107
this.props.navigation.setParams({
105108
disableShare:

App/Containers/FeedList/index.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,7 @@ class Notifications extends React.Component<Props, State> {
183183
return
184184
}
185185

186-
return (
187-
<AlertRow
188-
message={this.props.alert}
189-
onClick={this.registerCafe}
190-
/>
191-
)
186+
return <AlertRow message={this.props.alert} onClick={this.registerCafe} />
192187
}
193188
_renderItems() {
194189
return (
@@ -211,7 +206,9 @@ class Notifications extends React.Component<Props, State> {
211206
// the initial refresh has completed and returned 0 results. This is to avoid the art
212207
// flickering for a second and then disappearing, which is ugly.
213208
const showNotifications =
214-
this.state.focusRefreshInProgress || this.props.notifications.length > 0 || this.props.alert
209+
this.state.focusRefreshInProgress ||
210+
this.props.notifications.length > 0 ||
211+
this.props.alert
215212
return (
216213
<View style={styles.container}>
217214
{!showNotifications && this._renderOnboarding()}
@@ -233,7 +230,10 @@ const mapStateToProps = (state: RootState): StateProps => {
233230
const showOnboarding = state.preferences.tourScreens.feed === true
234231
const refreshing = state.notifications.refreshing
235232

236-
const alert = Object.keys(state.cafes.cafes).length > 0 ? undefined : 'Improve app performance by choosing an account cafe now.'
233+
const alert =
234+
Object.keys(state.cafes.cafes).length > 0
235+
? undefined
236+
: 'Improve app performance by choosing an account cafe now.'
237237

238238
return {
239239
alert,

App/Containers/PhotoScreen.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { threadDataByThreadId } from '../Redux/GroupsSelectors'
1515
import { color } from '../styles'
1616
import { CommentData } from '../Components/comments'
1717
import { accountSelectors } from '../features/account'
18-
import { groupPhoto } from '../features/group/selectors';
18+
import { groupPhoto } from '../features/group/selectors'
1919

2020
const screenWidth = Dimensions.get('screen').width
2121

@@ -149,7 +149,8 @@ const mapStateToProps = (state: RootState): StateProps => {
149149
threadName = threadData ? threadData.name : undefined
150150
}
151151
const photoId = state.photoViewing.viewingPhoto
152-
const photo = threadId && photoId ? groupPhoto(state.group, threadId, photoId) : undefined
152+
const photo =
153+
threadId && photoId ? groupPhoto(state.group, threadId, photoId) : undefined
153154
const selfAddress = accountSelectors.getAddress(state.account) || ''
154155
const removing = photo
155156
? Object.keys(state.group.ignore)

App/Containers/WalletPicker.tsx

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,15 @@ class TextileWalletPicker extends React.PureComponent<Props> {
3030
const showImagePicker = navigation.getParam('showImagePicker')
3131

3232
const cameraRoll = () => {
33+
if (!showImagePicker) {
34+
return
35+
}
3336
showImagePicker('camera-roll')
3437
}
3538
const camera = () => {
39+
if (!showImagePicker) {
40+
return
41+
}
3642
showImagePicker('camera')
3743
}
3844
const onPress = () => {
@@ -46,12 +52,32 @@ class TextileWalletPicker extends React.PureComponent<Props> {
4652
</TextileHeaderButtons>
4753
)
4854
const headerTitle = 'Recent Photos'
55+
56+
/**
57+
* Android note.
58+
* I can't explain why yet, but the two callbacks remain null for 500ms after page loads.
59+
* So now if you click them early nothing will happen (also grey'd out)
60+
* This is related to changing the launchMode="singleInstance" to
61+
* launchMode="singleTop"
62+
*/
63+
const imagePickerProps = !showImagePicker ? { color: '#a9a9a9' } : {}
4964
const headerRight = (
5065
<TextileHeaderButtons>
51-
<Item title="camera" iconName="camera-create" onPress={camera} />
52-
<Item title="camera roll" iconName="image" onPress={cameraRoll} />
66+
<Item
67+
title="camera"
68+
iconName="camera-create"
69+
onPress={camera}
70+
{...imagePickerProps}
71+
/>
72+
<Item
73+
title="camera roll"
74+
iconName="image"
75+
onPress={cameraRoll}
76+
{...imagePickerProps}
77+
/>
5378
</TextileHeaderButtons>
5479
)
80+
5581
return {
5682
headerTitle,
5783
headerLeft,

App/Redux/ThreadsRedux.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ const actions = {
7171
acceptInviteRequest: createAction(
7272
'ACCEPT_THREAD_NOTIFICATION_INVITE',
7373
resolve => {
74-
return (notificationId: string, threadName?: string) =>
75-
resolve({ notificationId, threadName })
74+
return (notificationId: string, threadName?: string, goBack?: boolean) =>
75+
resolve({ notificationId, threadName, goBack })
7676
}
7777
),
7878
addInternalInvitesRequest: createAction(

App/Redux/UIRedux.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,17 @@ export function reducer(
135135
switch (action.type) {
136136
case getType(actions.updateSharingPhotoImage): {
137137
const { image } = action.payload
138-
return { ...state, sharingPhoto: { ...state.sharingPhoto, image } }
138+
return {
139+
...state,
140+
sharingPhoto: { ...state.sharingPhoto, image, files: undefined }
141+
}
139142
}
140143
case getType(actions.updateSharingPhotoFiles): {
141144
const { files } = action.payload
142-
return { ...state, sharingPhoto: { ...state.sharingPhoto, files } }
145+
return {
146+
...state,
147+
sharingPhoto: { ...state.sharingPhoto, files, image: undefined }
148+
}
143149
}
144150
case getType(actions.updateSharingPhotoThread): {
145151
const { threadId } = action.payload

App/SB/components/AlertRow/index.tsx

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ class AlertRow extends React.PureComponent<AlertRowProps> {
1919
const dateText = 'now'
2020

2121
const readStyle: ViewStyle = {
22-
width: 29,
23-
height: 29,
24-
borderRadius: 16,
25-
borderWidth: 0,
26-
borderColor: 'rgba(255, 28, 63, 0.2)',
27-
backgroundColor: 'rgba(255, 28, 63, 0.2)'
28-
}
22+
width: 29,
23+
height: 29,
24+
borderRadius: 16,
25+
borderWidth: 0,
26+
borderColor: 'rgba(255, 28, 63, 0.2)',
27+
backgroundColor: 'rgba(255, 28, 63, 0.2)'
28+
}
2929

3030
return (
3131
<TouchableOpacity
@@ -42,18 +42,14 @@ class AlertRow extends React.PureComponent<AlertRowProps> {
4242
alignItems: 'center',
4343
alignContent: 'center'
4444
}}
45-
>
46-
</View>
45+
/>
4746
</View>
4847
</View>
4948
<View style={styles.textContainer}>
5049
<Text style={styles.text}>{message}</Text>
51-
<Text style={[styles.timestamp, styles.unread]}>
52-
{dateText}
53-
</Text>
54-
</View>
55-
<View style={{ width: 40, height: 40, overflow: 'hidden' }}>
50+
<Text style={[styles.timestamp, styles.unread]}>{dateText}</Text>
5651
</View>
52+
<View style={{ width: 40, height: 40, overflow: 'hidden' }} />
5753
</TouchableOpacity>
5854
)
5955
}

App/SB/components/ContactSelect/index.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,12 @@ export class ContactSelectComponent extends React.Component<
146146
)
147147
}
148148

149+
renderFooter = () => {
150+
// Provides a quick fix until this layout is replaces.
151+
// Without it the bottom two rows are sometimes not selectable.
152+
return <View style={{ ...styles.contactItem, minHeight: 120 }} />
153+
}
154+
149155
renderRow = (contact: ListRenderItemInfo<IncludedContact>) => {
150156
const { item } = contact
151157
const selectState =
@@ -167,6 +173,7 @@ export class ContactSelectComponent extends React.Component<
167173
keyExtractor={this.keyExtractor}
168174
extraData={this.props.selected}
169175
ListHeaderComponent={this.renderHeader()}
176+
ListFooterComponent={this.renderFooter()}
170177
renderItem={this.renderRow}
171178
/>
172179
)

App/SB/components/FeedItem/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,4 @@ class FeedItem extends React.PureComponent<FeedItemProps> {
9999
}
100100
}
101101

102-
export default FeedItem
102+
export default FeedItem

0 commit comments

Comments
 (0)