Skip to content

Commit

Permalink
add saving of updated config
Browse files Browse the repository at this point in the history
  • Loading branch information
mariobodemann committed Jun 25, 2024
1 parent 3b6b1fb commit 1572dd1
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,23 @@ class ZeBadgeManager @Inject constructor(
payload = config,
)

badgeManager.sendPayload(payload)
if (badgeManager.sendPayload(payload).isSuccess) {

return badgeManager.readResponse()
if (badgeManager.sendPayload(
BadgePayload(
type = "config_save",
meta = "",
payload = "",
),
).isSuccess
) {
return Result.success(true)
} else {
return Result.failure(IllegalStateException())
}
} else {
return Result.failure(NoSuchElementException())
}
}

fun isConnected(): Boolean = badgeManager.isConnected()
Expand Down

0 comments on commit 1572dd1

Please sign in to comment.