Fix: remove member issues (#1026)

This commit is contained in:
Qi 2023-02-15 18:07:47 +08:00 committed by GitHub
parent c65adc5e25
commit d40bdb9699
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 13 deletions

View File

@ -20,7 +20,6 @@ import { InviteMemberModal } from './InviteMemberModal';
import { Menu, MenuItem } from '@affine/component';
import { Empty } from '@affine/component';
import { WorkspaceUnit } from '@affine/datacenter';
import { useConfirm } from '@/providers/ConfirmProvider';
import { toast } from '@affine/component';
import useMembers from '@/hooks/use-members';
import Loading from '@/components/loading';
@ -33,7 +32,6 @@ export const MembersPage = ({ workspace }: { workspace: WorkspaceUnit }) => {
const { members, removeMember, loaded } = useMembers();
const { triggerEnableWorkspaceModal } = useModal();
const { t } = useTranslation();
const confirm = useConfirm(store => store.confirm);
if (workspace.provider === 'affine') {
return (
@ -101,16 +99,6 @@ export const MembersPage = ({ workspace }: { workspace: WorkspaceUnit }) => {
<>
<MenuItem
onClick={async () => {
const confirmRemove = await confirm({
title: t('Delete Member?'),
content: t('will delete member'),
confirmText: t('Delete'),
confirmType: 'danger',
});
if (!confirmRemove) {
return;
}
await removeMember(member.id);
toast(
t('Member has been removed', {
@ -120,7 +108,7 @@ export const MembersPage = ({ workspace }: { workspace: WorkspaceUnit }) => {
}}
icon={<TrashIcon />}
>
{t('Delete')}
{t('Remove from workspace')}
</MenuItem>
</>
}

View File

@ -33,6 +33,7 @@
"Export to HTML": "Export to HTML",
"Export to Markdown": "Export to Markdown",
"Delete": "Delete",
"Remove from workspace": "Remove from workspace",
"Title": "Title",
"Untitled": "Untitled",
"Created": "Created",