Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push notifications bugfixes #1003

Merged
merged 6 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ excluded:
- R.generated.swift
- novawalletTests
- novawalletIntegrationTests
- NovaPushNotificationServiceExtension/R.generated.swift
identifier_name:
excluded:
- id
Expand Down
2 changes: 1 addition & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1135,4 +1135,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 2c0610007a18da4ea4e1aa496e83394f06cb70f3

COCOAPODS: 1.15.2
COCOAPODS: 1.15.0
4 changes: 3 additions & 1 deletion novawallet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5415,6 +5415,7 @@
775F194C2A56EEAC009915B6 /* StartStakingInfoRelaychainPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StartStakingInfoRelaychainPresenter.swift; sourceTree = "<group>"; };
775F19502A5811FA009915B6 /* StartStakingParachainInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StartStakingParachainInteractor.swift; sourceTree = "<group>"; };
775F19522A5BDFB6009915B6 /* StartStakingInfoParachainPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StartStakingInfoParachainPresenter.swift; sourceTree = "<group>"; };
7761DD252BA10CF2000C600C /* SubstrateDataModel27.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = SubstrateDataModel27.xcdatamodel; sourceTree = "<group>"; };
7772EB312B724A8F000D7E21 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
7772EB332B726670000D7E21 /* Web3AlertsSyncService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Web3AlertsSyncService.swift; sourceTree = "<group>"; };
77740BBB2AD4A7B800E8C06F /* CollapsableContainerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollapsableContainerView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -26109,6 +26110,7 @@
843910CA253F7E6500E3C217 /* SubstrateDataModel.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
7761DD252BA10CF2000C600C /* SubstrateDataModel27.xcdatamodel */,
0C85FF352B6E08F800FC0014 /* SubstrateDataModel26.xcdatamodel */,
7722739F2B3D44F000EB4BC3 /* SubstrateDataModel25.xcdatamodel */,
0C8AF7BD2B39567700005AC9 /* SubstrateDataModel24.xcdatamodel */,
Expand Down Expand Up @@ -26136,7 +26138,7 @@
88787F0328DB3A7B00B115AB /* SubstrateDataModel2.xcdatamodel */,
843910CB253F7E6500E3C217 /* SubstrateDataModel.xcdatamodel */,
);
currentVersion = 0C85FF352B6E08F800FC0014 /* SubstrateDataModel26.xcdatamodel */;
currentVersion = 7761DD252BA10CF2000C600C /* SubstrateDataModel27.xcdatamodel */;
path = SubstrateDataModel.xcdatamodeld;
sourceTree = "<group>";
versionGroupType = wrapper.xcdatamodel;
Expand Down
5 changes: 5 additions & 0 deletions novawallet/Common/Extension/UIKit/Style/UILabel+Style.swift
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ extension UILabel.Style {
font: .regularSubheadline
)

static let regularSubhedlineInactive = UILabel.Style(
textColor: R.color.colorIconInactive(),
font: .regularSubheadline
)

static let regularSubhedlineSecondary = UILabel.Style(
textColor: R.color.colorTextSecondary(),
font: .regularSubheadline
Expand Down
3 changes: 3 additions & 0 deletions novawallet/Common/Migration/SubstrateStorageVersion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ enum SubstrateStorageVersion: String, CaseIterable {
case version24 = "SubstrateDataModel24"
case version25 = "SubstrateDataModel25"
case version26 = "SubstrateDataModel26"
case version27 = "SubstrateDataModel27"

static var current: SubstrateStorageVersion {
allCases.last!
Expand Down Expand Up @@ -83,6 +84,8 @@ enum SubstrateStorageVersion: String, CaseIterable {
case .version25:
return .version26
case .version26:
return .version27
case .version27:
return nil
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ struct ChainModel: Equatable, Hashable {
assets.contains { $0.hasStaking }
}

var hasPushNotifications: Bool {
options?.contains(where: { $0 == .pushNotifications }) ?? false
}

func chainAssetsWithExternalBalances() -> [ChainAsset] {
assets.compactMap { asset in
guard asset.hasPoolStaking || asset.isUtility && hasCrowdloans else {
Expand Down Expand Up @@ -303,6 +307,7 @@ enum LocalChainOptions: String, Codable {
case swapHub = "swap-hub"
case swapHydra = "hydradx-swaps"
case proxy
case pushNotifications = "pushSupport"
}

extension ChainModel {
Expand Down
2 changes: 2 additions & 0 deletions novawallet/Common/Model/OnchainStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,5 @@ extension UncertainStorage where T: Decodable {
}
}
}

extension UncertainStorage: Equatable where T: Equatable {}
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,10 @@ final class ChainModelMapper {
options.append(.proxy)
}

if entity.hasPushNotifications {
options.append(.pushNotifications)
}

return !options.isEmpty ? options : nil
}
}
Expand Down Expand Up @@ -403,6 +407,7 @@ extension ChainModelMapper: CoreDataMapperProtocol {
entity.hasSwapHub = model.hasSwapHub
entity.hasSwapHydra = model.hasSwapHydra
entity.hasProxy = model.hasProxy
entity.hasPushNotifications = model.hasPushNotifications
entity.order = model.order
entity.nodeSwitchStrategy = model.nodeSwitchStrategy.rawValue
entity.additional = try model.additional.map {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>_XCCurrentVersionName</key>
<string>SubstrateDataModel26.xcdatamodel</string>
<string>SubstrateDataModel27.xcdatamodel</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="21754" systemVersion="22F66" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="22522" systemVersion="23D56" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
<entity name="CDAsset" representedClassName="CDAsset" syncable="YES" codeGenerationType="class">
<attribute name="assetId" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="buyProviders" optional="YES" attributeType="Binary"/>
Expand Down
Loading
Loading