Skip to content

Commit

Permalink
misc: view model update space and lines
Browse files Browse the repository at this point in the history
  • Loading branch information
reez authored Feb 11, 2024
1 parent 66e39a9 commit cedbfc3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 40 deletions.
6 changes: 1 addition & 5 deletions LDKNodeMonday/View Model/Bitcoin/SendBitcoinViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ import SwiftUI

class SendBitcoinViewModel: ObservableObject {
let spendableBalance: String
@Published var address: String = "" {
didSet {
address = address.trimmingCharacters(in: .whitespacesAndNewlines)
}
}
@Published var address: String = ""
@Published var txId: String = ""
@Published var sendViewError: MondayError?
@Published var networkColor = Color.gray
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,11 @@ import LDKNode
import SwiftUI

class ChannelAddViewModel: ObservableObject {
@Published var address: String = "" {
didSet {
address = address.trimmingCharacters(in: .whitespacesAndNewlines)
}
}
@Published var channelAmountSats: String = "" {
didSet {
channelAmountSats = channelAmountSats.trimmingCharacters(in: .whitespacesAndNewlines)
}
}
@Published var address: String = ""
@Published var channelAmountSats: String = ""
@Published var channelAddViewError: MondayError?
@Published var networkColor = Color.gray
@Published var nodeId: PublicKey = "" {
didSet {
nodeId = nodeId.trimmingCharacters(in: .whitespacesAndNewlines)
}
}
@Published var nodeId: PublicKey = ""
@Published var isOpenChannelFinished: Bool = false
@Published var isProgressViewShowing: Bool = false

Expand Down
12 changes: 2 additions & 10 deletions LDKNodeMonday/View Model/Lightning/Peer/PeerViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,10 @@ import LDKNode
import SwiftUI

class PeerViewModel: ObservableObject {
@Published var address: String = "" {
didSet {
address = address.trimmingCharacters(in: .whitespacesAndNewlines)
}
}
@Published var address: String = ""
@Published var peerViewError: MondayError?
@Published var networkColor = Color.gray
@Published var nodeId: PublicKey = "" {
didSet {
nodeId = nodeId.trimmingCharacters(in: .whitespacesAndNewlines)
}
}
@Published var nodeId: PublicKey = ""
@Published var isProgressViewShowing: Bool = false

func connect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ import LDKNode
import SwiftUI

class ReceiveViewModel: ObservableObject {
@Published var amountMsat: String = "" {
didSet {
amountMsat = amountMsat.trimmingCharacters(in: .whitespacesAndNewlines)
}
}
@Published var amountMsat: String = ""
@Published var invoice: Bolt11Invoice = ""
@Published var receiveViewError: MondayError?
@Published var networkColor = Color.gray
Expand Down
6 changes: 1 addition & 5 deletions LDKNodeMonday/View Model/Lightning/Send/SendViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ import LDKNode
import SwiftUI

class SendViewModel: ObservableObject {
@Published var invoice: PublicKey = "" {
didSet {
invoice = invoice.trimmingCharacters(in: .whitespacesAndNewlines)
}
}
@Published var invoice: PublicKey = ""
@Published var networkColor = Color.gray
@Published var parseError: MondayError?

Expand Down

0 comments on commit cedbfc3

Please sign in to comment.