浏览代码

Fix watch carb entry propagation
* Add isUploadedToHealth flag
* Add isUploadedToTidepool flag
* Fixes issues where carb entries from Apple Watch were no propagated to third party services
* Addresses #948

Co-Authored-By: Maria Ypma <99215346+snickerdoodleparent@users.noreply.github.com>

Deniz Cengiz 3 月之前
父节点
当前提交
13a3883373
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      Trio/Sources/Services/WatchManager/AppleWatchManager.swift

+ 4 - 0
Trio/Sources/Services/WatchManager/AppleWatchManager.swift

@@ -740,6 +740,8 @@ final class BaseWatchManager: NSObject, WCSessionDelegate, Injectable, WatchMana
                 carbEntry.note = String(localized: "Via Watch", comment: "Note added to carb entry when entered via watch")
                 carbEntry.note = String(localized: "Via Watch", comment: "Note added to carb entry when entered via watch")
                 carbEntry.isFPU = false // set this to false to ensure watch-entered carbs are displayed in main chart
                 carbEntry.isFPU = false // set this to false to ensure watch-entered carbs are displayed in main chart
                 carbEntry.isUploadedToNS = false
                 carbEntry.isUploadedToNS = false
+                carbEntry.isUploadedToHealth = false
+                carbEntry.isUploadedToTidepool = false
 
 
                 do {
                 do {
                     guard context.hasChanges else {
                     guard context.hasChanges else {
@@ -802,6 +804,8 @@ final class BaseWatchManager: NSObject, WCSessionDelegate, Injectable, WatchMana
                     carbEntry.note = String(localized: "Via Watch", comment: "Note added to carb entry when entered via watch")
                     carbEntry.note = String(localized: "Via Watch", comment: "Note added to carb entry when entered via watch")
                     carbEntry.isFPU = false // set this to false to ensure watch-entered carbs are displayed in main chart
                     carbEntry.isFPU = false // set this to false to ensure watch-entered carbs are displayed in main chart
                     carbEntry.isUploadedToNS = false
                     carbEntry.isUploadedToNS = false
+                    carbEntry.isUploadedToHealth = false
+                    carbEntry.isUploadedToTidepool = false
 
 
                     guard context.hasChanges else {
                     guard context.hasChanges else {
                         // Acknowledge failure
                         // Acknowledge failure