@@ -60,7 +60,7 @@ var SearchView = React.createClass({
6060 } ) ) . done ( ) ;
6161 } ,
6262 handleResponseForForecast : function ( forecastData , currentWeatherData ) {
63- this . setState ( { isLoading : false } ) ;
63+ this . setState ( { isLoading : false , message : '' } ) ;
6464 //once response from both API's come, navigate to TodayView
6565 this . props . navigator . push ( {
6666 title : "Current" ,
@@ -106,13 +106,14 @@ var SearchView = React.createClass({
106106 //this.props.navigator.pop()
107107 handleResponseForCurrentWeather : function ( currentWeatherData ) {
108108 //make API call for 10 day Forecast
109+ this . setState ( { message : 'Gathering 10 day forecast data' } ) ;
109110 this . fetchApiDataForForecast ( this . prepareAPIUrlForForecast ( ) , currentWeatherData ) ;
110111 } ,
111112 handleTextInputChange : function ( event ) {
112113 this . setState ( { searchString : event . nativeEvent . text } ) ;
113114 } ,
114- handleButtonPressed : function ( ) {
115- this . setState ( { isLoading : true , message : '' } ) ;
115+ handleSearchButtonPressed : function ( ) {
116+ this . setState ( { isLoading : true , message : 'Gathering current weather data ' } ) ;
116117 this . fetchApiDataForCurrentWeather ( this . prepareAPIUrlForCurrentWeather ( ) ) ;
117118 } ,
118119 render : function ( ) {
@@ -131,7 +132,7 @@ var SearchView = React.createClass({
131132 value = { this . state . searchString }
132133 onChange = { this . handleTextInputChange } > </ TextInput >
133134
134- < TouchableHighlight style = { styles . button } underlayColor = "#5CBC85" onPress = { this . handleButtonPressed } >
135+ < TouchableHighlight style = { styles . button } underlayColor = "#5CBC85" onPress = { this . handleSearchButtonPressed } >
135136 < Text style = { styles . buttonText } > Get Weather</ Text >
136137 </ TouchableHighlight >
137138 { spinner }
0 commit comments