The stream is attached before the video type change event is fired, so comparing them is too late. Unconditionally update the screen-sharing indicator, and perform the check for a change right there, to avoid re-renders.