Add warning when BTC and sats exceed the maximum
This commit is contained in:
2
Skip.env
2
Skip.env
@@ -14,7 +14,7 @@ PRODUCT_BUNDLE_IDENTIFIER = xyz.tyiu.SatsPrice
|
|||||||
MARKETING_VERSION = 0.2.0
|
MARKETING_VERSION = 0.2.0
|
||||||
|
|
||||||
// The build number specifying the internal app version
|
// The build number specifying the internal app version
|
||||||
CURRENT_PROJECT_VERSION = 2
|
CURRENT_PROJECT_VERSION = 3
|
||||||
|
|
||||||
// The package name for the Android entry point, referenced by the AndroidManifest.xml
|
// The package name for the Android entry point, referenced by the AndroidManifest.xml
|
||||||
ANDROID_PACKAGE_NAME = sats.price
|
ANDROID_PACKAGE_NAME = sats.price
|
||||||
|
|||||||
@@ -88,6 +88,10 @@ public struct ContentView: View {
|
|||||||
#endif
|
#endif
|
||||||
} header: {
|
} header: {
|
||||||
Text("Sats")
|
Text("Sats")
|
||||||
|
} footer: {
|
||||||
|
if satsViewModel.exceedsMaximum {
|
||||||
|
Text("2100000000000000 sats is the maximum.")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Section {
|
Section {
|
||||||
@@ -97,6 +101,10 @@ public struct ContentView: View {
|
|||||||
#endif
|
#endif
|
||||||
} header: {
|
} header: {
|
||||||
Text("BTC")
|
Text("BTC")
|
||||||
|
} footer: {
|
||||||
|
if satsViewModel.exceedsMaximum {
|
||||||
|
Text("21000000 BTC is the maximum.")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Section {
|
Section {
|
||||||
|
|||||||
@@ -16,6 +16,12 @@
|
|||||||
},
|
},
|
||||||
"1 BTC to %@" : {
|
"1 BTC to %@" : {
|
||||||
|
|
||||||
|
},
|
||||||
|
"21000000 BTC is the maximum." : {
|
||||||
|
|
||||||
|
},
|
||||||
|
"2100000000000000 sats is the maximum." : {
|
||||||
|
|
||||||
},
|
},
|
||||||
"BTC" : {
|
"BTC" : {
|
||||||
|
|
||||||
|
|||||||
@@ -190,6 +190,13 @@ class SatsViewModel: ObservableObject {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var exceedsMaximum: Bool {
|
||||||
|
if let btc, btc > Decimal(21000000) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension Decimal {
|
extension Decimal {
|
||||||
|
|||||||
Reference in New Issue
Block a user