I remember reading that fungus gnats are a sign you're overwatering your houseplants. (Water uptake is correlated with photosynthesis, indoor plants don't get or usually need much light). I just did a quick internet search and it looks like the popular advice for fungus gnats is still the same - water less. It'll also prevent root rot.