Hey man, you can simply hang the traps somewhere near the pot in the air for the time being and place them back on the soil of possible again.
Also personal recommendation: if you have fungus gnats try to get some sf-nematodes. It's like 5$ a pack and they are an organic and very helpful way of getting rid of gnats by killing larvae. Worked like a charm for me when I used them!
Cheers