Skip to content

Commit

Permalink
more updates
Browse files Browse the repository at this point in the history
  • Loading branch information
erinz2020 committed Sep 20, 2024
1 parent 742a147 commit 1039cf9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions frontend/public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"type": "image/x-icon"
},
{
"src": "/react/images/logo192.png",
"src": "images/logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "/react/images/logo512.png",
"src": "images/logo512.png",
"type": "image/png",
"sizes": "512x512"
}
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ function App() {
setFilters({});
};

const publicUrl = process.env.PUBLIC_URL ? new URL(process.env.PUBLIC_URL).pathname : "/";

return (
<QueryClientProvider client={queryClient}>
<LocaleContext.Provider
Expand All @@ -60,7 +62,7 @@ function App() {
className="App mx-auto w-100 position-relative"
style={containerStyle}
>
<BrowserRouter basename="/react">
<BrowserRouter basename={publicUrl}>
<IntlProvider
locale={locale}
defaultLocale="en"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/home/Report.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function Report() {
/>
<image
alt="report"
href={`${process.env.PUBLIC_URL}images/submit.png`}
href={`${process.env.PUBLIC_URL}/images/submit.png`}
x="0"
y="0"
width="538px"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ root.render(

if('serviceWorker' in navigator) {
console.log('Service worker supported');
navigator.serviceWorker.register('/react/service-worker.js')
navigator.serviceWorker.register(`${process.env.PUBLIC_URL}/service-worker.js`)
.then(reg => {
console.log('Service worker registered', reg);
})
Expand Down

0 comments on commit 1039cf9

Please sign in to comment.