If they lay eggs only once, this fact could help in eradicating them. If one has an extra pot of soil without a plant in it and waters this one day before watering the plants, then this pot may be targeted first for laying eggs. The next day the potted plants can be watered with less chance of having eggs laid in them. The plantless pot of soil could be thrown out every week along with the fresh eggs thereby avoiding a generation of gnats.
This requires that you water your plants infrequently so that the soil in the planted pots are not attractive to the gnats.
Would this work?