mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-16 17:46:18 +08:00
feat: totas error
This commit is contained in:
@@ -134,7 +134,7 @@ export const InviteMembers = ({
|
||||
onInviteSuccess && onInviteSuccess();
|
||||
})
|
||||
.catch(err => {
|
||||
toast('Invite failed');
|
||||
// toast('Invite failed');
|
||||
console.log(err);
|
||||
});
|
||||
}}
|
||||
|
||||
+15
-3
@@ -2,10 +2,17 @@ import { Popper } from '@/ui/popper';
|
||||
import { Avatar, WorkspaceName, SelectorWrapper } from './styles';
|
||||
import { SelectorPopperContent } from './SelectorPopperContent';
|
||||
import { useState } from 'react';
|
||||
import { useAppState } from '@/providers/app-state-provider';
|
||||
import { WorkspaceType } from '@pathfinder/data-services';
|
||||
|
||||
export const WorkspaceSelector = () => {
|
||||
const [isShow, setIsShow] = useState(false);
|
||||
|
||||
const { currentWorkspace, workspacesMeta, currentWorkspaceId, user } =
|
||||
useAppState();
|
||||
const workspaceMeta = workspacesMeta.find(
|
||||
meta => String(meta.id) === String(currentWorkspaceId)
|
||||
);
|
||||
console.log('currentWorkspace', currentWorkspace, workspaceMeta);
|
||||
return (
|
||||
<Popper
|
||||
content={<SelectorPopperContent isShow={isShow} />}
|
||||
@@ -15,8 +22,13 @@ export const WorkspaceSelector = () => {
|
||||
onVisibleChange={setIsShow}
|
||||
>
|
||||
<SelectorWrapper>
|
||||
<Avatar alt="Affine" />
|
||||
<WorkspaceName>AFFiNE</WorkspaceName>
|
||||
<Avatar alt="Affine" src={currentWorkspace?.meta.avatar || ''} />
|
||||
<WorkspaceName>
|
||||
{currentWorkspace?.meta.name ||
|
||||
(workspaceMeta?.type === WorkspaceType.Private && user
|
||||
? user.name
|
||||
: `workspace-${workspaceMeta?.id}`)}
|
||||
</WorkspaceName>
|
||||
</SelectorWrapper>
|
||||
</Popper>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user