diff --git a/js/pacosako_ui.js b/js/pacosako_ui.js index bc90192..6f43495 100644 --- a/js/pacosako_ui.js +++ b/js/pacosako_ui.js @@ -10,19 +10,17 @@ $(function (){ peers: ['https://jessemcdonald.info/gun'], }); - gun._.on('in', function(msg) { - if (window.logGunIn && - (typeof window.logGunIn !== 'function' || - window.logGunIn(msg))) + gun.on('in', function(msg) { + const filter = window.logGunIn; + if (filter && ((typeof filter !== 'function') || filter(msg))) { console.log('in msg: ', msg); } }); - gun._.on('out', function(msg) { - if (window.logGunOut && - (typeof window.logGunOut !== 'function' || - window.logGunOut(msg))) + gun.on('out', function(msg) { + const filter = window.logGunOut; + if (filter && ((typeof filter !== 'function') || filter(msg))) { console.log('out msg: ', msg); }