Samsung phones are well known for false battery notification even if you are using it Sahara desert(Bad joke)
look at this guide [guide|114827|here].
Still, you can try the steps here if the guide doesn't work,
The moisture has been detected here error is not always triggered due to the water or sweat but a low voltage supply can also trigger your Samsung to show the pop-up while charging.
* Method 1- Check Samsung For Possible Water Damage
* Method 2- Turn off mobile and try charging the mobile.
* Method 3- Restart Phone While on Charge
* Method 4- Restart Samsung in Safe Mode
Read here: [link|https://fixyourandroid.com/fix/moisture-has-been-detected-samsung-s-and-a-series/|https://fixyourandroid.com/fix/moisture-has-been-detected-samsung-s-and-a-series/]