Skip to content

Commit

Permalink
Activate worker immediatly
Browse files Browse the repository at this point in the history
  • Loading branch information
sergesoroka committed Oct 7, 2024
1 parent c3fa3f4 commit d50b929
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions public/worker.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
let accessToken = null;

self.addEventListener("install", (event) => {
self.skipWaiting();
event.waitUntil(self.skipWaiting());
});

self.addEventListener("activate", (event) => {
Expand Down Expand Up @@ -33,7 +33,7 @@ self.addEventListener("fetch", (event) => {
isGeneratedImage(url),
url.origin !== "https://iam.ideaconsult.net",
url.origin !== "https://idp.ideaconsult.net",
request.destination === "image",
// request.destination === "image",
event.request.headers["Authorization"] == undefined
);

Expand Down
4 changes: 2 additions & 2 deletions src/main.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import React, { useEffect } from "react";
import { createBrowserRouter, RouterProvider } from "react-router-dom";
import { ReactKeycloakProvider } from "@react-keycloak/web";
import ReactDOM from "react-dom/client";
Expand Down Expand Up @@ -46,7 +46,7 @@ const Main = () => {
}

if (navigator.serviceWorker.controller) {
console.log("post message", navigator.serviceWorker);
console.log("post message", navigator);

navigator.serviceWorker.controller.postMessage({
type: "SET_TOKEN",
Expand Down

0 comments on commit d50b929

Please sign in to comment.