I would probably do `var type = this.alert.type` outside the `switch` and since it only handles `alarm` or `timer` I would even just do `var isTimer = this.alert.type === 'timer'` and use a regular `else` (no need for `else if` if only 2 possible cases)...

In fact I would probably create separate methods for each action as well since I don't like to strings that much (because of typos + tabcomplete) and I avoid `switch` when possible... - but in this case since we have the `visibilityChangeReason` and won't be calling this method from multiple places I think the string + switch is OK.