-
-
{title}
+ const currentSliderValue = type === SessionSettingType.Slider && (sliderValue || value);
- {description &&
{description}
}
-
+ return (
+
+
+
{title}
-
- {type === SessionSettingType.Toggle && (
-
-
-
- )}
+ {description &&
{description}
}
+
- {type === SessionSettingType.Button && (
-
+ {type === SessionSettingType.Toggle && (
+
+ props.onClick?.()}
+ confirmationDialogParams={props.confirmationDialogParams}
/>
- )}
-
- {type === SessionSettingType.Options && (
- {
- this.props.onClick(selectedRadioValue);
- }}
+
+ )}
+
+ {type === SessionSettingType.Button && (
+ props.onClick?.()}
+ />
+ )}
+
+ {type === SessionSettingType.Options && (
+ {
+ props.onClick(selectedRadioValue);
+ }}
+ />
+ )}
+
+ {type === SessionSettingType.Slider && (
+
+
- )}
- {type === SessionSettingType.Slider && (
-
-
{
- this.handleSlider(sliderValue);
- }}
- />
-
-
-
{content.info(currentSliderValue)}
-
+
+
{content.info(currentSliderValue)}
- )}
-
+
+ )}
- );
- }
-
- private handleClick() {
- if (this.props.onClick) {
- this.props.onClick();
- }
- }
-
- private handleSlider(value: any) {
- if (this.props.onSliderChange) {
- this.props.onSliderChange(value);
- }
-
- this.setState({
- sliderValue: value,
- });
- }
-}
+
+ );
+};
diff --git a/ts/components/session/settings/SessionSettings.tsx b/ts/components/session/settings/SessionSettings.tsx
index d03453754..abcff8bb7 100644
--- a/ts/components/session/settings/SessionSettings.tsx
+++ b/ts/components/session/settings/SessionSettings.tsx
@@ -40,7 +40,6 @@ export interface SettingsViewProps {
// pass the conversation as props, so our render is called everytime they change.
// we have to do this to make the list refresh on unblock()
conversations?: ConversationLookupType;
- updateConfirmModal?: any;
}
interface State {
@@ -156,7 +155,6 @@ class SettingsViewInner extends React.Component
{
onSliderChange={sliderFn}
content={content}
confirmationDialogParams={setting.confirmationDialogParams}
- updateConfirmModal={this.props.updateConfirmModal}
/>
)}
diff --git a/ts/interactions/conversationInteractions.ts b/ts/interactions/conversationInteractions.ts
index ce9b35e1f..2aa01feef 100644
--- a/ts/interactions/conversationInteractions.ts
+++ b/ts/interactions/conversationInteractions.ts
@@ -36,6 +36,7 @@ import { getDecryptedMediaUrl } from '../session/crypto/DecryptedAttachmentsMana
import { IMAGE_JPEG } from '../types/MIME';
import { FSv2 } from '../fileserver';
import { fromBase64ToArray, toHex } from '../session/utils/String';
+import { SessionButtonColor } from '../components/session/SessionButton';
export const getCompleteUrlForV2ConvoId = async (convoId: string) => {
if (convoId.match(openGroupV2ConversationIdRegex)) {
@@ -219,8 +220,8 @@ export function showLeaveGroupByConvoId(conversationId: string) {
updateConfirmModal({
title,
message,
- onClickOk: () => {
- void conversation.leaveClosedGroup();
+ onClickOk: async () => {
+ await conversation.leaveClosedGroup();
onClickClose();
},
onClickClose,
@@ -302,8 +303,8 @@ export function deleteMessagesByConvoIdWithConfirmation(conversationId: string)
window?.inboxStore?.dispatch(updateConfirmModal(null));
};
- const onClickOk = () => {
- void deleteMessagesByConvoIdNoConfirmation(conversationId);
+ const onClickOk = async () => {
+ await deleteMessagesByConvoIdNoConfirmation(conversationId);
onClickClose();
};
@@ -312,6 +313,7 @@ export function deleteMessagesByConvoIdWithConfirmation(conversationId: string)
title: window.i18n('deleteMessages'),
message: window.i18n('deleteConversationConfirmation'),
onClickOk,
+ okTheme: SessionButtonColor.Danger,
onClickClose,
})
);
diff --git a/ts/interactions/messageInteractions.ts b/ts/interactions/messageInteractions.ts
index 8f7aabcaa..bfc21fbd0 100644
--- a/ts/interactions/messageInteractions.ts
+++ b/ts/interactions/messageInteractions.ts
@@ -173,7 +173,9 @@ const acceptOpenGroupInvitationV2 = (completeUrl: string, roomName?: string) =>
updateConfirmModal({
title: window.i18n('joinOpenGroupAfterInvitationConfirmationTitle', roomName),
message: window.i18n('joinOpenGroupAfterInvitationConfirmationDesc', roomName),
- onClickOk: () => joinOpenGroupV2WithUIEvents(completeUrl, true, false),
+ onClickOk: async () => {
+ await joinOpenGroupV2WithUIEvents(completeUrl, true, false);
+ },
onClickClose,
})
diff --git a/ts/models/message.ts b/ts/models/message.ts
index d86455acb..339058372 100644
--- a/ts/models/message.ts
+++ b/ts/models/message.ts
@@ -846,7 +846,7 @@ export class MessageModel extends Backbone.Model