@@ -121,7 +121,6 @@ export default class DropboxNoteList extends Component {
121121 note : '' ,
122122 isNoteOpen : false ,
123123 isLoading : false ,
124- isConnectedToDropbox : false ,
125124 isNotConnectedToBoostnote : false ,
126125 code : ''
127126 }
@@ -136,20 +135,16 @@ export default class DropboxNoteList extends Component {
136135 AsyncStorage . getItem ( DROPBOX_ACCESS_TOKEN )
137136 . then ( ( value ) => {
138137 if ( value === null ) {
139- this . setState ( {
140- isConnectedToDropbox : false
141- } )
138+ this . props . setIsConnectedToDropbox ( false )
142139 } else {
140+ this . props . setIsConnectedToDropbox ( true )
143141 this . setState ( {
144- isConnectedToDropbox : true ,
145142 token : value
146143 } , this . getDropboxNoteData ( value ) )
147144 }
148145 } )
149146 . catch ( ( e ) => {
150- this . setState ( {
151- isConnectedToDropbox : false
152- } )
147+ this . props . setIsConnectedToDropbox ( false )
153148 } )
154149 }
155150
@@ -199,9 +194,7 @@ export default class DropboxNoteList extends Component {
199194 const noteList = [ ]
200195
201196 if ( responseJson . error_summary && responseJson . error_summary . startsWith ( 'path/not_found/' ) ) {
202- this . setState ( {
203- isNotConnectedToBoostnote : true
204- } )
197+ this . props . setIsConnectedToDropbox ( true )
205198 }
206199 if ( ! responseJson . entries || responseJson . entries . length === 0 ) {
207200 this . setState ( {
@@ -428,7 +421,7 @@ export default class DropboxNoteList extends Component {
428421 // Show Dropbox connect button when...
429422 // 1. Not connected to Dropbox.
430423 // 2. Not loading.
431- ! this . state . isConnectedToDropbox && ! this . state . isLoading
424+ ! this . props . isConnectedToDropbox && ! this . state . isLoading
432425 ? < View >
433426 < View style = { styles . dropboxLinkButtonWrap } >
434427 < Button style = { styles . dropboxLinkButton }
@@ -469,7 +462,7 @@ export default class DropboxNoteList extends Component {
469462 // 1. Connected to Dropbox.
470463 // 2. Not connected to Boostnote.
471464 // 3. Not loading.
472- this . state . isConnectedToDropbox && this . state . isNotConnectedToBoostnote && ! this . state . isLoading
465+ this . props . isConnectedToDropbox && this . state . isNotConnectedToBoostnote && ! this . state . isLoading
473466 ? < View style = { { alignItems : 'center' , justifyContent : 'center' } } >
474467 < Text style = { styles . bottomLinkWord } > Connect with Desktop app and create a note!</ Text >
475468 < View style = { {
0 commit comments