nsarrazin HF Staff commited on
Commit
e6f9144
·
1 Parent(s): 7bcf4d9

fix: let users explore app without signing

Browse files
src/hooks.server.ts CHANGED
@@ -249,6 +249,7 @@ export const handle: Handle = async ({ event, resolve }) => {
249
  if (
250
  !event.url.pathname.startsWith(`${base}/login`) &&
251
  !event.url.pathname.startsWith(`${base}/admin`) &&
 
252
  !["GET", "OPTIONS", "HEAD"].includes(event.request.method)
253
  ) {
254
  if (
 
249
  if (
250
  !event.url.pathname.startsWith(`${base}/login`) &&
251
  !event.url.pathname.startsWith(`${base}/admin`) &&
252
+ !event.url.pathname.startsWith(`${base}/settings`) &&
253
  !["GET", "OPTIONS", "HEAD"].includes(event.request.method)
254
  ) {
255
  if (
src/lib/components/DisclaimerModal.svelte CHANGED
@@ -29,27 +29,29 @@
29
  </p>
30
 
31
  <div class="flex w-full flex-col items-center gap-2">
32
- {#if $page.data.guestMode || !$page.data.loginEnabled}
33
- <button
34
- class="w-full justify-center rounded-full border-2 border-gray-300 bg-black px-5 py-2 text-lg font-semibold text-gray-100 transition-colors hover:bg-gray-900"
35
- class:bg-white={$page.data.loginEnabled}
36
- class:text-gray-800={$page.data.loginEnabled}
37
- class:hover:bg-slate-100={$page.data.loginEnabled}
38
- on:click|preventDefault|stopPropagation={() => {
39
- if (!cookiesAreEnabled()) {
40
- window.open(window.location.href, "_blank");
41
- }
42
 
43
- $settings.ethicsModalAccepted = true;
44
- }}
45
- >
46
- {#if $page.data.loginEnabled}
47
- Try as guest
 
48
  {:else}
49
- Start chatting
50
  {/if}
51
- </button>
52
- {/if}
 
 
53
  {#if $page.data.loginEnabled}
54
  <form action="{base}/login" target="_parent" method="POST" class="w-full">
55
  <button
 
29
  </p>
30
 
31
  <div class="flex w-full flex-col items-center gap-2">
32
+ <button
33
+ class="w-full justify-center rounded-full border-2 border-gray-300 bg-black px-5 py-2 text-lg font-semibold text-gray-100 transition-colors hover:bg-gray-900"
34
+ class:bg-white={$page.data.loginEnabled}
35
+ class:text-gray-800={$page.data.loginEnabled}
36
+ class:hover:bg-slate-100={$page.data.loginEnabled}
37
+ on:click|preventDefault|stopPropagation={() => {
38
+ if (!cookiesAreEnabled()) {
39
+ window.open(window.location.href, "_blank");
40
+ }
 
41
 
42
+ $settings.ethicsModalAccepted = true;
43
+ }}
44
+ >
45
+ {#if $page.data.loginEnabled}
46
+ {#if $page.data.guestMode}
47
+ Continue as guest
48
  {:else}
49
+ Explore the app
50
  {/if}
51
+ {:else}
52
+ Start chatting
53
+ {/if}
54
+ </button>
55
  {#if $page.data.loginEnabled}
56
  <form action="{base}/login" target="_parent" method="POST" class="w-full">
57
  <button