+
);
}
diff --git a/ts/components/stickers/StickerManagerPackRow.tsx b/ts/components/stickers/StickerManagerPackRow.tsx
index 61f52e0ba..eb1642c8d 100644
--- a/ts/components/stickers/StickerManagerPackRow.tsx
+++ b/ts/components/stickers/StickerManagerPackRow.tsx
@@ -3,7 +3,7 @@
import * as React from 'react';
import { StickerPackInstallButton } from './StickerPackInstallButton';
-import { ConfirmationModal } from '../ConfirmationModal';
+import { ConfirmationDialog } from '../ConfirmationDialog';
import { LocalizerType } from '../../types/Util';
import { StickerPackType } from '../../state/ducks/stickers';
@@ -91,7 +91,7 @@ export const StickerManagerPackRow = React.memo(
return (
<>
{uninstalling ? (
-
{i18n('stickers--StickerManager--UninstallWarning')}
-
+
) : null}
{
}
uninstallStickerPack(pack.id, pack.key);
setConfirmingUninstall(false);
- // onClose is called by the confirmation modal
+ // onClose is called by
}, [uninstallStickerPack, setConfirmingUninstall, pack]);
React.useEffect(() => {
diff --git a/ts/shims/showConfirmationDialog.tsx b/ts/shims/showConfirmationDialog.tsx
index 89a62b0c7..5b55e87d6 100644
--- a/ts/shims/showConfirmationDialog.tsx
+++ b/ts/shims/showConfirmationDialog.tsx
@@ -3,7 +3,7 @@
// This file is here temporarily while we're switching off of Backbone into
// React. In the future, and in React-land, please just import and use
-// ConfirmationModal directly. This is the thin API layer to bridge the gap
+// ConfirmationDialog directly. This is the thin API layer to bridge the gap
// while we convert things over. Please delete this file once all usages are
// ported over. Note: this file cannot have any imports/exports since it is
// being included in a tag.
@@ -49,11 +49,10 @@ function showConfirmationDialog(options: ConfirmationDialogViewProps) {
window.ReactDOM.render(
// eslint-disable-next-line react/react-in-jsx-scope, react/jsx-no-undef
- {
- removeConfirmationDialog();
options.resolve();
},
style: options.confirmStyle,
@@ -62,11 +61,13 @@ function showConfirmationDialog(options: ConfirmationDialogViewProps) {
]}
cancelText={options.cancelText || window.i18n('cancel')}
i18n={window.i18n}
+ onCancel={() => {
+ if (options.reject) {
+ options.reject(new Error('showConfirmationDialog: onCancel called'));
+ }
+ }}
onClose={() => {
removeConfirmationDialog();
- if (options.reject) {
- options.reject(new Error('showConfirmationDialog: onClose called'));
- }
}}
title={options.message}
/>,
diff --git a/ts/util/lint/exceptions.json b/ts/util/lint/exceptions.json
index 74d72b4aa..1442b8a2f 100644
--- a/ts/util/lint/exceptions.json
+++ b/ts/util/lint/exceptions.json
@@ -16433,7 +16433,7 @@
"rule": "React-createRef",
"path": "ts/components/SafetyNumberChangeDialog.js",
"line": " const cancelButtonRef = React.createRef();",
- "lineNumber": 30,
+ "lineNumber": 33,
"reasonCategory": "usageTrusted",
"updated": "2020-06-23T06:48:06.829Z",
"reasonDetail": "Used to focus cancel button when dialog opens"
@@ -17055,4 +17055,4 @@
"updated": "2021-01-08T15:46:32.143Z",
"reasonDetail": "Doesn't manipulate the DOM. This is just a function."
}
-]
\ No newline at end of file
+]
diff --git a/ts/window.d.ts b/ts/window.d.ts
index cdf45d908..9ecdda9fc 100644
--- a/ts/window.d.ts
+++ b/ts/window.d.ts
@@ -81,7 +81,7 @@ import { combineNames } from './util';
import { BatcherType } from './util/batcher';
import { AttachmentList } from './components/conversation/AttachmentList';
import { CaptionEditor } from './components/CaptionEditor';
-import { ConfirmationModal } from './components/ConfirmationModal';
+import { ConfirmationDialog } from './components/ConfirmationDialog';
import { ContactDetail } from './components/conversation/ContactDetail';
import { ContactModal } from './components/conversation/ContactModal';
import { ErrorModal } from './components/ErrorModal';
@@ -460,7 +460,7 @@ declare global {
Components: {
AttachmentList: typeof AttachmentList;
CaptionEditor: typeof CaptionEditor;
- ConfirmationModal: typeof ConfirmationModal;
+ ConfirmationDialog: typeof ConfirmationDialog;
ContactDetail: typeof ContactDetail;
ContactModal: typeof ContactModal;
ErrorModal: typeof ErrorModal;