mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-03 04:31:58 +00:00
Backport of #9543 to core/1.41.
Cherry-pick of merge commit 725a0a2b applied cleanly.
**Original PR:** https://github.com/Comfy-Org/ComfyUI_frontend/pull/9543
**Pipeline ticket:** 15e1f241-efaa-4fe5-88ca-4ccc7bfb3345
┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-9562-backport-core-1-41-fix-remove-timeouts-from-error-toasts-so-they-persist-until-dismiss-31d6d73d365081caa825ff32ca622b2c)
by [Unito](https://www.unito.io)
83 lines
2.3 KiB
Vue
83 lines
2.3 KiB
Vue
<template>
|
|
<div
|
|
class="flex w-full max-w-[360px] flex-col rounded-2xl border border-border-default bg-base-background"
|
|
>
|
|
<!-- Header -->
|
|
<div
|
|
class="flex h-12 items-center justify-between border-b border-border-default px-4"
|
|
>
|
|
<h2 class="m-0 text-sm font-normal text-base-foreground">
|
|
{{ $t('workspacePanel.removeMemberDialog.title') }}
|
|
</h2>
|
|
<button
|
|
class="focus-visible:ring-secondary-foreground cursor-pointer rounded-sm border-none bg-transparent p-0 text-muted-foreground transition-colors hover:text-base-foreground focus-visible:ring-1 focus-visible:outline-none"
|
|
:aria-label="$t('g.close')"
|
|
@click="onCancel"
|
|
>
|
|
<i class="pi pi-times size-4" />
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Body -->
|
|
<div class="p-4">
|
|
<p class="m-0 text-sm text-muted-foreground">
|
|
{{ $t('workspacePanel.removeMemberDialog.message') }}
|
|
</p>
|
|
</div>
|
|
|
|
<!-- Footer -->
|
|
<div class="flex items-center justify-end gap-4 p-4">
|
|
<Button variant="muted-textonly" @click="onCancel">
|
|
{{ $t('g.cancel') }}
|
|
</Button>
|
|
<Button variant="destructive" size="lg" :loading @click="onRemove">
|
|
{{ $t('workspacePanel.removeMemberDialog.remove') }}
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { useToast } from 'primevue/usetoast'
|
|
import { ref } from 'vue'
|
|
import { useI18n } from 'vue-i18n'
|
|
|
|
import Button from '@/components/ui/button/Button.vue'
|
|
import { useTeamWorkspaceStore } from '@/platform/workspace/stores/teamWorkspaceStore'
|
|
import { useDialogStore } from '@/stores/dialogStore'
|
|
|
|
const { memberId } = defineProps<{
|
|
memberId: string
|
|
}>()
|
|
|
|
const dialogStore = useDialogStore()
|
|
const workspaceStore = useTeamWorkspaceStore()
|
|
const toast = useToast()
|
|
const { t } = useI18n()
|
|
const loading = ref(false)
|
|
|
|
function onCancel() {
|
|
dialogStore.closeDialog({ key: 'remove-member' })
|
|
}
|
|
|
|
async function onRemove() {
|
|
loading.value = true
|
|
try {
|
|
await workspaceStore.removeMember(memberId)
|
|
toast.add({
|
|
severity: 'success',
|
|
summary: t('workspacePanel.removeMemberDialog.success'),
|
|
life: 2000
|
|
})
|
|
dialogStore.closeDialog({ key: 'remove-member' })
|
|
} catch {
|
|
toast.add({
|
|
severity: 'error',
|
|
summary: t('workspacePanel.removeMemberDialog.error')
|
|
})
|
|
} finally {
|
|
loading.value = false
|
|
}
|
|
}
|
|
</script>
|