Skip to content

Commit 8097b6a

Browse files
committed
Update ManageModal.svelte
no confirmation when no memories exist
1 parent 7cfbf64 commit 8097b6a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/lib/components/chat/Settings/Personalization/ManageModal.svelte

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
return null;
3636
});
3737
38-
if (res) {
38+
if (res && memories.length > 0) {
3939
toast.success($i18n.t('Memory cleared successfully'));
4040
memories = [];
4141
}
@@ -192,7 +192,11 @@
192192
<button
193193
class=" px-3.5 py-1.5 font-medium text-red-500 hover:bg-black/5 dark:hover:bg-white/5 outline outline-1 outline-red-300 dark:outline-red-800 rounded-3xl"
194194
on:click={() => {
195-
showClearConfirmDialog = true;
195+
if (memories.length > 0) {
196+
showClearConfirmDialog = true;
197+
} else {
198+
toast.error($i18n.t('No memories to clear'));
199+
}
196200
}}>{$i18n.t('Clear memory')}</button
197201
>
198202
</div>

0 commit comments

Comments
 (0)