Prevent most recent inputted amounts to be implicitly overwritten by calculations
This commit is contained in:
@@ -25,6 +25,10 @@ class SatsViewModel: ObservableObject {
|
|||||||
btcToUsdStringInternal
|
btcToUsdStringInternal
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
|
guard btcToUsdStringInternal != newValue else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
btcToUsdStringInternal = newValue
|
btcToUsdStringInternal = newValue
|
||||||
|
|
||||||
if let btc, let btcToUsd {
|
if let btc, let btcToUsd {
|
||||||
@@ -40,6 +44,10 @@ class SatsViewModel: ObservableObject {
|
|||||||
satsStringInternal
|
satsStringInternal
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
|
guard satsStringInternal != newValue else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
satsStringInternal = newValue
|
satsStringInternal = newValue
|
||||||
|
|
||||||
if let sats {
|
if let sats {
|
||||||
@@ -66,6 +74,10 @@ class SatsViewModel: ObservableObject {
|
|||||||
btcStringInternal
|
btcStringInternal
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
|
guard btcStringInternal != newValue else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
btcStringInternal = newValue
|
btcStringInternal = newValue
|
||||||
|
|
||||||
if let btc {
|
if let btc {
|
||||||
@@ -89,6 +101,10 @@ class SatsViewModel: ObservableObject {
|
|||||||
usdStringInternal
|
usdStringInternal
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
|
guard usdStringInternal != newValue else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
usdStringInternal = newValue
|
usdStringInternal = newValue
|
||||||
|
|
||||||
if let usd {
|
if let usd {
|
||||||
|
|||||||
Reference in New Issue
Block a user