Extended fetchConfValue with callbacks

This commit is contained in:
Patrick Melanson 2016-07-18 21:33:27 -04:00
parent 6149aa8a07
commit 37ba46d379

View file

@ -320,7 +320,7 @@ weechat.factory('connection',
}); });
}; };
var fetchConfValue = function(name) { var fetchConfValue = function(name, callback) {
ngWebsockets.send( ngWebsockets.send(
weeChat.Protocol.formatInfolist({ weeChat.Protocol.formatInfolist({
name: "option", name: "option",
@ -329,6 +329,9 @@ weechat.factory('connection',
}) })
).then(function(i) { ).then(function(i) {
handlers.handleConfValue(i); handlers.handleConfValue(i);
if (callback !== undefined) {
callback();
}
}); });
}; };