cleanup announcement
This commit is contained in:
@@ -13,7 +13,10 @@ var ANNOUNCEMENT_URL = config.ANNOUNCEMENT_URL +
|
|||||||
'&platform=' + process.platform
|
'&platform=' + process.platform
|
||||||
|
|
||||||
function init () {
|
function init () {
|
||||||
get.concat(ANNOUNCEMENT_URL, function (err, res, data) {
|
get.concat(ANNOUNCEMENT_URL, onResponse)
|
||||||
|
}
|
||||||
|
|
||||||
|
function onResponse (err, res, data) {
|
||||||
if (err) return log('failed to retrieve remote message')
|
if (err) return log('failed to retrieve remote message')
|
||||||
if (res.statusCode !== 200) return log('no remote message')
|
if (res.statusCode !== 200) return log('no remote message')
|
||||||
|
|
||||||
@@ -22,7 +25,7 @@ function init () {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
data = {
|
data = {
|
||||||
title: 'WebTorrent Desktop Announcement',
|
title: 'WebTorrent Desktop Announcement',
|
||||||
message: 'WebTorrent Desktop Announcement',
|
message: 'Announcement',
|
||||||
detail: data.toString()
|
detail: data.toString()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -33,6 +36,7 @@ function init () {
|
|||||||
title: data.title,
|
title: data.title,
|
||||||
message: data.message,
|
message: data.message,
|
||||||
detail: data.detail
|
detail: data.detail
|
||||||
}, function () {})
|
}, noop)
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function noop () {}
|
||||||
|
|||||||
Reference in New Issue
Block a user