Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
8ea7fc76
Commit
8ea7fc76
authored
Feb 10, 2020
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: simplify worker
parent
2b401afc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
45 deletions
+34
-45
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_serviceworker.js
...lateItem/web_page_module/rjs_gadget_erp5_serviceworker.js
+32
-43
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_serviceworker.xml
...ateItem/web_page_module/rjs_gadget_erp5_serviceworker.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_serviceworker.js
View file @
8ea7fc76
...
@@ -10,16 +10,7 @@
...
@@ -10,16 +10,7 @@
self
.
addEventListener
(
'
install
'
,
function
(
event
)
{
self
.
addEventListener
(
'
install
'
,
function
(
event
)
{
// Perform install step: loading each required file into cache
// Perform install step: loading each required file into cache
event
.
waitUntil
(
event
.
waitUntil
(
// We create cache only if it does not exist. That is because
fetch
(
'
WebSection_getPrecacheManifest
'
)
// we do not want to override an existing cache by mistake.
// Code consistency is very important. We must not mix different
// versions of code.
// (For example, developer change service worker code and forget
// to increase the cache version.)
caches
.
has
(
CACHE_NAME
)
.
then
(
function
(
result
)
{
if
(
!
result
)
{
return
fetch
(
'
WebSection_getPrecacheManifest
'
)
.
then
(
function
(
response
)
{
.
then
(
function
(
response
)
{
return
Promise
.
all
([
return
Promise
.
all
([
response
.
json
(),
response
.
json
(),
...
@@ -46,16 +37,6 @@
...
@@ -46,16 +37,6 @@
// Add all offline dependencies to the cache
// Add all offline dependencies to the cache
return
Promise
.
all
(
promise_list
);
return
Promise
.
all
(
promise_list
);
})
})
.
catch
(
function
(
error
)
{
// Since we do not allow to override existing cache, if cache installation
// failed, we need to delete the cache completely.
caches
.
delete
(
CACHE_NAME
);
// Explicitly unregister service worker else it may not be done.
self
.
registration
.
unregister
();
throw
error
;
});
}
})
.
then
(
function
()
{
.
then
(
function
()
{
// When user accesses ERP5JS web site first time, service worker is
// When user accesses ERP5JS web site first time, service worker is
// installed but it is not activated yet, service worker is activated
// installed but it is not activated yet, service worker is activated
...
@@ -67,6 +48,14 @@
...
@@ -67,6 +48,14 @@
// the first one.
// the first one.
return
self
.
skipWaiting
();
return
self
.
skipWaiting
();
})
})
.
catch
(
function
(
error
)
{
// Since we do not allow to override existing cache, if cache installation
// failed, we need to delete the cache completely.
caches
.
delete
(
CACHE_NAME
);
// Explicitly unregister service worker else it may not be done.
self
.
registration
.
unregister
();
throw
error
;
})
);
);
});
});
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_serviceworker.xml
View file @
8ea7fc76
...
@@ -238,7 +238,7 @@
...
@@ -238,7 +238,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
981.4
5037.17470.33382
</string>
</value>
<value>
<string>
981.4
8930.15634.60876
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -256,7 +256,7 @@
...
@@ -256,7 +256,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1581
092014.2
</float>
<float>
1581
325589.75
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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