fix(core): show SentRequestPage when invitation status is NeedMoreSeat (#11207)

This commit is contained in:
JimmFly
2025-03-27 03:00:14 +00:00
parent 2e5ce44e1b
commit 4fddf0d000
3 changed files with 21 additions and 22 deletions

View File

@@ -10,7 +10,7 @@ export const JoinFailedPage = ({
inviteInfo,
error,
}: {
inviteInfo: GetInviteInfoQuery['getInviteInfo'];
inviteInfo?: GetInviteInfoQuery['getInviteInfo'];
error?: any;
}) => {
const userFriendlyError = UserFriendlyError.fromAny(error);
@@ -27,8 +27,8 @@ export const JoinFailedPage = ({
1: (
<div className={styles.avatarWrapper}>
<Avatar
url={`data:image/png;base64,${inviteInfo.workspace.avatar}`}
name={inviteInfo.workspace.name}
url={`data:image/png;base64,${inviteInfo?.workspace.avatar}`}
name={inviteInfo?.workspace.name}
size={20}
colorfulFallback
/>
@@ -37,7 +37,7 @@ export const JoinFailedPage = ({
2: <span className={styles.inviteName} />,
}}
values={{
workspaceName: inviteInfo.workspace.name,
workspaceName: inviteInfo?.workspace.name,
}}
/>
<div>{t['com.affine.fail-to-join-workspace.description-2']()}</div>

View File

@@ -16,7 +16,7 @@ export const RequestToJoinPage = ({
onSignOut,
}: {
user: User | null;
inviteInfo: GetInviteInfoQuery['getInviteInfo'];
inviteInfo?: GetInviteInfoQuery['getInviteInfo'];
requestToJoin: () => void;
onSignOut: () => void;
}) => {
@@ -28,23 +28,23 @@ export const RequestToJoinPage = ({
<div className={styles.content}>
<div className={styles.userWrapper}>
<Avatar
url={inviteInfo.user.avatarUrl || ''}
name={inviteInfo.user.name}
url={inviteInfo?.user.avatarUrl || ''}
name={inviteInfo?.user.name}
size={20}
/>
<span className={styles.inviteName}>{inviteInfo.user.name}</span>
<span className={styles.inviteName}>{inviteInfo?.user.name}</span>
</div>
<div>{t['invited you to join']()}</div>
<div className={styles.userWrapper}>
<Avatar
url={`data:image/png;base64,${inviteInfo.workspace.avatar}`}
name={inviteInfo.workspace.name}
url={`data:image/png;base64,${inviteInfo?.workspace.avatar}`}
name={inviteInfo?.workspace.name}
size={20}
style={{ marginLeft: 4 }}
colorfulFallback
/>
<span className={styles.inviteName}>
{inviteInfo.workspace.name}
{inviteInfo?.workspace.name}
</span>
</div>
</div>