Skip to content

Commit

Permalink
feat: add pwa start_url
Browse files Browse the repository at this point in the history
  • Loading branch information
manzt committed Nov 8, 2021
1 parent 344b3be commit 53725be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/vizarr.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ function App() {
const setViewState = useUpdateAtom(viewStateAtom);

async function addImage(config: ImageLayerConfig) {
if (config.source === 'pwa') {
console.warn('Vizarr launched in experimental PWA mode, looking for data at http://localhost:3000.');
config.source = 'http://localhost:3000';
}
const { createSourceData } = await import('./io');
const id = Math.random().toString(36).slice(2);
const sourceData = await createSourceData(config);
Expand Down
2 changes: 1 addition & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const manifest = {
name: 'vizarr',
short_name: 'vizarr',
lang: 'en-US',
start_url: '.',
start_url: '/?source=pwa',
display: 'standalone',
theme_color: '#000000',
icons: [
Expand Down

0 comments on commit 53725be

Please sign in to comment.