Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Fix 'undefined' when clicking monitor toggle. #173

Merged
merged 1 commit into from Mar 26, 2015
Merged

Conversation

relrod
Copy link
Member

@relrod relrod commented Mar 26, 2015

When you click the monitoring toggle and you are not logged in, it makes
the request anyway and then appends "undefined" to the page. This looks
tacky. Instead, if we don't get a response back, just bail out and do
nothing.

Signed-off-by: Ricky Elrod ricky@elrod.me

@pypingou
Copy link
Member

While I'm ok with the fix, I cannot reproduce the case described here. When I'm not logged in, clicking on Monitoring does not do anything for me (whether the Monitoring is on or off, no changes).

@relrod
Copy link
Member Author

relrod commented Mar 26, 2015

@pypingou Updated based on IRC discussion. +1s?

@pypingou
Copy link
Member

Maybe be a little more generous/rigorous in our check? https://github.com/fedora-infra/pkgdb2/blob/fix-undefined/pkgdb2/templates/package.html#L40-L42

When you click the monitoring toggle and you are not logged in, it makes
the request anyway and then appends "undefined" to the page. This looks
tacky. Instead don't define the click handler unless the user is logged
in.

Signed-off-by: Ricky Elrod <ricky@elrod.me>
@relrod
Copy link
Member Author

relrod commented Mar 26, 2015

@pypingou boom!

@pypingou
Copy link
Member

👍 thanks @relrod !

relrod added a commit that referenced this pull request Mar 26, 2015
Fix 'undefined' when clicking monitor toggle.
@relrod relrod merged commit 4b9fef1 into master Mar 26, 2015
@relrod relrod deleted the fix-undefined branch March 26, 2015 19:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants