From 54e4f6252308e3bb340d768803a85c66890756f2 Mon Sep 17 00:00:00 2001 From: Paul de Vries Date: Sun, 9 Sep 2018 17:54:18 +0000 Subject: [PATCH] :art: Only show errors on touchscreen --- octoprint_touchui/static/js/touchui.bootstrap.js | 2 +- source/js/bootstrap.js | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/octoprint_touchui/static/js/touchui.bootstrap.js b/octoprint_touchui/static/js/touchui.bootstrap.js index 7ff82d4f..8dad0d3b 100644 --- a/octoprint_touchui/static/js/touchui.bootstrap.js +++ b/octoprint_touchui/static/js/touchui.bootstrap.js @@ -1 +1 @@ -!function(){if(window.log&&window.log.error){var o=window.log.error;window.log.error=function(n,w){window.top.postMessage([w,""],"*"),o.apply(window.log,arguments)}}var n=new TouchUI;n.domLoading(),$(function(){n.domReady(),OCTOPRINT_VIEWMODELS.push([n.koStartup,n.TOUCHUI_REQUIRED_VIEWMODELS,n.TOUCHUI_ELEMENTS,n.TOUCHUI_REQUIRED_VIEWMODELS])})}(); \ No newline at end of file +!function(){if(TouchUI.prototype.settings.isChromiumArm&&window.log&&window.log.error){var o=window.log.error;window.log.error=function(n,r){window.top.postMessage([r,""],"*"),o.apply(window.log,arguments)}}var n=new TouchUI;n.domLoading(),$(function(){n.domReady(),OCTOPRINT_VIEWMODELS.push([n.koStartup,n.TOUCHUI_REQUIRED_VIEWMODELS,n.TOUCHUI_ELEMENTS,n.TOUCHUI_REQUIRED_VIEWMODELS])})}(); \ No newline at end of file diff --git a/source/js/bootstrap.js b/source/js/bootstrap.js index b9e544a3..0ba249c9 100644 --- a/source/js/bootstrap.js +++ b/source/js/bootstrap.js @@ -1,11 +1,13 @@ !function() { // Catch errors - if (window.log && window.log.error) { - var old = window.log.error; - window.log.error = function(plugin, msg) { - window.top.postMessage([msg, ''], "*"); - old.apply(window.log, arguments); + if (TouchUI.prototype.settings.isChromiumArm) { + if (window.log && window.log.error) { + var old = window.log.error; + window.log.error = function(plugin, msg) { + window.top.postMessage([msg, ''], "*"); + old.apply(window.log, arguments); + } } }