Skip to content

Commit 5b98696

Browse files
authored
Merge pull request #2336 from appwrite/fix-Unable-to-set-teamId
2 parents 2e49976 + daee529 commit 5b98696

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/routes/(console)/project-[region]-[project]/auth/createTeam.svelte

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@
1010
import { Icon, Tag } from '@appwrite.io/pink-svelte';
1111
import { createEventDispatcher } from 'svelte';
1212
13-
export let showCreate = false;
13+
let { showCreate = $bindable(false) }: { showCreate: boolean } = $props();
1414
1515
const dispatch = createEventDispatcher();
1616
17-
let name: string, id: string, error: string;
18-
let showCustomId = false;
17+
let name = $state('');
18+
let id = $state<string | null>(null);
19+
let error = $state<string | null>(null);
20+
let showCustomId = $state(false);
1921
2022
const create = async () => {
2123
try {
@@ -42,10 +44,13 @@
4244
}
4345
};
4446
45-
$: if (!showCreate) {
46-
showCustomId = false;
47-
error = null;
48-
}
47+
$effect(() => {
48+
if (!showCreate) {
49+
showCustomId = false;
50+
id = null;
51+
error = null;
52+
}
53+
});
4954
</script>
5055

5156
<Modal title="Create team" {error} size="m" bind:show={showCreate} onSubmit={create}>

0 commit comments

Comments
 (0)