Add state validation to onImageSwiped function
| @@ -4500,6 +4500,10 @@ async function generateMediaSwipe(mediaAttachment, message, onStart, onComplete, | ||
| 4500 | 4500 | async function onImageSwiped({ message, element, direction }) { |
| 4501 | 4501 | const { powerUserSettings, accountStorage } = getContext(); |
| 4502 | 4502 | |
| 4503 | + if (!isValidState()) { | |
| 4504 | + return; | |
| 4505 | + } | |
| 4506 | + | |
| 4503 | 4507 | if (!message || direction !== SWIPE_DIRECTION.RIGHT || powerUserSettings.image_overswipe !== IMAGE_OVERSWIPE.GENERATE) { |
| 4504 | 4508 | return; |
| 4505 | 4509 | } |