Commit 4c15b7fa authored by Adrien Dorsaz's avatar Adrien Dorsaz

chrome: add listener to panel, so background script can refresh opened panels

parent 1dad9d7a
......@@ -68,4 +68,16 @@ for (let key = 0; key < connectButtons.length; key++) {
connectButtons[key].onclick = sendConnect;
}
let panelListener = function(message, sender, sendRepsone) {
let asynchroneResponse = false;
if (message == "refreshNetwork") {
// TODO: Update network panel if it's the current one
}
return asynchroneResponse;
}
chrome.runtime.onMessage.addListener(panelListener)
chrome.runtime.sendMessage('isConfigured', displayFirstRun);
......@@ -52,7 +52,7 @@ retrieveConfig = function () {
var xmppPaneClient = null;
xmppPaneMessageListener = function (message, sender, sendResponse) {
xmppClientListener = function (message, sender, sendResponse) {
let asynchroneResponse = false;
switch (message) {
......@@ -139,4 +139,4 @@ xmppPaneMessageListener = function (message, sender, sendResponse) {
}
}
chrome.runtime.onMessage.addListener(xmppPaneMessageListener)
chrome.runtime.onMessage.addListener(xmppClientListener)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment