You must not fly at any point if there is any residual gas in your eye. Once the gas has fully absorbed, then may fly.  It is safe to fly if you receive an oil bubble to reattach your retina. It is not advisable, however, to schedule any foreign travel for immediately after eye surgery, in particular retinal detachment surgery.