This commit is contained in:
Timothy J. Baek
2024-10-17 18:42:36 -07:00
parent 7ffa3cb022
commit 6e4820cad8
3 changed files with 18 additions and 5 deletions

View File

@@ -1,5 +1,7 @@
<script lang="ts">
import { toast } from 'svelte-sonner';
import { v4 as uuidv4 } from 'uuid';
import { goto } from '$app/navigation';
import {
user,
@@ -125,6 +127,18 @@
name = `${name} ${i}`;
}
// Add a dummy folder to the list to show the user that the folder is being created
const tempId = uuidv4();
folders = {
...folders,
tempId: {
id: tempId,
name: name,
created_at: Date.now(),
updated_at: Date.now()
}
};
const res = await createNewFolder(localStorage.token, name).catch((error) => {
toast.error(error);
return null;