Skip to content

Commit

Permalink
fix: commandList fails to return back to normal state on error
Browse files Browse the repository at this point in the history
  • Loading branch information
typicalninja committed Sep 12, 2023
1 parent 030e769 commit 6a908ca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/commandList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
label: 'Delete',
onClick: () => {
toast.promise(
fetchAPI(`${basePath}/${interaction.id}`, { method: 'DELETE' }).then(() => { refreshList(); removeFromPending();}),
fetchAPI(`${basePath}/${interaction.id}`, { method: 'DELETE' }).finally(() => { refreshList(); removeFromPending();}),
{
success: `${typeToName(interaction.type)} (${
interaction.name
Expand Down
3 changes: 1 addition & 2 deletions src/routes/editor/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@
{:else if $commandQuery.isError}
<span class="text-red-300">Oops Editor failed to fetch command (You wil not be able to edit command {commandId})</span>
{:else}
Editing {typeToName(commandData.type)}
<span class="font-bold text-green-400">{commandData.name}</span> in {@html id === 'global' ? 'global' : `guild <span class="text-blurple-300">(${id})</span>`} scope
Editing {typeToName(commandData.type)} <span class="m-1 font-bold text-green-400">{commandData.name}</span> in {@html id === 'global' ? 'global' : `guild <span class="text-blurple-300">(${id})</span>`} scope
{/if}
{:else}
<span>Adding new {typeToName($data.type)} Interaction in {@html id === 'global' ? 'global' : `guild <span class="text-blurple-300">(${id})</span>`} scope</span>
Expand Down

0 comments on commit 6a908ca

Please sign in to comment.