Stop Activity indicator animation when server is not connected
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 20/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, react-native
- Lĩnh vực
- mobile-dev
Hướng nghiên cứu
Bắt đầu với flow fetch đăng nhập đã được dán, đặc biệt là trạng thái loader và catch handler. Kiểm tra cách react-native-loader được sử dụng trong repository và liệu lỗi mạng có thể đặt lại indicator hoặc hiển thị alert hay không; issue được hoàn tất khi behavior được yêu cầu đối với server bị ngắt kết nối đã được xác định và xác minh.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hi,
You can find my Login screen API code below. I am using Activity indicator animation which is working fine, whenever the button is pressed. Once the user inputs(username & password) match with the API data correctly, the screen will be navigated to Home screen. Problem with the code is, i just want to stop the loader animation when server(API) is not connected. Or i want to show some alert message about server connection, whenever the app launches.
I am new React native. Kindly share your ideas.
{
this.setState({
errorUsername:'',
errorPassword:'',
loader:true,
loggedIn:this.props.receiveState //RECEIVE VALUE FROM REDUCER
})
await fetch(LOG_IN_URL,{
method: 'POST',
headers: new Headers({'content-type': 'application/json'}),
body: JSON.stringify({"userId": this.state.username, "password": this.state.password})
})
.then(function (response) {
return response.json();
})
.then((responseJson) => {
console.log("LOGGED IN SUCCESS OR FAILURE:::::::::"+JSON.stringify(responseJson));
if(responseJson.status === 'success')
{
const userToken = responseJson.data.userSession;
AsyncStorage.setItem('userSession', userToken)
console.log('ASYNC STORAGE VALUE IS SET::::::'+JSON.stringify(userToken));
this.setState({
loggedIn: true,
errorPassword:'',
errorUsername:'',
username:'',
password:'',
loader:false
})
this.props.sendState(this.state.loggedIn); //SEND VALUE TO REDUCER
}
else
{
this.refs.customToast.show('Invalid Details', DURATION.LENGTH_LONG);
}
})
.catch(function (error) {
this.setState({loader:false})
this.refs.customToast.show('Check Network Connection', DURATION.LENGTH_LONG);
console.log("ERROR CAUGHT::::::::"+error);
});
this.state.loggedIn === true ? this.props.navigation.navigate('Home') : ''
}
}
- Ngôn ngữ chính
- JavaScript
- Star
- 390
- Fork
- 63
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của mohebifar/react-native-loader
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
-
DoubleBounce animation lagĐang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 25/100
-
Typescript Missing TypesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
mohebifar/react-native-loader#28 · 2 reaction ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 32/100
mohebifar/react-native-loader#26 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
mohebifar/react-native-loader#19 · 1 bình luận · 3 reaction ·
Tất cả issue của mohebifar/react-native-loader
Issue tương tự
-
清理 #260:沒有魚時不放空的照片列Đang mởsize:S spec:drafting
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
blackie0424/tao_among#262 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
backlog
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
sagemathinc/sagebrush#2768 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Fei2411/DeepSeek-Bot#2653 ·
-
documentation good first issue
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 90/100
seuthootDev/github-readme-insight-terminal-ascii#26 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
typecraft-dev/oma-cast#120 ·
Maintainer thường phản hồi trong vòng 11 ngày