From 6a38e809bc5c6ff1fe33a200a60a6771e00d17ac Mon Sep 17 00:00:00 2001 From: whales Date: Sun, 10 Mar 2019 01:57:44 +1030 Subject: [PATCH] Update nwjs API for later version (#1246) --- desktop/package.json | 2 +- js/client-topbar.js | 2 +- js/storage.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/desktop/package.json b/desktop/package.json index 9783e2c94..5035cab79 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -3,7 +3,7 @@ "version": "0.3.0", "main": "index.html", - "node-remote": "play.pokemonshowdown.com", + "node-remote": "*://play.pokemonshowdown.com/*", "no-edit-menu": false, "window": { "icon": "icons/icon_32x32.png", diff --git a/js/client-topbar.js b/js/client-topbar.js index 6b66fc1f7..a44fccbf0 100644 --- a/js/client-topbar.js +++ b/js/client-topbar.js @@ -147,7 +147,7 @@ sideBuf += this.renderRoomTab(room); } if (window.nodewebkit) { - if (nwWindow.setBadgeLabel) nwWindow.setBadgeLabel(notificationCount || ''); + if (nwWindow.setBadgeLabel) nwWindow.setBadgeLabel('' + notificationCount || ''); } else { var $favicon = $('#dynamic-favicon'); if (!!$favicon.data('on') !== !!notificationCount) { diff --git a/js/storage.js b/js/storage.js index 85e1596c2..1531f4505 100644 --- a/js/storage.js +++ b/js/storage.js @@ -1594,7 +1594,7 @@ Storage.nwSaveTeam = function (team) { this.nwDeleteTeam(team); } team.filename = filename; - fs.writeFile(this.dir + 'Teams/' + filename, Storage.exportTeam(team.team).replace(/\n/g, '\r\n')); + fs.writeFile(this.dir + 'Teams/' + filename, Storage.exportTeam(team.team).replace(/\n/g, '\r\n'), function () {}); }; Storage.nwSaveTeams = function () { @@ -1630,7 +1630,7 @@ Storage.nwDoSaveAllTeams = function () { filename = $.trim(filename).replace(/[\\\/]+/g, ''); team.filename = filename; - fs.writeFile(this.dir + 'Teams/' + filename, Storage.exportTeam(team.team).replace(/\n/g, '\r\n')); + fs.writeFile(this.dir + 'Teams/' + filename, Storage.exportTeam(team.team).replace(/\n/g, '\r\n'), function () {}); } };