Skip to content

Commit 9bb4b30

Browse files
committed
fix: fix unupdate problem in group invite code create action
1 parent f44a5c9 commit 9bb4b30

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

client/web/src/components/modals/CreateGroupInvite/CreateInviteCode.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ enum InviteCodeType {
2424
interface CreateInviteCodeProps {
2525
groupId: string;
2626
onInviteCreated?: () => void;
27+
onInviteUpdated?: () => void;
2728
}
2829
export const CreateInviteCode: React.FC<CreateInviteCodeProps> = React.memo(
29-
({ groupId, onInviteCreated }) => {
30+
({ groupId, onInviteCreated, onInviteUpdated }) => {
3031
const [createdInvite, setCreateInvite] = useState<GroupInvite | null>(null);
3132
const [{ loading }, handleCreateInviteLink] = useAsyncRequest(
3233
async (inviteType: InviteCodeType) => {
@@ -64,6 +65,7 @@ export const CreateInviteCode: React.FC<CreateInviteCodeProps> = React.memo(
6465
} as any)
6566
);
6667
closeModal(key);
68+
onInviteUpdated?.();
6769
}}
6870
/>
6971
);

client/web/src/components/modals/CreateGroupInvite/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { CreateInviteCode } from './CreateInviteCode';
1111
interface CreateGroupInviteProps {
1212
groupId: string;
1313
onInviteCreated?: () => void;
14+
onInviteUpdated?: () => void;
1415
}
1516
export const CreateGroupInvite: React.FC<CreateGroupInviteProps> = React.memo(
1617
(props) => {
@@ -52,6 +53,7 @@ export const CreateGroupInvite: React.FC<CreateGroupInviteProps> = React.memo(
5253
<CreateInviteCode
5354
groupId={groupId}
5455
onInviteCreated={props.onInviteCreated}
56+
onInviteUpdated={props.onInviteUpdated}
5557
/>
5658
</ModalWrapper>
5759
);

client/web/src/components/modals/GroupDetail/Invite.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ export const GroupInvite: React.FC<{
3939
onInviteCreated={() => {
4040
refresh();
4141
}}
42+
onInviteUpdated={() => {
43+
refresh();
44+
}}
4245
/>
4346
);
4447
});

0 commit comments

Comments
 (0)