Spaces:
Sleeping
Sleeping
Andrew
commited on
Commit
·
b6a3ce9
1
Parent(s):
50c8eb0
refactor(ui): update MobileNav to use new persona defaults utility
Browse files
src/lib/components/MobileNav.svelte
CHANGED
|
@@ -17,6 +17,8 @@
|
|
| 17 |
import { Spring } from "svelte/motion";
|
| 18 |
import { pan, type GestureCustomEvent, type PanCustomEvent } from "svelte-gestures";
|
| 19 |
import { shareModal } from "$lib/stores/shareModal";
|
|
|
|
|
|
|
| 20 |
interface Props {
|
| 21 |
title: string | undefined;
|
| 22 |
children?: import("svelte").Snippet;
|
|
@@ -52,6 +54,8 @@
|
|
| 52 |
{ stiffness: 0.2, damping: 0.8 }
|
| 53 |
);
|
| 54 |
|
|
|
|
|
|
|
| 55 |
$effect(() => {
|
| 56 |
title ??= "New Chat";
|
| 57 |
});
|
|
@@ -111,7 +115,17 @@
|
|
| 111 |
<IconShare classNames={!canShare ? "opacity-40" : ""} />
|
| 112 |
</button>
|
| 113 |
{/if}
|
| 114 |
-
<a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
<IconNew />
|
| 116 |
</a>
|
| 117 |
</div>
|
|
|
|
| 17 |
import { Spring } from "svelte/motion";
|
| 18 |
import { pan, type GestureCustomEvent, type PanCustomEvent } from "svelte-gestures";
|
| 19 |
import { shareModal } from "$lib/stores/shareModal";
|
| 20 |
+
import { useSettingsStore } from "$lib/stores/settings";
|
| 21 |
+
import { resetActivePersonasToDefaults } from "$lib/utils/personaDefaults";
|
| 22 |
interface Props {
|
| 23 |
title: string | undefined;
|
| 24 |
children?: import("svelte").Snippet;
|
|
|
|
| 54 |
{ stiffness: 0.2, damping: 0.8 }
|
| 55 |
);
|
| 56 |
|
| 57 |
+
const settings = useSettingsStore();
|
| 58 |
+
|
| 59 |
$effect(() => {
|
| 60 |
title ??= "New Chat";
|
| 61 |
});
|
|
|
|
| 115 |
<IconShare classNames={!canShare ? "opacity-40" : ""} />
|
| 116 |
</button>
|
| 117 |
{/if}
|
| 118 |
+
<a
|
| 119 |
+
href="{base}/"
|
| 120 |
+
class="flex size-8 shrink-0 items-center justify-center text-lg"
|
| 121 |
+
onclick={() => {
|
| 122 |
+
void resetActivePersonasToDefaults(
|
| 123 |
+
settings,
|
| 124 |
+
$settings.personas,
|
| 125 |
+
$settings.activePersonas
|
| 126 |
+
);
|
| 127 |
+
}}
|
| 128 |
+
>
|
| 129 |
<IconNew />
|
| 130 |
</a>
|
| 131 |
</div>
|