God intended on destroying Nineveh. But God is also full of grace. If Nineveh repented, God would repent. See Jeremiah 18. This is the mind of God.
7 At what instant I shall speak concerning a nation, and concerning a kingdom, to pluck up, and to pull down, and to destroy it;
8 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.
9 And at what instant I shall speak concerning a nation, and concerning a kingdom, to build and to plant it;
10 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.
God spoke concerning the city of Nineveh. Nineveh repented. God repented in return. Scripture is full of if...then...statements. Why? Because God has given man a choice when confronted with the word of God.