Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

showSnackBar error: showing snackbar before screen is built #1483

Closed
Ayush0Chaudhary opened this issue Feb 13, 2023 · 5 comments · Fixed by #1496
Closed

showSnackBar error: showing snackbar before screen is built #1483

Ayush0Chaudhary opened this issue Feb 13, 2023 · 5 comments · Fixed by #1496
Assignees
Labels
bug Something isn't working

Comments

@Ayush0Chaudhary
Copy link

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Use this org url https://talawaapi.azurewebsites.net/graphql
  2. click o sign up button
  3. screen will appear

Expected behavior
Should provide with poper error

Actual behavior
giving this error screen

Screenshots
Screenshot from 2023-02-14 01-13-23

Additional details
I checked the error stack and it showed the this line showed this error

// if the error is unknown
navigationService.showSnackBar("Something went wrong");
return false;

we have to make the changes in these line too so we don't get same error in the future

if (exception.graphqlErrors[i].message == userNotFound.message) {
if (showSnackBar) {
navigationService
.showSnackBar("No account registered with this email");
}
return false;
}
// if the error message is "Membership Request already exists"
if (exception.graphqlErrors[i].message == memberRequestExist.message) {
if (showSnackBar) {
navigationService.showSnackBar("Membership request already exist");
}
return false;
}
// if the error message is "Invalid credentials"
if (exception.graphqlErrors[i].message == wrongCredentials.message) {
if (showSnackBar) {
navigationService.showSnackBar("Enter a valid password");
}
return false;
}
// if the error message is "Organization not found"
if (exception.graphqlErrors[i].message == organizationNotFound.message) {
if (showSnackBar) {
navigationService.showSnackBar("Organization Not Found");
}
return false;
}
// if the error message is "Email address already exists"
if (exception.graphqlErrors[i].message == emailAccountPresent.message) {
if (showSnackBar) {
navigationService
.showSnackBar("Account with this email already registered");
}
return false;
}

Potential internship candidates
Please read this if you are planning to apply for a Palisadoes Foundation internship #359

@Ayush0Chaudhary Ayush0Chaudhary added the bug Something isn't working label Feb 13, 2023
@github-actions github-actions bot added the unapproved Unapproved, needs to be triaged label Feb 13, 2023
@Ayush0Chaudhary Ayush0Chaudhary changed the title Bug Report showSnackBar error: showing snackbar before screen is built Feb 13, 2023
@Ayush0Chaudhary
Copy link
Author

@palisadoes @noman2002 @TheHazeEffect please take a look and assign me this, I have solved this problem before also.

@Ayush0Chaudhary
Copy link
Author

Screenshot from 2023-02-14 01-32-20
I corrected it on my local Machine and showed this error.

@palisadoes palisadoes removed the unapproved Unapproved, needs to be triaged label Feb 13, 2023
@palisadoes
Copy link
Contributor

@Ayush0Chaudhary are you using TalawaErrorWidget for this?

@Ayush0Chaudhary
Copy link
Author

Yes @palisadoes, should I use something else??

@palisadoes
Copy link
Contributor

  1. No, it was recently created and I want to make sure we consider using it.
  2. Depending on your experience with it, we may want to adjust the widget to be more flexible.
  3. We have an issue Utilize TalawaErrorWidget Throughout App #1437 that's on hold pending a few more developer experiences.

Your feedback on its use could be integrated into the other issue.

Ayush0Chaudhary added a commit to Ayush0Chaudhary/talawa that referenced this issue Feb 14, 2023
Ayush0Chaudhary added a commit to Ayush0Chaudhary/talawa that referenced this issue Feb 14, 2023
Ayush0Chaudhary added a commit to Ayush0Chaudhary/talawa that referenced this issue Feb 14, 2023
Ayush0Chaudhary added a commit to Ayush0Chaudhary/talawa that referenced this issue Feb 14, 2023
palisadoes pushed a commit that referenced this issue Feb 18, 2023
…lt2 (#1496)

* Fixes #1483 showSnackBar error: showing snackbar before screen is built

* removed the timer

* draft

* draft 2
palisadoes pushed a commit that referenced this issue Feb 24, 2023
* Fixes #1483 showSnackBar error: showing snackbar before screen is built

* Make the Dialog box functionable

* Fixes #1437 Utilize TalawaErrorWidget Throughout App

* Added test for the same

* Resolved the conflicts and changed the mocks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants