Add no-misused/floating-promises lint rule
This commit is contained in:
parent
1a68c3db62
commit
ed271d92ea
150 changed files with 1296 additions and 991 deletions
|
@ -14,7 +14,7 @@ import { Button, ButtonVariant } from '../Button';
|
|||
|
||||
export type OwnProps = {
|
||||
readonly onClose?: () => unknown;
|
||||
readonly closeStickerPackPreview: (packId: string) => unknown;
|
||||
readonly closeStickerPackPreview: () => unknown;
|
||||
readonly downloadStickerPack: (
|
||||
packId: string,
|
||||
packKey: string,
|
||||
|
@ -107,9 +107,18 @@ export const StickerPreviewModal = React.memo(function StickerPreviewModalInner(
|
|||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (pack) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Pack fully uninstalled, don't keep the modal open
|
||||
closeStickerPackPreview();
|
||||
}, [pack, closeStickerPackPreview]);
|
||||
|
||||
const handleClose = React.useCallback(() => {
|
||||
if (pack?.id) {
|
||||
closeStickerPackPreview(pack.id);
|
||||
if (pack) {
|
||||
closeStickerPackPreview();
|
||||
}
|
||||
onClose?.();
|
||||
}, [closeStickerPackPreview, onClose, pack]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue