From d698b73533bb60b35feac96c45db4fc62515bda1 Mon Sep 17 00:00:00 2001 From: stillday Date: Thu, 28 Oct 2021 17:02:30 +0200 Subject: [PATCH 1/4] include disabled buttons --- src/lib/components/translater.svelte | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib/components/translater.svelte b/src/lib/components/translater.svelte index baba618..ab34dfa 100644 --- a/src/lib/components/translater.svelte +++ b/src/lib/components/translater.svelte @@ -253,6 +253,8 @@ if ($isAuthenticated) { + {:else} + {/if} @@ -263,6 +265,8 @@ if ($isAuthenticated) { + {:else} + {/if} {#if filename === 'Zauber (SRD)'} @@ -273,6 +277,8 @@ if ($isAuthenticated) { + {:else} + {/if} {/if} @@ -283,6 +289,8 @@ if ($isAuthenticated) { + {:else} + {/if} From 2fc8f1753538db4a9ba64914f4295c6c1a1db880 Mon Sep 17 00:00:00 2001 From: stillday Date: Thu, 28 Oct 2021 17:03:04 +0200 Subject: [PATCH 2/4] remove not used code --- src/lib/cookie.ts | 12 ++++++------ src/routes/api/db.json.ts | 1 - src/routes/index.svelte | 5 ++--- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/lib/cookie.ts b/src/lib/cookie.ts index d300666..45c91d4 100644 --- a/src/lib/cookie.ts +++ b/src/lib/cookie.ts @@ -12,10 +12,10 @@ export function setCookie(cname, cvalue, exdays) { } export function readCookie(request) { - const cookies = {}; - request.headers.cookie.split(';').forEach(function(cookie) { - const parts = cookie.match(/(.*?)=(.*)$/) - cookies[ parts[1].trim() ] = (parts[2] || '').trim(); - }); - return cookies; + const cookies = {}; + request.headers.cookie.split(';').forEach(function(cookie) { + const parts = cookie.match(/(.*?)=(.*)$/) + cookies[ parts[1].trim() ] = (parts[2] || '').trim(); + }); + return cookies; } diff --git a/src/routes/api/db.json.ts b/src/routes/api/db.json.ts index 44114d2..73d9a9b 100644 --- a/src/routes/api/db.json.ts +++ b/src/routes/api/db.json.ts @@ -41,7 +41,6 @@ export const get: RequestHandler = async (request) => { const file = request.query.get('file'); if (file) { - setFileLog(file, readCookie(request)[translatorUser]); body = await readFile(file); } return { diff --git a/src/routes/index.svelte b/src/routes/index.svelte index 0e75e24..65861f1 100644 --- a/src/routes/index.svelte +++ b/src/routes/index.svelte @@ -5,7 +5,7 @@