Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
feat(PWA): shortcuts for create item and list (#31)
Browse files Browse the repository at this point in the history
Co-authored-by: Dennis Trümper <[email protected]>
  • Loading branch information
dennistruemper and dennistruemper authored Jul 30, 2023
1 parent 5d73020 commit 5e01d68
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.ico" />
<link rel="manifest" href="manifest.json" />
<link rel="manifest" href="/manifest.json" />
<meta name="theme-color" content="##d946ef" />
<meta name="viewport" content="width=device-width" />
%sveltekit.head%
Expand Down
2 changes: 1 addition & 1 deletion src/components/buttons/actionBarBackButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
let previousPage: string = base;
afterNavigate((input) => {
previousPage = input.from?.url.pathname ?? base;
previousPage = input.from?.url?.pathname ?? base;
});
</script>

Expand Down
2 changes: 0 additions & 2 deletions src/stores/timetravelStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export function createTimetraveStore<Model, Event>(
};
}

console.log('droch');
const loadedData = storage?.load() ?? initialData();

const { subscribe, set, update } = writable(loadedData ?? initialData());
Expand All @@ -48,7 +47,6 @@ export function createTimetraveStore<Model, Event>(
subscribe,
dispatch: (event: Event) =>
update((store) => {
console.log('dispatch');
// create new future if event occures in history
if (store.version === store.history.length - 1) {
//append to history
Expand Down
14 changes: 12 additions & 2 deletions static/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@
{ "src": "/android-chrome-192x192.png", "sizes": "192x192", "type": "image/png" },
{ "src": "/android-chrome-512x512.png", "sizes": "512x512", "type": "image/png" }
],
"theme_color": "##d946ef",
"theme_color": "#d946ef",
"background_color": "#f0abfc",
"display": "standalone"
"display": "standalone",
"shortcuts": [
{
"name": "New Item",
"url": "/lists/create"
},
{
"name": "New List",
"url": "/createItem"
}
]
}

0 comments on commit 5e01d68

Please sign in to comment.