Skip to content

Commit 48d5275

Browse files
committed
fix: show toast when sending community invite
1 parent c8ee6ac commit 48d5275

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

ts/components/avatar/AvatarPlaceHolder/ClosedGroupAvatar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const ClosedGroupAvatar = ({
7272
const firstMemberId = memberAvatars?.firstMember || '';
7373
const secondMemberID = memberAvatars?.secondMember || '';
7474

75-
const avatarSize = containerSize * 0.727272727272;
75+
const avatarSize = Math.floor((containerSize * 8) / 11);
7676

7777
if (!avatarSize) {
7878
throw new Error(`Invalid avatar size ${containerSize}`);

ts/components/dialog/InviteContactsDialog.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useState } from 'react';
22
import useKey from 'react-use/lib/useKey';
3+
import { clone } from 'lodash';
34

45
import { PubkeyType } from 'libsession_util_nodejs';
56
import { useDispatch } from 'react-redux';
@@ -26,6 +27,7 @@ import { NoResultsForSearch } from '../search/NoResults';
2627
import { SessionWrapperModal2 } from '../SessionWrapperModal2';
2728
import { useHotkey } from '../../hooks/useHotkey';
2829
import { searchActions } from '../../state/ducks/search';
30+
import { ToastUtils } from '../../session/utils';
2931

3032
type Props = {
3133
conversationId: string;
@@ -45,6 +47,10 @@ async function submitForOpenGroup(convoId: string, pubkeys: Array<string>) {
4547
url: roomDetails?.fullUrlWithPubkey,
4648
name: convo.getNicknameOrRealUsernameOrPlaceholder(),
4749
};
50+
ToastUtils.pushToastInfo(
51+
'sendingInvites',
52+
localize('groupInviteSending').withArgs({ count: pubkeys.length }).toString()
53+
);
4854
// eslint-disable-next-line @typescript-eslint/no-misused-promises
4955
pubkeys.forEach(async pubkeyStr => {
5056
const privateConvo = await ConvoHub.use().getOrCreateAndWait(
@@ -133,7 +139,8 @@ const InviteContactsDialogInner = (props: Props) => {
133139
return;
134140
}
135141
if (isPublic) {
136-
void submitForOpenGroup(conversationId, selectedContacts);
142+
void submitForOpenGroup(conversationId, clone(selectedContacts));
143+
empty();
137144
return;
138145
}
139146
if (!PubKey.is03Pubkey(conversationId)) {

0 commit comments

Comments
 (0)