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
Adds screen to list usable channels #29
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, I just had some small comments/nits. Also think it might need a rebase to pick up the latest 9be0033 commit.
@@ -180,7 +170,7 @@ object LDKBroadcaster : BroadcasterInterface.BroadcasterInterfaceInterface { | |||
val service = Service.create() | |||
|
|||
tx?.let { | |||
GlobalScope.launch { | |||
CoroutineScope(Dispatchers.IO).launch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep that's the better way to do it for sure.
@@ -29,14 +29,7 @@ interface Access { | |||
|
|||
companion object { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you might be able to do without the create()
method in the interface, and simply create an AccessImpl
object directly at the call-site.
For example if you remove the companion object entirely, the one call to the AccessImpl is in WalletScreen
and would become
onClick = {
CoroutineScope(Dispatchers.IO).launch {
// Access.create().sync()
AccessImpl().sync()
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or you could create the object above and simply reuse it every time you sync instead of creating a new one every time.
@Composable
fun WalletScreen() {
val accessImpl = AccessImpl()
// ...
onClick = {
CoroutineScope(Dispatchers.IO).launch {
accessImpl.sync()
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in c446025
@@ -7,5 +7,6 @@ sealed class Screen(val route: String) { | |||
object ListPeersScreen : Screen("list_peers") | |||
object ConnectPeerScreen : Screen("connect_peer") | |||
object OpenChannelScreen : Screen("open_channel") | |||
object ListChannelsScreen: Screen("list_channels") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit, but by convention when an object is extending an interface or another class the colon is separated by a space (ListChannelsScreen : Screen
) as opposed to when it's used to declare a variable type or function return type (val age: Int
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 3ad40d6
ad2d8e1
to
3ad40d6
Compare
This adds a screen to list all the usable channels and the available balance.
The logic for the balance/progress bar is not quite right (will update)