mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
tweak(phone/utils): Refactored image validation to promise from cb
This commit is contained in:
1 parent
e330b89889
commit
18c1676c01
2 files changed
+16
-12
No files matched your search
@@ -4,8 +4,7 @@ import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
import Nui from '../../../os/nui-events/utils/Nui';
|
||||
import Modal from '../../../ui/components/Modal';
|
||||
import { IMAGE_DELIMITER } from '../utils/images';
|
||||
import { withValidImage } from '../utils/images';
|
||||
import { IMAGE_DELIMITER, isImageValid } from '../utils/images';
|
||||
import { useModal } from '../hooks/useModal';
|
||||
import EmojiSelect from './EmojiSelect';
|
||||
import ImageDisplay from './images/ImageDisplay';
|
||||
@@ -129,7 +128,9 @@ export const AddTweetModal = () => {
|
||||
// other users see this image on their TweetList it will be
|
||||
// from the database and should already have passed through
|
||||
// this logic
|
||||
withValidImage(cleanedLink, () => setImages([...images, image]));
|
||||
isImageValid(cleanedLink)
|
||||
.then(() => setImages([...images, image]))
|
||||
.catch((e) => console.error(e));
|
||||
|
||||
setShowImagePrompt(false);
|
||||
setLink('');
|
||||
|
||||
Reference in new issue
Block a user