Last commit to fix final bugs

This commit is contained in:
Zach Fox 2017-01-04 14:33:02 -08:00
parent ac41e8abc4
commit 675159be45
2 changed files with 7 additions and 8 deletions

View file

@ -478,7 +478,7 @@ Item {
}
break;
case 'clearIgnored':
ignored = ({});
ignored = {};
break;
default:
console.log('Unrecognized message:', JSON.stringify(message));

View file

@ -332,15 +332,14 @@ button.clicked.connect(onClicked);
pal.visibleChanged.connect(onVisibleChanged);
pal.closed.connect(off);
Users.usernameFromIDReply.connect(usernameFromIDReply);
function clearIgnoredInQMLAndRefreshPAL() {
function clearIgnoredInQMLAndClosePAL() {
pal.sendToQml({ method: 'clearIgnored' });
if (pal.visible) {
removeOverlays();
Script.setTimeout(populateUserList, 200); // Short delay before populating the PAL to allow the HashMap to populate
onClicked(); // Close the PAL
}
}
Window.domainChanged.connect(clearIgnoredInQMLAndRefreshPAL);
Window.domainConnectionRefused.connect(clearIgnoredInQMLAndRefreshPAL);
Window.domainChanged.connect(clearIgnoredInQMLAndClosePAL);
Window.domainConnectionRefused.connect(clearIgnoredInQMLAndClosePAL);
//
// Cleanup.
@ -351,8 +350,8 @@ Script.scriptEnding.connect(function () {
pal.visibleChanged.disconnect(onVisibleChanged);
pal.closed.disconnect(off);
Users.usernameFromIDReply.disconnect(usernameFromIDReply);
Window.domainChanged.disconnect(clearIgnoredInQMLAndRefreshPAL);
Window.domainConnectionRefused.disconnect(clearIgnoredInQMLAndRefreshPAL);
Window.domainChanged.disconnect(clearIgnoredInQMLAndClosePAL);
Window.domainConnectionRefused.disconnect(clearIgnoredInQMLAndClosePAL);
off();
});