From f023c5d8fe1fde32814f8daba027923ceab7aba7 Mon Sep 17 00:00:00 2001 From: libccy Date: Sat, 15 Apr 2017 19:51:12 +0800 Subject: [PATCH] in --- game/game.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/game/game.js b/game/game.js index 3d8b89c71..29979dcf7 100644 --- a/game/game.js +++ b/game/game.js @@ -118,12 +118,15 @@ onclick:function(bool){ game.saveConfig('keep_awake',bool); if(window.plugins&&window.plugins.insomnia){ - if(bool){ - window.plugins.insomnia.keepAwake(); - } - else{ - window.plugins.insomnia.allowSleepAgain(); + try{ + if(bool){ + window.plugins.insomnia.keepAwake(); + } + else{ + window.plugins.insomnia.allowSleepAgain(); + } } + catch(e){} } } }, @@ -34573,7 +34576,10 @@ document.body.classList.add('statusbar'); } if(lib.config.keep_awake&&window.plugins&&window.plugis.insomnia){ - window.plugins.insomnia.keepAwake(); + try{ + window.plugins.insomnia.keepAwake(); + } + catch(e){} } // var themeentry='background_color_'+lib.config.theme; // if(lib.config[themeentry]){