From 8aa62b046e6b8ac6a3534aa86995fd04ef7b73ea Mon Sep 17 00:00:00 2001 From: Xyphyn Date: Sat, 26 Aug 2023 10:25:44 -0700 Subject: [PATCH] feat: add deubg menu to users --- src/lib/components/ui/modal/Modal.svelte | 6 +++- .../components/util/debug/DebugObject.svelte | 2 +- .../components/util/debug/DebugTree.svelte | 7 +--- src/routes/accounts/+page.svelte | 33 +++++++++++++++++++ 4 files changed, 40 insertions(+), 8 deletions(-) diff --git a/src/lib/components/ui/modal/Modal.svelte b/src/lib/components/ui/modal/Modal.svelte index 47c7e72b..15d32c3a 100644 --- a/src/lib/components/ui/modal/Modal.svelte +++ b/src/lib/components/ui/modal/Modal.svelte @@ -40,7 +40,11 @@ flex flex-col items-center justify-center bg-black/50 backdrop-blur-sm box-borde

- diff --git a/src/lib/components/util/debug/DebugObject.svelte b/src/lib/components/util/debug/DebugObject.svelte index 219002db..3eb418da 100644 --- a/src/lib/components/util/debug/DebugObject.svelte +++ b/src/lib/components/util/debug/DebugObject.svelte @@ -7,6 +7,6 @@ - Debug + Debug diff --git a/src/lib/components/util/debug/DebugTree.svelte b/src/lib/components/util/debug/DebugTree.svelte index a07d9c52..e8b2ca66 100644 --- a/src/lib/components/util/debug/DebugTree.svelte +++ b/src/lib/components/util/debug/DebugTree.svelte @@ -12,13 +12,8 @@ {#if typeof object[key] === 'object'} {:else} -
{object[key]}
+
{object[key]}
{/if} {/each} - - diff --git a/src/routes/accounts/+page.svelte b/src/routes/accounts/+page.svelte index 41fb0cf1..e1dadd45 100644 --- a/src/routes/accounts/+page.svelte +++ b/src/routes/accounts/+page.svelte @@ -6,6 +6,8 @@ resetProfile, deleteProfile, moveProfile, + type Profile, + profile, } from '$lib/auth.js' import Button from '$lib/components/input/Button.svelte' import TextInput from '$lib/components/input/TextInput.svelte' @@ -13,6 +15,7 @@ import Menu from '$lib/components/ui/menu/Menu.svelte' import MenuButton from '$lib/components/ui/menu/MenuButton.svelte' import { toast } from '$lib/components/ui/toasts/toasts.js' + import DebugObject from '$lib/components/util/debug/DebugObject.svelte' import { DEFAULT_INSTANCE_URL, LINKED_INSTANCE_URL, @@ -20,9 +23,11 @@ } from '$lib/instance.js' import { validateInstance } from '$lib/lemmy.js' import ProfileAvatar from '$lib/lemmy/ProfileAvatar.svelte' + import { userSettings } from '$lib/settings.js' import { ArrowLeftOnRectangle, ArrowUturnLeft, + BugAnt, ChevronDown, ChevronUp, EllipsisHorizontal, @@ -67,12 +72,29 @@ } loading = false } + + let debugging = false + let debugProfile: Profile | undefined = undefined Accounts +{#if debugging} + + +

Debug

+ + Do NOT share anything from this menu. + +
+
+{/if} + {#if $profileData.profiles.length == 0}
Reset Color + {#if $userSettings.debugInfo} + { + debugProfile = profile + debugging = !debugging + }} + > + + Debug Info + + {/if}