Skip to content

Commit

Permalink
use saved account for location panel
Browse files Browse the repository at this point in the history
  • Loading branch information
jonesmac committed Nov 15, 2024
1 parent f1a2c20 commit 9fccd85
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ import network.xyo.client.witness.types.WitnessResult
import network.xyo.client.XyoPanel
import network.xyo.client.account.model.AccountInstance
import network.xyo.client.boundwitness.XyoBoundWitnessBodyJson
import network.xyo.client.datastore.AccountPrefsRepository
import network.xyo.client.payload.XyoPayload

open class WitnessLocationHandler : WitnessHandlerInterface<List<XyoPayload?>> {
@RequiresApi(Build.VERSION_CODES.M)
override suspend fun witness(context: Context, nodeUrlsAndAccounts: ArrayList<Pair<String, AccountInstance?>>): WitnessResult<List<XyoPayload?>> {
val account = AccountPrefsRepository.getInstance(context).getAccount()
val panel = XyoPanel(context, nodeUrlsAndAccounts, listOf(
XyoLocationWitness()
XyoLocationWitness(account)
))
return getLocation(panel)
}
Expand Down

0 comments on commit 9fccd85

Please sign in to comment.