-
Notifications
You must be signed in to change notification settings - Fork 276
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
Notifications frontend #904
Conversation
src/components/GlobalPreferences/Notifications/NotificationsLogin.js
Outdated
Show resolved
Hide resolved
return ( | ||
<Box heading="Email notifications"> | ||
<NotificationImage /> | ||
{apiError && <Info mode="error">Error logging in:{apiError}</Info>} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets just double check what should be the correct spacing here:
cc @dizzypaty
and we can help out the user with some other message, I was thrown off by "Failed to fetch".
src/components/GlobalPreferences/Notifications/NotificationsLogin.js
Outdated
Show resolved
Hide resolved
src/components/GlobalPreferences/Notifications/NotificationsLogin.js
Outdated
Show resolved
Hide resolved
src/components/GlobalPreferences/Notifications/NotificationsVerify.js
Outdated
Show resolved
Hide resolved
This reverts commit a1bfb22.
…tions * origin/newstyle: Optimize icons (#943) PropTypes: move fetch-required fields of AppType to be non-requi… (#946) Update ENS API changes from @aragon/wrapper (#944) Permissions: fix debounced search state on clearing filters (#942) Updates for aragonUI and other clean up (#939) AppCenter: update copy (#940)
Because every create triggers a fetch, avoid flicker while refetching after creating a subscription
// network/service error | ||
setAuthState(AUTH_SERVICE_UNAVAILABLE) | ||
} else { | ||
setAuthState(AUTH_AUTHENTICATION_FAILED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we check for an UnauthorizedError
or ExpiredTokenError
?
Or perhaps we should have a custom error for the service being unavailable (ManageNotifcations
is also checking for TypeError
)?
TypeError
seems pretty generic to know that it the service is unavailable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we check for an UnauthorizedError or ExpiredTokenError?
That depends if we want to handle the two cases the same way. In both cases we currently require the user the log in again, hence the general catch.
TypeError seems pretty generic to know that it the service is unavailable.
TypeError
is the standard error type for network errors. I didn't want to deviate too much from the fetch spec. https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#Checking_that_the_fetch_was_successful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not know that TypeError
was the standard error type for fetch()
!
</div> | ||
)} | ||
</div> | ||
<SubscriptionFilters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have the same dropdown behaviour in the notification filters as elsewhere.
Each dropdown should have 'All'
as its first item, and we should default the filter's state to -1
(unselected) if the first item is selected.
What
This builds on top of the changes in
newstyle
Open UI/UX question
TODO
notifications.svg
.TODO - Paty review