Quiet down auth check job.

This commit is contained in:
Alex Hart
2024-06-21 15:28:58 -03:00
committed by Greyson Parrelli
parent 16c8b88f0f
commit 57a70c3085
3 changed files with 16 additions and 2 deletions

View File

@@ -162,6 +162,13 @@ class InAppPaymentTable(context: Context, databaseHelper: SignalDatabase) : Data
AppDependencies.databaseObserver.notifyInAppPaymentsObservers(inAppPayment)
}
fun hasWaitingForAuth(): Boolean {
return readableDatabase
.exists(TABLE_NAME)
.where("$STATE = ?", State.serialize(State.WAITING_FOR_AUTHORIZATION))
.run()
}
fun getAllWaitingForAuth(): List<InAppPayment> {
return readableDatabase.select()
.from(TABLE_NAME)