From 0a47efdbd5cae7c9a260b1c6c5b09bc1c082c521 Mon Sep 17 00:00:00 2001 From: sidneys Date: Thu, 19 Jan 2017 10:12:11 +0100 Subject: [PATCH] v3.2.1 --- app/scripts/renderer/inject.js | 19 ++++++++++++++----- package.json | 6 +++--- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/app/scripts/renderer/inject.js b/app/scripts/renderer/inject.js index 638a1faa..74c91f7c 100644 --- a/app/scripts/renderer/inject.js +++ b/app/scripts/renderer/inject.js @@ -134,21 +134,30 @@ let registerPushProxyobject = () => { let pushExists = Boolean(window.pb.api.pushes.all.filter(function(push) { return push.iden === newPush.iden; }).length); if (pushExists) { return false; } - // Check if push is targeted to specific device id + // Default: Show push let appIsTarget = true; - let devicesObjs = window.pb.api.devices.objs; - let targetIden = newPush.target_device_iden; - if (targetIden && devicesObjs[targetIden]) { - if (devicesObjs[targetIden].model && (devicesObjs[targetIden].model !== 'pb-for-desktop')) { + + // Check if push is targeted to specific device + let currentDevicesObjs = window.pb.api.devices.objs; + let targetDeviceIden = newPush.target_device_iden; + if (targetDeviceIden && currentDevicesObjs[targetDeviceIden]) { + if (currentDevicesObjs[targetDeviceIden].model && (currentDevicesObjs[targetDeviceIden].model !== 'pb-for-desktop')) { appIsTarget = false; } } + // Check if push is directed + let targetDirection = newPush.direction; + if (targetDirection && targetDirection === 'outgoing') { + appIsTarget = false; + } + if (appIsTarget) { pbPush.enqueuePush(newPush); } pushesObj[iden] = newPush; logger.debug('inject', 'proxy', 'iden', iden, 'appIsTarget', appIsTarget, 'pushExists', pushExists); + logger.debug('inject', newPush); } }); diff --git a/package.json b/package.json index 40b661e3..1c1ce046 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pb-for-desktop", "productName": "PB for Desktop", - "version": "3.2.0", + "version": "3.2.1", "description": "PushBullet desktop application for macOS, Windows and Linux", "license": "MIT", "homepage": "https://sidneys.github.io/pb-for-desktop", @@ -57,8 +57,8 @@ "electron-editor-context-menu": "^1.1.1", "electron-settings": "^2.2.2", "electron-squirrel-startup": "^1.0.0", - "file-type": "^4.0.0", - "file-url": "^2.0.0", + "file-type": "^4.1.0", + "file-url": "^2.0.1", "fs-extra": "^2.0.0", "is-online": "^6.0.1", "keypath": "^0.0.1",