Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
oetzit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
commul
oetzit
Commits
20f7845b
Commit
20f7845b
authored
2 years ago
by
Paolo Brasolin
Browse files
Options
Downloads
Patches
Plain Diff
fix: switch gradually from sessionstorage to localstorage
parent
f2925dce
No related branches found
Branches containing commit
Tags
v1.10.2
Tags containing commit
No related merge requests found
Pipeline
#28085
passed
2 years ago
Stage: setup
Stage: check
Stage: build
Stage: deploy
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
frontend/src/js/storage.ts
+4
-2
4 additions, 2 deletions
frontend/src/js/storage.ts
with
5 additions
and
2 deletions
CHANGELOG.md
+
1
−
0
View file @
20f7845b
...
...
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
-
Implement fallback storage for users disabling cookies.
-
Switch (gradually) from
`sessionStorage`
to
`localStorage`
.
## [1.10.1] - 2022-09-27
...
...
This diff is collapsed.
Click to expand it.
frontend/src/js/storage.ts
+
4
−
2
View file @
20f7845b
...
...
@@ -4,6 +4,7 @@ export default class Storage {
constructor
()
{
try
{
window
.
localStorage
;
window
.
sessionStorage
;
}
catch
{
this
.
fallingBack
=
true
;
...
...
@@ -17,7 +18,7 @@ export default class Storage {
if
(
this
.
fallingBack
)
{
this
.
fallback
[
key
]
=
value
;
}
else
{
session
Storage
.
setItem
(
key
,
value
);
local
Storage
.
setItem
(
key
,
value
);
}
}
...
...
@@ -27,7 +28,8 @@ export default class Storage {
?
this
.
fallback
[
key
]
:
null
;
}
else
{
return
sessionStorage
.
getItem
(
key
);
// NOTE: sessionStorage is there because we started using that, silly me and silly Chrome. It can be removed safely in future.
return
localStorage
.
getItem
(
key
)
||
sessionStorage
.
getItem
(
key
);
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment