forked from mcomella/is-it-in-nightly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
29 lines (26 loc) · 1001 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
var ChangesetForm = require('./lib/ui/changesetform').ChangesetForm,
mozhg = require('./lib/mozhg'),
React = require('react'), // Used by reactify.
ReactDOM = require('react-dom');
// TODO: Validate changeset.
var isItOnNightly = function (changesetToVerifyId, callback) {
mozhg.getLatestNightlyChangesetId((err, latestNightlyChangesetId) => {
if (err) {
callback(err, null, changesetToVerifyId);
return;
}
// TODO: It's slow if the answer is false.
mozhg.isRevisionSetValid(changesetToVerifyId, latestNightlyChangesetId, (err, valid) => {
if (err) {
callback(err, null, changesetToVerifyId);
return;
}
console.log('%s is in Nightly: %s', changesetToVerifyId, valid);
callback(null, valid, changesetToVerifyId);
});
});
}
ReactDOM.render(
<ChangesetForm callback={isItOnNightly} />,
document.getElementById('form_content')
);