When we add a sensor measuring which slit the electron passed through, the interference fringes disappear. The electron then behaves like a classical particle — we only see the sum of two diffraction patterns. This is because knowing the path, we cannot sum the amplitudes, we only sum the probabilities I(x)=|A_1|^2+|A_2|^2, interference only occurs when the paths are indistinguishable.