don't trigger warning when view is not visible

When a users switches from the author view to the student view, they
are prompted a warning and have to confirm the view switch. This
warning should not be shown if the author view isn't present any
more (this finally fixes #246).