Skip to content

Commit

Permalink
Fixed PWA incompatibilities with new Scope
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcos Fernández Pérez committed Jun 4, 2024
1 parent 741ab94 commit 665e521
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 27 deletions.
Binary file modified bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@tailwindcss/forms": "^0.5.7",
"@tauri-apps/cli": "^1.5.14",
"@types/eslint": "^8.56.10",
"@types/node": "^20.14.0",
"@types/node": "^20.14.1",
"@vite-pwa/assets-generator": "^0.2.4",
"@vite-pwa/sveltekit": "^0.5.0",
"autoprefixer": "^10.4.19",
Expand All @@ -64,7 +64,7 @@
"terser": "^5.31.0",
"tslib": "^2.6.2",
"typescript": "^5.4.5",
"typescript-eslint": "^7.11.0",
"typescript-eslint": "^7.12.0",
"vite": "^5.2.12",
"workbox-precaching": "^7.1.0"
},
Expand Down
20 changes: 10 additions & 10 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
})
if (window.__TAURI__) {
window.location.pathname = base + '/new'
window.location.pathname = base + '/app/new'
}
</script>

Expand All @@ -50,7 +50,7 @@
<svelte:fragment slot="h2">{$_('landing.title')}</svelte:fragment>
<p class="mb-6 font-light text-gray-500 dark:text-gray-400 md:text-lg">{$_('landing.title-desc')}</p>
<a
href="{base}/new"
href="{base}/app/new"
class="inline-flex items-center rounded-lg bg-primary-700 px-5 py-2.5 text-center text-sm font-medium text-white hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 dark:focus:ring-primary-900"
>
{$_('landing.get-started')}
Expand Down
11 changes: 7 additions & 4 deletions src/routes/app/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
.orderBy('id')
.first()
.then(cong => {
if (!cong) {
window.location.pathname = base + '/new'
if (!cong && window.location.pathname != '/app/new') {
window.location.pathname = base + '/app/new'
}
if (cong?.lang) {
$locale = cong.lang
Expand Down Expand Up @@ -68,15 +68,18 @@
{/await}
</div>
{#if $congregation.length > 0}
{#if [`${base}/app`, `${base}/app/settings`, `${base}/app/publishers`, `${base}/app/schedules`, `${base}/app/turns`, `${base}/app/incidences`].includes($page.url.pathname)}
{#if ![`${base}/app/new`].includes($page.url.pathname)}
<NavBar />
{/if}
<slot />
{/if}
{#if window.location.pathname == '/app/new'}
<slot />
{/if}
</main>

{#if $congregation.length > 0}
{#if [`${base}/app`, `${base}/app/settings`, `${base}/app/publishers`, `${base}/app/schedules`, `${base}/app/turns`, `${base}/app/incidences`].includes($page.url.pathname)}
{#if ![`${base}/app/new`].includes($page.url.pathname)}
<Footer class="flex flex-row justify-center print:hidden">
<Card class="mx-5 my-1 text-center dark:text-white {mobile ? 'mb-20' : ''}" size="xl">
PPOC Gen version {version}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<script lang="ts">
import '../../app.css'
import {db} from '$lib/db'
import AlertToast from '../../lib/components/AlertToast.svelte'
import AlertToast from '$lib/components/AlertToast.svelte'
import {Button, Input, Select, Label} from 'flowbite-svelte'
import {CloudArrowUpSolid} from 'flowbite-svelte-icons'
import {importInto} from 'dexie-export-import'
Expand Down
14 changes: 7 additions & 7 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export default defineConfig({
display_override: ["standalone", "fullscreen", "minimal-ui", "window-controls-overlay", "browser"],
theme_color: '#eb4034',
background_color: "#ffffff",
start_url: '/app',
scope: '/app',
start_url: '/app/',
scope: '/app/',
id: '/app',
lang: "en",
dir: "ltr",
Expand Down Expand Up @@ -68,7 +68,7 @@ export default defineConfig({
},
file_handlers: [
{
action: "/settings",
action: "/app/settings",
accept: {
"text/plain": [".pgen"]
}
Expand All @@ -77,7 +77,7 @@ export default defineConfig({
shortcuts: [
{
name: "Publishers",
url: "/publishers",
url: "/app/publishers",
description: "Opens publishers page",
icons: [
{
Expand All @@ -89,7 +89,7 @@ export default defineConfig({
},
{
name: "Schedules",
url: "/schedules",
url: "/app/schedules",
description: "Opens schedule page",
icons: [
{
Expand All @@ -101,7 +101,7 @@ export default defineConfig({
},
{
name: "Turns",
url: "/turns",
url: "/app/turns",
description: "Opens turns page",
icons: [
{
Expand All @@ -113,7 +113,7 @@ export default defineConfig({
},
{
name: "Incidences",
url: "/incidences",
url: "/app/incidences",
description: "Opens incidence page",
icons: [
{
Expand Down

0 comments on commit 665e521

Please sign in to comment.