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
Webpush notification #3273
base: master
Are you sure you want to change the base?
Webpush notification #3273
Conversation
else | ||
render json: @subscription.errors, status: :unprocessable_entity | ||
is_subscribed = PushSubscription.find_by(auth: params[:keys][:auth]) | ||
if !is_subscribed |
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.
Use a guard clause (return unless !is_subscribed
) instead of wrapping the code inside a conditional expression.
else | ||
render json: @subscription.errors, status: :unprocessable_entity | ||
is_subscribed = PushSubscription.find_by(auth: params[:keys][:auth]) | ||
if !is_subscribed |
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.
Favor unless
over if
for negative conditions.
This reverts commit 820698a.
c47aa42
to
3303926
Compare
Code Climate has analyzed commit 6583b0c and detected 2 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
Fixes #3271
Describe the changes you have made in this PR -
Note: Please check Allow edits from maintainers. if you would like us to assist in the PR.