++

On 4/1/14, 9:42 AM, Miller Medeiros wrote:
> In apps/clock/js/panels/alarm/active_alarm.js:
>
>>          if (err) {
>>            done();
>>            return;
>>          }
>> +
>> +        this.popAlert({
>> +          type: 'alarm',
>> +          label: alarm.label,
>> +          sound: alarm.sound,
>> +          vibrate: (alarm.vibrate && alarm.vibrate !== '0'),
>> +          time: date,
>> +          id: alarm.id
>> +        });
>> +
>> +        var afterSave = () => {
>> +          window.dispatchEvent(new CustomEvent('alarm-changed', {
>> +            detail: { alarm: alarm }
>> +          }));
>> +          AlarmManager.updateAlarmStatusBar();
>
> it looks like every single time you dispatch |alarm-changed| the
> |AlarmManager.updateAlarmStatusBar()| also needs to be called.. so why
> not remove the dependency on |AlarmManager| on this module and simply
> listen to the |alarm-changed| event?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/mozilla-b2g/gaia/pull/16746/files#r11168812>.
>