Skip to content
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

Merged
merged 1 commit into from Feb 29, 2020
Merged

htmlfiles: Handle localStorage not accessible #945

merged 1 commit into from Feb 29, 2020

Conversation

AbdealiLoKo
Copy link
Contributor

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

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 {
Copy link
Contributor Author

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-io
Copy link

Codecov Report

Merging #945 into master will increase coverage by 0.06%.
The diff coverage is n/a.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
tests/test_debug.py 98.16% <0%> (+7.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6f4c0dc...ac71d86. Read the comment docs.

@nedbat nedbat merged commit 4fb738c into nedbat:master Feb 29, 2020
@nedbat
Copy link
Owner

nedbat commented Feb 29, 2020

Thanks!

@nedbat
Copy link
Owner

nedbat commented Feb 29, 2020

This became 48c73b8

@nedbat
Copy link
Owner

nedbat commented Mar 17, 2020

This is now available in coverage v5.0.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle cases without localStorage for sorting
3 participants