From 36c2756ca76d0de1f75826f73b0a1b03cebccd93 Mon Sep 17 00:00:00 2001 From: Johan Degraeve Date: Mon, 25 Jul 2022 23:28:48 +0200 Subject: [PATCH] suppress share cgm transmitter address with loop if 'Suppress Loop Share' is enabled. This is fix is only required if there's multiple instances of xDrip4iOS running on one device and if Loop is used --- .../BluetoothPeripheral/BluetoothPeripheralManager.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xdrip/Managers/BluetoothPeripheral/BluetoothPeripheralManager.swift b/xdrip/Managers/BluetoothPeripheral/BluetoothPeripheralManager.swift index 4bc83460..89b47147 100644 --- a/xdrip/Managers/BluetoothPeripheral/BluetoothPeripheralManager.swift +++ b/xdrip/Managers/BluetoothPeripheral/BluetoothPeripheralManager.swift @@ -49,8 +49,14 @@ class BluetoothPeripheralManager: NSObject { if newValue != currentCgmTransmitterAddress { cgmTransmitterInfoChanged() + + // share new address with loop, but not if suppressLoopShare is on + if !UserDefaults.standard.suppressLoopShare { + + setCGMTransmitterInSharedUserDefaults() + + } - setCGMTransmitterInSharedUserDefaults() }