changed serviceWorker registration URL from absolute to relative
This commit is contained in:
parent
f6c48454de
commit
9c8c9086b4
@ -1,7 +1,7 @@
|
|||||||
// Register Service Worker
|
// Register Service Worker
|
||||||
if ("serviceWorker" in navigator) {
|
if ("serviceWorker" in navigator) {
|
||||||
navigator.serviceWorker.register(
|
navigator.serviceWorker.register(
|
||||||
new URL("service-worker.js", import.meta.url), { type: "module" }
|
new URL("./service-worker.js"), { type: "module" }
|
||||||
).then( (registration) => {
|
).then( (registration) => {
|
||||||
console.log('ServiceWorker registration successful with scope: ', registration.scope);
|
console.log('ServiceWorker registration successful with scope: ', registration.scope);
|
||||||
}, (err) => {
|
}, (err) => {
|
||||||
@ -74,6 +74,9 @@ const PHYSICAL_BADGE_HTML = '<sub><span class="badge bg-danger position-absolute
|
|||||||
|
|
||||||
// roll for initiative with the given reaction and number of ini dice
|
// roll for initiative with the given reaction and number of ini dice
|
||||||
function rollForInitiative(dice, rea) {
|
function rollForInitiative(dice, rea) {
|
||||||
|
if (isNaN(parseInt(dice)) || isNaN(parseInt(rea))) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
let diceRolls = Array.from({ length: parseInt(dice) }, () => Math.ceil(Math.random() * 6));
|
let diceRolls = Array.from({ length: parseInt(dice) }, () => Math.ceil(Math.random() * 6));
|
||||||
return diceRolls.reduce((a, b) => a + b, 0) + parseInt(rea);
|
return diceRolls.reduce((a, b) => a + b, 0) + parseInt(rea);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user