Skip to content

Commit

Permalink
Frontend.XF: cosmetic, use isNull func
Browse files Browse the repository at this point in the history
  • Loading branch information
knocte committed Aug 11, 2023
1 parent fff52fa commit 93e2c74
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/GWallet.Frontend.XF/FrontendHelpers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ module FrontendHelpers =
Infrastructure.LogError "MANUAL FORCED SHUTDOWN NOW"
Device.PlatformServices.QuitApplication()

if null = ex then
if isNull ex then
()
else
let shouldCrash =
Expand Down
2 changes: 1 addition & 1 deletion src/GWallet.Frontend.XF/PairingFromPage.xaml.fs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type PairingFromPage(previousPage: Page,
clipBoardButton.Text <- clipBoardButtonCaption

let qrCode = mainLayout.FindByName<ZXingBarcodeImageView> "qrCode"
if (qrCode = null) then
if isNull qrCode then
failwith "Couldn't find QR code"
qrCode.BarcodeValue <- qrCodeContents
qrCode.IsVisible <- true
Expand Down
10 changes: 5 additions & 5 deletions src/GWallet.Frontend.XF/SendPage.xaml.fs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ type SendPage(account: IAccount, receivePage: Page, newReceivePageFunc: unit->Pa

let scanPage = ZXingScannerPage FrontendHelpers.BarCodeScanningOptions
scanPage.add_OnScanResult(fun result ->
if null = result || String.IsNullOrEmpty result.Text then
if isNull result || String.IsNullOrEmpty result.Text then
failwith "result of scanning was null(?)"

scanPage.IsScanning <- false
Expand All @@ -165,7 +165,7 @@ type SendPage(account: IAccount, receivePage: Page, newReceivePageFunc: unit->Pa
currencySelectorPicker.Items.FirstOrDefault(
fun item -> item.ToString() = account.Currency.ToString()
)
if (cryptoCurrencyInPicker = null) then
if isNull cryptoCurrencyInPicker then
failwith <| SPrintF1 "Could not find currency %A in picker?" account.Currency
currencySelectorPicker.SelectedItem <- cryptoCurrencyInPicker
let aPreviousAmountWasSet = not (String.IsNullOrWhiteSpace amountLabel.Text)
Expand Down Expand Up @@ -380,7 +380,7 @@ type SendPage(account: IAccount, receivePage: Page, newReceivePageFunc: unit->Pa
| :? ReadOnlyAccount ->
false
| _ ->
if passwordEntry = null then
if isNull passwordEntry then
// not ready yet?
true
else
Expand Down Expand Up @@ -461,7 +461,7 @@ type SendPage(account: IAccount, receivePage: Page, newReceivePageFunc: unit->Pa

member private __.UpdateEquivalentFiatLabel (): Async<bool> =
let amountToSend = mainLayout.FindByName<Entry>("amountToSend")
if amountToSend = null || String.IsNullOrWhiteSpace amountToSend.Text then
if isNull amountToSend || String.IsNullOrWhiteSpace amountToSend.Text then
async { return false }
else
let equivalentAmount = mainLayout.FindByName<Label> "equivalentAmountInAlternativeCurrency"
Expand Down Expand Up @@ -529,7 +529,7 @@ type SendPage(account: IAccount, receivePage: Page, newReceivePageFunc: unit->Pa

member this.OnEntryTextChanged(_sender: Object, _args: EventArgs) =
let mainLayout = base.FindByName<StackLayout>("mainLayout")
if (mainLayout = null) then
if isNull mainLayout then
//page not yet ready
()
else
Expand Down

0 comments on commit 93e2c74

Please sign in to comment.