Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
af34799e
Unverified
Commit
af34799e
authored
7 years ago
by
XhmikosR
Committed by
GitHub
7 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Remove page reload in pwa.js. (#24923)
parent
3a0f8d73
6 merge requests
!28721
Hot test
,
!27561
Adds font-weight-medium to font weight classes
,
!25494
web pack
,
!25326
Adjust examples
,
!23207
#22402 : modal: new autofocus & keyboardBtnNav options
,
!17021
v4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
assets/js/src/pwa.js
+2
-15
assets/js/src/pwa.js
with
2 additions
and
15 deletions
+2
-15
assets/js/src/pwa.js
+
2
-
15
View file @
af34799e
...
@@ -7,24 +7,11 @@
...
@@ -7,24 +7,11 @@
window
.
addEventListener
(
'
load
'
,
function
()
{
window
.
addEventListener
(
'
load
'
,
function
()
{
navigator
.
serviceWorker
.
register
(
'
/sw.js
'
).
then
(
function
(
registration
)
{
// eslint-disable-line compat/compat
navigator
.
serviceWorker
.
register
(
'
/sw.js
'
).
then
(
function
(
registration
)
{
// eslint-disable-line compat/compat
console
.
log
(
'
ServiceWorker registration successful with scope:
'
,
registration
.
scope
)
console
.
log
(
'
ServiceWorker registration successful with scope:
'
,
registration
.
scope
)
registration
.
onupdatefound
=
function
()
{
var
installingWorker
=
registration
.
installing
installingWorker
.
onstatechange
=
function
()
{
switch
(
installingWorker
.
state
)
{
case
'
installed
'
:
if
(
navigator
.
serviceWorker
.
controller
)
{
// eslint-disable-line compat/compat
console
.
log
(
'
new update available
'
)
location
.
reload
(
true
)
}
break
default
:
}
}
}
}).
catch
(
function
(
err
)
{
}).
catch
(
function
(
err
)
{
console
.
log
(
'
ServiceWorker registration failed:
'
,
err
)
console
.
log
(
'
ServiceWorker registration failed:
'
,
err
)
})
})
})
})
}
else
{
console
.
log
(
'
Service workers are not supported.
'
)
}
}
}())
}())
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets