Skip to content

Commit

Permalink
Fix PWA ServiceWorker and manifest
Browse files Browse the repository at this point in the history
Co-authored-by: Mael Fosso <fosso@integreat-app.de>
Co-authored-by: Emmanuel Kembou <e.kembou@live.de>
  • Loading branch information
3 people committed Sep 23, 2020
1 parent 53faed6 commit d02bd1d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/vocgui/static/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"type": "image/png"
}
],
"start_url": "/",
"start_url": "",
"display": "standalone",
"orientation": "portrait",
"theme_color": "#ffffff",
Expand Down
10 changes: 9 additions & 1 deletion src/vocgui/static/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,15 @@ $( "#select_training_set" ).change(function() {
* Load available training sets after page load
*/
$( document ).ready(function() {
navigator.serviceWorker.register('/static/serviceworker.js')
if("serviceWorker" in navigator) {
navigator.serviceWorker.register("/static/serviceworker.js").then(registraction=> {
console.log("SW Registered!");
console.log(registraction);
}).catch(error => {
console.log("SW Registration Failed!");
console.log(error);
});
}
reset_env();
get_available_sets();
});
Expand Down

0 comments on commit d02bd1d

Please sign in to comment.