@@ -121,7 +121,6 @@ export default class DropboxNoteList extends Component {
121
121
note : '' ,
122
122
isNoteOpen : false ,
123
123
isLoading : false ,
124
- isConnectedToDropbox : false ,
125
124
isNotConnectedToBoostnote : false ,
126
125
code : ''
127
126
}
@@ -136,20 +135,16 @@ export default class DropboxNoteList extends Component {
136
135
AsyncStorage . getItem ( DROPBOX_ACCESS_TOKEN )
137
136
. then ( ( value ) => {
138
137
if ( value === null ) {
139
- this . setState ( {
140
- isConnectedToDropbox : false
141
- } )
138
+ this . props . setIsConnectedToDropbox ( false )
142
139
} else {
140
+ this . props . setIsConnectedToDropbox ( true )
143
141
this . setState ( {
144
- isConnectedToDropbox : true ,
145
142
token : value
146
143
} , this . getDropboxNoteData ( value ) )
147
144
}
148
145
} )
149
146
. catch ( ( e ) => {
150
- this . setState ( {
151
- isConnectedToDropbox : false
152
- } )
147
+ this . props . setIsConnectedToDropbox ( false )
153
148
} )
154
149
}
155
150
@@ -199,9 +194,7 @@ export default class DropboxNoteList extends Component {
199
194
const noteList = [ ]
200
195
201
196
if ( responseJson . error_summary && responseJson . error_summary . startsWith ( 'path/not_found/' ) ) {
202
- this . setState ( {
203
- isNotConnectedToBoostnote : true
204
- } )
197
+ this . props . setIsConnectedToDropbox ( true )
205
198
}
206
199
if ( ! responseJson . entries || responseJson . entries . length === 0 ) {
207
200
this . setState ( {
@@ -428,7 +421,7 @@ export default class DropboxNoteList extends Component {
428
421
// Show Dropbox connect button when...
429
422
// 1. Not connected to Dropbox.
430
423
// 2. Not loading.
431
- ! this . state . isConnectedToDropbox && ! this . state . isLoading
424
+ ! this . props . isConnectedToDropbox && ! this . state . isLoading
432
425
? < View >
433
426
< View style = { styles . dropboxLinkButtonWrap } >
434
427
< Button style = { styles . dropboxLinkButton }
@@ -469,7 +462,7 @@ export default class DropboxNoteList extends Component {
469
462
// 1. Connected to Dropbox.
470
463
// 2. Not connected to Boostnote.
471
464
// 3. Not loading.
472
- this . state . isConnectedToDropbox && this . state . isNotConnectedToBoostnote && ! this . state . isLoading
465
+ this . props . isConnectedToDropbox && this . state . isNotConnectedToBoostnote && ! this . state . isLoading
473
466
? < View style = { { alignItems : 'center' , justifyContent : 'center' } } >
474
467
< Text style = { styles . bottomLinkWord } > Connect with Desktop app and create a note!</ Text >
475
468
< View style = { {
0 commit comments