-
Notifications
You must be signed in to change notification settings - Fork 737
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
[2018] Stop 500 error on page changes #6341
[2018] Stop 500 error on page changes #6341
Conversation
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.
Overall let's remove the debugging statements from the code. r+wc
kitsune/sumo/static/sumo/js/wiki.js
Outdated
$diffView.slideDown(); | ||
$this.parent().find('.close-diff').show(); | ||
$this.parent().find('.loading').hide(); | ||
console.log("Updating revision list with URL:", url); // Debugging output |
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.
This is not needed
kitsune/sumo/static/sumo/js/wiki.js
Outdated
}, {}); | ||
localStorage.setItem('revision-list-filter', JSON.stringify(currentData)); // Save as JSON | ||
|
||
console.log("Form data saved to localStorage:", currentData); // Debugging output |
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.
same thing
kitsune/sumo/static/sumo/js/wiki.js
Outdated
}); | ||
// Retrieve and safely parse form data from localStorage | ||
let formData = {}; | ||
const savedFormData = localStorage.getItem('revision-list-filter'); |
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.
Probably a better option for the scenario at hand is the sessionStorage
. Using sessionStorage
will ensure that we won't have any stale data and we won't also exceed the capacity.
kitsune/sumo/static/sumo/js/wiki.js
Outdated
} | ||
if (e.which === 13) { | ||
e.preventDefault(); | ||
return false; |
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.
you can skip the return statement here
Also re-updates the revision list if there is data Also stops the 500 error use sessionStorage
75d8d08
to
6b04957
Compare
Also re-updates the revision list if there is data Also stops the 500 error use sessionStorage
Updated wiki.js to retain form data between page changes
Also re-updates the revision list if there is data
Stops the 500 error