Bar quenching in gas-rich galaxies