{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/32379","labels_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/32379/labels{/name}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/32379/comments","events_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/32379/events","html_url":"https://github.com/mozilla-b2g/gaia/pull/32379","id":110756849,"number":32379,"title":"Bug 942837 - [User Story] Show Alarm Time on Lock Screen R=prateekjadhwani","user":{"login":"prateekjadhwani","id":2219900,"avatar_url":"https://avatars.githubusercontent.com/u/2219900?v=3","gravatar_id":"","url":"https://api.github.com/users/prateekjadhwani","html_url":"https://github.com/prateekjadhwani","followers_url":"https://api.github.com/users/prateekjadhwani/followers","following_url":"https://api.github.com/users/prateekjadhwani/following{/other_user}","gists_url":"https://api.github.com/users/prateekjadhwani/gists{/gist_id}","starred_url":"https://api.github.com/users/prateekjadhwani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prateekjadhwani/subscriptions","organizations_url":"https://api.github.com/users/prateekjadhwani/orgs","repos_url":"https://api.github.com/users/prateekjadhwani/repos","events_url":"https://api.github.com/users/prateekjadhwani/events{/privacy}","received_events_url":"https://api.github.com/users/prateekjadhwani/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-10-10T00:38:11Z","updated_at":"2015-11-02T02:55:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32379","html_url":"https://github.com/mozilla-b2g/gaia/pull/32379","diff_url":"https://github.com/mozilla-b2g/gaia/pull/32379.diff","patch_url":"https://github.com/mozilla-b2g/gaia/pull/32379.patch"},"body":"User Story:\r\n\r\nAs a user I want to view the time of my next alarm while my phone is locked - this enables me to verify that it is set without needing to unlock my phone and navigate to the clock app.\r\n\r\nAcceptance Criteria:\r\n\r\n1. When my phone is locked (but not in sleep mode) I can see that my alarm is set, and the time and date of my next alarm.\r\n2. Only my next alarm is shown, for example if I have an alarm set for 8am every day I can only see tomorrows alarm.\r\n3. If my alarm is removed, It is no longer shown on the lock screen."},"comment":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/comments/152897263","html_url":"https://github.com/mozilla-b2g/gaia/pull/32379#issuecomment-152897263","issue_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/32379","id":152897263,"user":{"login":"snowmantw","id":129153,"avatar_url":"https://avatars.githubusercontent.com/u/129153?v=3","gravatar_id":"","url":"https://api.github.com/users/snowmantw","html_url":"https://github.com/snowmantw","followers_url":"https://api.github.com/users/snowmantw/followers","following_url":"https://api.github.com/users/snowmantw/following{/other_user}","gists_url":"https://api.github.com/users/snowmantw/gists{/gist_id}","starred_url":"https://api.github.com/users/snowmantw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snowmantw/subscriptions","organizations_url":"https://api.github.com/users/snowmantw/orgs","repos_url":"https://api.github.com/users/snowmantw/repos","events_url":"https://api.github.com/users/snowmantw/events{/privacy}","received_events_url":"https://api.github.com/users/snowmantw/received_events","type":"User","site_admin":false},"created_at":"2015-11-02T02:55:18Z","updated_at":"2015-11-02T02:55:18Z","body":"Then you may use this tactic: \r\n\r\n    navigator.getDataStores('alarms')\r\n    .then((stores) => {\r\n      return [stores[0].getLength(),\r\n                 stores[0]];\r\n    }).then(([len, store]) => {\r\n        if (0 === len) { return; }\r\n        // others\r\n        return store.get(1);\r\n    }).then((fetchedData) => {\r\n        // do data handling\r\n    })\r\n\r\nSince it's legit to destruct array in the parameter list. Namely, you can do this:\r\n\r\n   var f = ([a, b]) => a + b\r\n   f([1,2])    // 3\r\n\r\nAlthough I think the real issue is we need to do two asynchronous queries before we perform the data handling, but since it's somewhat API issue so let's give a nice and quick fix. If you have other concerns please comment it here, thanks."}}