Jer 18:8,10
If that nation, against whom I have pronounced, turn from their evil, I will repent of the evil that I thought to do unto them.
If it do evil in my sight, that it obey not my voice, then I will repent of the good, wherewith I said I would benefit them.
Here, God has a predetermined course of action depending if man obeys God or not. If man will not obey then God's predetermined course of action is show no mercy. But if man obeys God's predetermined course of action is to show mercy.
For example, Nineveh was a wicked city so God's predetermined course of action towards disobedient wicked people is show no mercy, hence God sent Jonah with the message that in 40 days the city would be overthrown. Yet Nineveh repented, they turned from their evil and Jer 18:8 shows God's predetermined course of action to those who obey is to show mercy. Jonah 3:10 says "God repented" which does not mean God changed His mind but changed His predetermined course of action from showing no mercy to the disobedient to showing mercy to those who obey by repenting turning from their wickedness.