factor out common notif state toggle code
avoid automatic semicolon insertion