if mode !== edit return false
this would allow you not to indent the all block and have a much smaller diff, and be more readable.