diff --git a/landing/investors.react.js b/landing/investors.react.js
--- a/landing/investors.react.js
+++ b/landing/investors.react.js
@@ -13,7 +13,9 @@
const { pushModal } = useModalContext();
const onClickInvestorProfileCard = React.useCallback(
- (id: string) => pushModal(),
+ (id: string) => {
+ pushModal();
+ },
[pushModal],
);
diff --git a/lib/components/modal-provider.react.js b/lib/components/modal-provider.react.js
--- a/lib/components/modal-provider.react.js
+++ b/lib/components/modal-provider.react.js
@@ -10,7 +10,7 @@
};
type ModalContextType = {
+modals: $ReadOnlyArray<[React.Node, string]>,
- +pushModal: React.Node => void,
+ +pushModal: React.Node => string,
+popModal: () => void,
+clearModals: () => void,
};
@@ -18,7 +18,7 @@
const ModalContext: React.Context = React.createContext(
{
modals: [],
- pushModal: () => {},
+ pushModal: () => '',
popModal: () => {},
clearModals: () => {},
},
@@ -36,6 +36,7 @@
const pushModal = React.useCallback(newModal => {
const key = getUUID();
setModals(oldModals => [...oldModals, [newModal, key]]);
+ return key;
}, []);
const clearModals = React.useCallback(() => setModals([]), []);
diff --git a/web/calendar/day.react.js b/web/calendar/day.react.js
--- a/web/calendar/day.react.js
+++ b/web/calendar/day.react.js
@@ -45,7 +45,7 @@
+nextLocalID: number,
+timeZone: ?string,
+dispatch: Dispatch,
- +pushModal: (modal: React.Node) => void,
+ +pushModal: (modal: React.Node) => string,
+popModal: () => void,
};
type State = {
diff --git a/web/calendar/entry.react.js b/web/calendar/entry.react.js
--- a/web/calendar/entry.react.js
+++ b/web/calendar/entry.react.js
@@ -68,7 +68,7 @@
+createEntry: (info: CreateEntryInfo) => Promise,
+saveEntry: (info: SaveEntryInfo) => Promise,
+deleteEntry: (info: DeleteEntryInfo) => Promise,
- +pushModal: (modal: React.Node) => void,
+ +pushModal: (modal: React.Node) => string,
+popModal: () => void,
};
type State = {
diff --git a/web/calendar/filter-panel.react.js b/web/calendar/filter-panel.react.js
--- a/web/calendar/filter-panel.react.js
+++ b/web/calendar/filter-panel.react.js
@@ -42,7 +42,7 @@
+filteredThreadIDs: ?$ReadOnlySet,
+includeDeleted: boolean,
+dispatch: Dispatch,
- +pushModal: (modal: React.Node) => void,
+ +pushModal: (modal: React.Node) => string,
};
type State = {
+query: string,
diff --git a/web/input/input-state-container.react.js b/web/input/input-state-container.react.js
--- a/web/input/input-state-container.react.js
+++ b/web/input/input-state-container.react.js
@@ -110,7 +110,7 @@
text: string,
) => Promise,
+newThread: (request: ClientNewThreadRequest) => Promise,
- +pushModal: (modal: React.Node) => void,
+ +pushModal: (modal: React.Node) => string,
+sendCallbacks: $ReadOnlyArray<() => mixed>,
+registerSendCallback: (() => mixed) => void,
+unregisterSendCallback: (() => mixed) => void,
diff --git a/web/media/multimedia.react.js b/web/media/multimedia.react.js
--- a/web/media/multimedia.react.js
+++ b/web/media/multimedia.react.js
@@ -28,7 +28,7 @@
};
type Props = {
...BaseProps,
- +pushModal: (modal: React.Node) => void,
+ +pushModal: (modal: React.Node) => string,
};
class Multimedia extends React.PureComponent {
diff --git a/web/modals/account/log-in-first-modal.react.js b/web/modals/account/log-in-first-modal.react.js
--- a/web/modals/account/log-in-first-modal.react.js
+++ b/web/modals/account/log-in-first-modal.react.js
@@ -14,7 +14,7 @@
type Props = {
...BaseProps,
- +pushModal: (modal: React.Node) => void,
+ +pushModal: (modal: React.Node) => string,
+popModal: () => void,
};
diff --git a/web/settings/relationship/block-list-modal.react.js b/web/settings/relationship/block-list-modal.react.js
--- a/web/settings/relationship/block-list-modal.react.js
+++ b/web/settings/relationship/block-list-modal.react.js
@@ -29,10 +29,9 @@
const { onClose } = props;
const { pushModal } = useModalContext();
- const openBlockUsersModal = React.useCallback(
- () => pushModal(),
- [onClose, pushModal],
- );
+ const openBlockUsersModal = React.useCallback(() => {
+ pushModal();
+ }, [onClose, pushModal]);
return (
pushModal(),
- [onClose, pushModal],
- );
+ const openNewFriendsModal = React.useCallback(() => {
+ pushModal();
+ }, [onClose, pushModal]);
return (