fix: merge issues

pull/2963/head
Audric Ackermann 1 year ago
parent 1c6182a235
commit 5e3f968d22

@ -38,8 +38,8 @@ const StyledContent = styled.div`
// We cannot import toastutils from the password window as it is pulling the whole sending // We cannot import toastutils from the password window as it is pulling the whole sending
// pipeline(and causing crashes on Session instances with password) // pipeline(and causing crashes on Session instances with password)
function pushToastError(id: string, title: string, description?: string) { function pushToastError(id: string, description: string) {
toast.error(<SessionToast title={title} description={description} />, { toast.error(<SessionToast description={description} />, {
toastId: id, toastId: id,
updateId: id, updateId: id,
}); });

@ -82,34 +82,6 @@ export const ConversationHeaderTitle = () => {
return null; return null;
}, [i18n, isGroup, isKickedFromGroup, isPublic, selectedMembersCount, subscriberCount]); }, [i18n, isGroup, isKickedFromGroup, isPublic, selectedMembersCount, subscriberCount]);
<<<<<<< HEAD
// TODO legacy messages support will be removed in a future release
// NOTE If disappearing messages is defined we must show it first
const disappearingMessageSubtitle = useMemo(() => {
const disappearingMessageSettingText =
expirationMode === 'deleteAfterRead'
? window.i18n('disappearingMessagesModeAfterRead')
: expirationMode === 'deleteAfterSend'
? window.i18n('disappearingMessagesModeAfterSend')
: expirationMode === 'legacy'
? isMe || (isGroup && !isPublic)
? window.i18n('disappearingMessagesModeAfterSend')
: window.i18n('disappearingMessagesModeAfterRead')
: null;
const abbreviatedExpireTime = isNumber(expireTimer)
? TimerOptions.getAbbreviated(expireTimer)
: null;
return expireTimer && disappearingMessageSettingText
? `${disappearingMessageSettingText}${
abbreviatedExpireTime ? ` - ${abbreviatedExpireTime}` : ''
}`
: null;
}, [expirationMode, expireTimer, isGroup, isMe, isPublic]);
=======
>>>>>>> unstable
const handleRightPanelToggle = () => { const handleRightPanelToggle = () => {
if (isRightPanelOn) { if (isRightPanelOn) {
dispatch(closeRightPanel()); dispatch(closeRightPanel());

@ -41,15 +41,13 @@ import { AttachmentTypeWithPath } from '../../../../types/Attachment';
import { getAbsoluteAttachmentPath } from '../../../../types/MessageAttachment'; import { getAbsoluteAttachmentPath } from '../../../../types/MessageAttachment';
import { Avatar, AvatarSize } from '../../../avatar/Avatar'; import { Avatar, AvatarSize } from '../../../avatar/Avatar';
import { Flex } from '../../../basic/Flex'; import { Flex } from '../../../basic/Flex';
import { SpacerMD } from '../../../basic/Text'; import { SpacerLG, SpacerMD, SpacerXL } from '../../../basic/Text';
import { PanelButtonGroup, PanelIconButton } from '../../../buttons'; import { PanelButtonGroup, PanelIconButton } from '../../../buttons';
import { MediaItemType } from '../../../lightbox/LightboxGallery'; import { MediaItemType } from '../../../lightbox/LightboxGallery';
import { MediaGallery } from '../../media-gallery/MediaGallery'; import { MediaGallery } from '../../media-gallery/MediaGallery';
import { Header, StyledScrollContainer } from './components'; import { Header, StyledScrollContainer } from './components';
async function getMediaGalleryProps( async function getMediaGalleryProps(conversationId: string): Promise<{
conversationId: string
): Promise<{
documents: Array<MediaItemType>; documents: Array<MediaItemType>;
media: Array<MediaItemType>; media: Array<MediaItemType>;
}> { }> {
@ -268,8 +266,8 @@ export const OverlayRightPanelSettings = () => {
const showAddRemoveModeratorsButton = weAreAdmin && !commonNoShow && isPublic; const showAddRemoveModeratorsButton = weAreAdmin && !commonNoShow && isPublic;
const showUpdateGroupMembersButton = !isPublic && isGroup && !commonNoShow; const showUpdateGroupMembersButton = !isPublic && isGroup && !commonNoShow;
const deleteConvoAction = async () => { const deleteConvoAction = () => {
await showLeaveGroupByConvoId(selectedConvoKey, selectedUsername); void showLeaveGroupByConvoId(selectedConvoKey, selectedUsername);
}; };
return ( return (
@ -338,7 +336,7 @@ export const OverlayRightPanelSettings = () => {
<PanelIconButton <PanelIconButton
text={leaveGroupString} text={leaveGroupString}
dataTestId="leave-group-button" dataTestId="leave-group-button"
disabled={isKickedFromGroup || left} disabled={isKickedFromGroup}
onClick={() => void deleteConvoAction()} onClick={() => void deleteConvoAction()}
color={'var(--danger-color)'} color={'var(--danger-color)'}
iconType={'delete'} iconType={'delete'}

@ -7,7 +7,8 @@ import {
ConversationInteractionStatus, ConversationInteractionStatus,
ConversationInteractionType, ConversationInteractionType,
} from '../../../interactions/conversationInteractions'; } from '../../../interactions/conversationInteractions';
import { getConversationController } from '../../../session/conversations';
import { ConvoHub } from '../../../session/conversations';
import { LastMessageType } from '../../../state/ducks/conversations'; import { LastMessageType } from '../../../state/ducks/conversations';
import { assertUnreachable } from '../../../types/sqlSharedTypes'; import { assertUnreachable } from '../../../types/sqlSharedTypes';
import { MessageBody } from '../../conversation/message/message-content/MessageBody'; import { MessageBody } from '../../conversation/message/message-content/MessageBody';
@ -34,7 +35,7 @@ export const InteractionItem = (props: InteractionItemProps) => {
// NOTE we want to reset the interaction state when the last message changes // NOTE we want to reset the interaction state when the last message changes
useEffect(() => { useEffect(() => {
if (conversationId) { if (conversationId) {
const convo = getConversationController().get(conversationId); const convo = ConvoHub.use().get(conversationId);
if (storedLastMessageInteractionStatus !== convo.get('lastMessageInteractionStatus')) { if (storedLastMessageInteractionStatus !== convo.get('lastMessageInteractionStatus')) {
setStoredLastMessageInteractionStatus(convo.get('lastMessageInteractionStatus')); setStoredLastMessageInteractionStatus(convo.get('lastMessageInteractionStatus'));

@ -126,6 +126,7 @@ export const DeletePrivateContactMenuItem = () => {
await ConvoHub.use().delete1o1(convoId, { await ConvoHub.use().delete1o1(convoId, {
fromSyncMessage: false, fromSyncMessage: false,
justHidePrivate: false, justHidePrivate: false,
keepMessages: false,
}); });
}, },
}) })

@ -341,6 +341,7 @@ async function deleteContactsFromDB(contactsToRemove: Array<string>) {
await ConvoHub.use().delete1o1(contactToRemove, { await ConvoHub.use().delete1o1(contactToRemove, {
fromSyncMessage: true, fromSyncMessage: true,
justHidePrivate: false, justHidePrivate: false,
keepMessages: false,
}); });
} catch (e) { } catch (e) {
window.log.warn( window.log.warn(

@ -49,7 +49,7 @@ import {
} from '../../webworker/workers/browser/libsession_worker_interface'; } from '../../webworker/workers/browser/libsession_worker_interface';
import { StateType } from '../reducer'; import { StateType } from '../reducer';
import { openConversationWithMessages } from './conversations'; import { openConversationWithMessages } from './conversations';
import { resetOverlayMode } from './section'; import { resetLeftOverlayMode } from './section';
type WithAddWithoutHistoryMembers = { withoutHistory: Array<PubkeyType> }; type WithAddWithoutHistoryMembers = { withoutHistory: Array<PubkeyType> };
type WithAddWithHistoryMembers = { withHistory: Array<PubkeyType> }; type WithAddWithHistoryMembers = { withHistory: Array<PubkeyType> };
@ -195,7 +195,7 @@ const initNewGroupInWrapper = createAsyncThunk(
convo.set({ active_at: Date.now() }); convo.set({ active_at: Date.now() });
await convo.commit(); await convo.commit();
convo.updateLastMessage(); convo.updateLastMessage();
dispatch(resetOverlayMode()); dispatch(resetLeftOverlayMode());
// Everything is setup for this group, we now need to send the invites to each members, // Everything is setup for this group, we now need to send the invites to each members,
// privately and asynchronously, and gracefully handle errors with toasts. // privately and asynchronously, and gracefully handle errors with toasts.

Loading…
Cancel
Save