Once you measure that an electron has passed through one of the slits the probability of that path is 1 and the probability of the other is 0, so there will be no interference between the two of them. Then we will not observe an interference pattters, but just two lines or maxima.