-
-
Notifications
You must be signed in to change notification settings - Fork 440
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
htmlfiles: Handle localStorage not accessible #945
Conversation
In some cases, if based on the browser's settings - localStorage is not accessible, fallback and don't save the sort-columns into localStorage. While the UX is a little inconvenient, at least the page doesn't break - sorting on columns is still possible, but not retained between pages.
@@ -172,7 +172,10 @@ coverage.index_ready = function ($) { | |||
// Look for a localStorage item containing previous sort settings: | |||
var sort_list = []; | |||
var storage_name = "COVERAGE_INDEX_SORT"; | |||
var stored_list = localStorage.getItem(storage_name); | |||
var stored_list = undefined; | |||
try { |
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.
Note - didn't look like there was any better way of testing this as merely accessing the variable caused the error. So, try/catch seemed to be the only option
Codecov Report
@@ Coverage Diff @@
## master #945 +/- ##
==========================================
+ Coverage 94.02% 94.09% +0.06%
==========================================
Files 86 86
Lines 12089 12089
Branches 1210 1210
==========================================
+ Hits 11367 11375 +8
+ Misses 588 580 -8
Partials 134 134
Continue to review full report at Codecov.
|
Thanks! |
This became 48c73b8 |
This is now available in coverage v5.0.4 |
In some cases, if based on the browser's settings - localStorage
is not accessible, fallback and don't save the sort-columns into
localStorage.
While the UX is a little inconvenient, at least the page doesn't
break - sorting on columns is still possible, but not retained
between pages.
Resolves #944