TunnelListFragment: cleanup list type
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
87c9efce4a
commit
90050a0008
@ -316,10 +316,8 @@ class TunnelListFragment : BaseFragment() {
|
|||||||
Application.getTunnelManager().tunnels.thenAccept { tunnels ->
|
Application.getTunnelManager().tunnels.thenAccept { tunnels ->
|
||||||
val tunnelsToDelete = ArrayList<ObservableTunnel>()
|
val tunnelsToDelete = ArrayList<ObservableTunnel>()
|
||||||
for (position in copyCheckedItems) tunnelsToDelete.add(tunnels[position])
|
for (position in copyCheckedItems) tunnelsToDelete.add(tunnels[position])
|
||||||
val futures = tunnelsToDelete
|
val futures = tunnelsToDelete.map { it.delete().toCompletableFuture() }.toTypedArray()
|
||||||
.map { obj -> obj.delete() }
|
CompletableFuture.allOf(*futures)
|
||||||
.toTypedArray()
|
|
||||||
CompletableFuture.allOf(*futures as Array<out CompletableFuture<*>>)
|
|
||||||
.thenApply { futures.size }
|
.thenApply { futures.size }
|
||||||
.whenComplete(this@TunnelListFragment::onTunnelDeletionFinished)
|
.whenComplete(this@TunnelListFragment::onTunnelDeletionFinished)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user