Skip to content

Commit

Permalink
Merge pull request #1597 from ruuvi/alpha
Browse files Browse the repository at this point in the history
v2.3.0 RC
  • Loading branch information
priyonto authored Aug 15, 2023
2 parents 0a409f6 + 9dcd085 commit 2b686b8
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 19 deletions.
28 changes: 14 additions & 14 deletions station.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -4803,7 +4803,7 @@
mainGroup = 64333D1C20B0C45900CDF4B6;
packageReferences = (
0EE36EAD269DC70E0021B746 /* XCRemoteSwiftPackageReference "swift-algorithms" */,
0EE36EB2269DC7D90021B746 /* XCRemoteSwiftPackageReference "Charts.git" */,
0EE36EB2269DC7D90021B746 /* XCRemoteSwiftPackageReference "Charts" */,
);
productRefGroup = 64333D2620B0C45900CDF4B6 /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -6369,7 +6369,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 396;
CURRENT_PROJECT_VERSION = 398;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 4MUYJ4YYH4;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4;
Expand Down Expand Up @@ -6401,7 +6401,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 396;
CURRENT_PROJECT_VERSION = 398;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 4MUYJ4YYH4;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4;
Expand Down Expand Up @@ -6433,7 +6433,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 396;
CURRENT_PROJECT_VERSION = 398;
DEVELOPMENT_TEAM = 4MUYJ4YYH4;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -6470,7 +6470,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 396;
CURRENT_PROJECT_VERSION = 398;
DEVELOPMENT_TEAM = 4MUYJ4YYH4;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -6505,7 +6505,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 396;
CURRENT_PROJECT_VERSION = 398;
DEVELOPMENT_TEAM = 4MUYJ4YYH4;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -6541,7 +6541,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 396;
CURRENT_PROJECT_VERSION = 398;
DEVELOPMENT_TEAM = 4MUYJ4YYH4;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -6693,7 +6693,7 @@
CODE_SIGN_ENTITLEMENTS = station/station.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 396;
CURRENT_PROJECT_VERSION = 398;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 4MUYJ4YYH4;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4;
Expand Down Expand Up @@ -6755,7 +6755,7 @@
CODE_SIGN_ENTITLEMENTS = station/station.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 396;
CURRENT_PROJECT_VERSION = 398;
DEVELOPMENT_TEAM = 4MUYJ4YYH4;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4;
INFOPLIST_FILE = "$(SRCROOT)/station/Resources/Plists/Info.plist";
Expand Down Expand Up @@ -6869,7 +6869,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 396;
CURRENT_PROJECT_VERSION = 398;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -6904,7 +6904,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 396;
CURRENT_PROJECT_VERSION = 398;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 4MUYJ4YYH4;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -7016,7 +7016,7 @@
minimumVersion = 1.0.0;
};
};
0EE36EB2269DC7D90021B746 /* XCRemoteSwiftPackageReference "Charts.git" */ = {
0EE36EB2269DC7D90021B746 /* XCRemoteSwiftPackageReference "Charts" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/danielgindi/Charts.git";
requirement = {
Expand All @@ -7039,12 +7039,12 @@
};
0EE36EB3269DC7D90021B746 /* Charts */ = {
isa = XCSwiftPackageProductDependency;
package = 0EE36EB2269DC7D90021B746 /* XCRemoteSwiftPackageReference "Charts.git" */;
package = 0EE36EB2269DC7D90021B746 /* XCRemoteSwiftPackageReference "Charts" */;
productName = Charts;
};
0EE36EB5269DC7E40021B746 /* Charts */ = {
isa = XCSwiftPackageProductDependency;
package = 0EE36EB2269DC7D90021B746 /* XCRemoteSwiftPackageReference "Charts.git" */;
package = 0EE36EB2269DC7D90021B746 /* XCRemoteSwiftPackageReference "Charts" */;
productName = Charts;
};
/* End XCSwiftPackageProductDependency section */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class TagChartsViewInteractor {
private let maximumPointsCount: Double = 3000.0
private let minimumDownsampleThreshold: Int = 1000

private var gattSyncInterruptedByUser: Bool = false

deinit {
ruuviTagSensorObservationToken?.invalidate()
ruuviTagSensorObservationToken = nil
Expand Down Expand Up @@ -163,7 +165,10 @@ extension TagChartsViewInteractor: TagChartsViewInteractorInput {
connectionTimeout: connectionTimeout,
serviceTimeout: serviceTimeout)
op.on(success: { [weak self] _ in
self?.localSyncState.setGattSyncDate(Date(), for: self?.ruuviTagSensor.macId)
if let isInterrupted = self?.gattSyncInterruptedByUser, !isInterrupted {
self?.localSyncState.setGattSyncDate(Date(), for: self?.ruuviTagSensor.macId)
}
self?.gattSyncInterruptedByUser = false
promise.succeed(value: ())
}, failure: {error in
promise.fail(error: .ruuviService(error))
Expand All @@ -178,7 +183,8 @@ extension TagChartsViewInteractor: TagChartsViewInteractorInput {
return promise.future
}
let op = gattService.stopGattSync(for: luid.value)
op.on(success: { response in
op.on(success: { [weak self] response in
self?.gattSyncInterruptedByUser = true
promise.succeed(value: (response))
}, failure: {error in
promise.fail(error: .ruuviService(error))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ extension DashboardInteractor: DashboardInteractorInput {
ruuviTag.firmwareVersion == nil ||
!ruuviTag.firmwareVersion.hasText() &&
settings.firmwareVersion(for: luid) == nil else {
// Trigger the method after 2 seconds so that sensor settings page can
// be set and start observing for owner check notification.
DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(2),
execute: { [weak self] in
self?.checkOwner(for: ruuviTag)
})
return
}

Expand Down Expand Up @@ -59,12 +65,12 @@ extension DashboardInteractor: DashboardInteractorInput {
return
}
guard let owner = owner, !owner.isEmpty else {
sSelf.settings.setOwnerCheckDate(for: macId, value: Date())
NotificationCenter.default.post(
name: .RuuviTagOwnershipCheckDidEnd,
object: nil,
userInfo: [RuuviTagOwnershipCheckResultKey.hasOwner: false]
)
sSelf.settings.setOwnerCheckDate(for: macId, value: Date())
return
}
sSelf.ruuviPool.update(ruuviTag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@ extension TagSettingsPresenter: TagSettingsViewOutput {
func viewDidLoad() {
startSubscribeToBackgroundUploadProgressChanges()
startObservingAppState()
startObservingRuuviTagOwnerCheckResponse()
}

func viewWillAppear() {
checkPushNotificationsStatus()
checkLastSensorSettings()
checkAndUpdateFirmwareVersion()
startObservingRuuviTagOwnerCheckResponse()
}

private func startObservingAppState() {
Expand Down Expand Up @@ -791,6 +791,9 @@ extension TagSettingsPresenter {
}

private func startObservingRuuviTagOwnerCheckResponse() {
ruuviTagSensorOwnerCheckToken?.invalidate()
ruuviTagSensorOwnerCheckToken = nil

ruuviTagSensorOwnerCheckToken = NotificationCenter
.default
.addObserver(forName: .RuuviTagOwnershipCheckDidEnd,
Expand Down
2 changes: 1 addition & 1 deletion station/Resources/Plists/DevInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>396</string>
<string>398</string>
<key>FirebaseMessagingAutoInitEnabled</key>
<false/>
<key>LSRequiresIPhoneOS</key>
Expand Down

0 comments on commit 2b686b8

Please sign in to comment.