Skip to content
This repository was archived by the owner on Sep 21, 2026. It is now read-only.

Commit 1c1630f

Browse files
Copilotstnguyen90
andcommitted
fix: improve reactive statement by handling reset in click handler
Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
1 parent 939ff11 commit 1c1630f

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

‎src/routes/(console)/supportWizard.svelte‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,11 @@
5151
});
5252
5353
// Update topic options when category changes
54-
let previousCategory = $supportData.category;
5554
$: topicOptions = ($supportData.category ? topicsByCategory[$supportData.category] || [] : []).map((topic) => ({
5655
value: topic.toLowerCase(),
5756
label: topic
5857
}));
5958
60-
// Reset topic when category changes
61-
$: if ($supportData.category !== previousCategory) {
62-
$supportData.topic = undefined;
63-
previousCategory = $supportData.category;
64-
}
65-
6659
onDestroy(() => {
6760
$supportData = {
6861
message: null,
@@ -159,6 +152,9 @@
159152
{#each ['general', 'billing', 'technical'] as category}
160153
<Tag
161154
on:click={() => {
155+
if ($supportData.category !== category) {
156+
$supportData.topic = undefined;
157+
}
162158
$supportData.category = category;
163159
}}
164160
selected={$supportData.category === category}>{category}</Tag>

0 commit comments

Comments
 (0)