Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
saving
Browse files Browse the repository at this point in the history
  • Loading branch information
John Oberhauser committed Jun 14, 2024
1 parent 3eec8c6 commit c779f56
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ import social.firefly.core.accounts.model.MastodonAccount
],
exportSchema = true
)
abstract class AccountsDatabase : RoomDatabase() {
internal abstract class AccountsDatabase : RoomDatabase() {
abstract fun mastodonAccountsDao(): MastodonAccountsDao
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package social.firefly.core.accounts

import kotlinx.coroutines.flow.Flow
import social.firefly.core.accounts.dao.MastodonAccountsDao
import social.firefly.core.accounts.model.MastodonAccount

class AccountsManager(
private val mastodonAccountsDao: MastodonAccountsDao,
) {

suspend fun getActiveAccount(): MastodonAccount = mastodonAccountsDao.getActiveAccount()

fun getActiveAccountFlow(): Flow<MastodonAccount> = mastodonAccountsDao.getActiveAccountFlow()
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ interface MastodonAccountsDao : BaseDao<MastodonAccount> {
"SELECT domain FROM activeAccount" +
") "
)
suspend fun getActiveAccountFlow(): Flow<MastodonAccount>
fun getActiveAccountFlow(): Flow<MastodonAccount>
}

0 comments on commit c779f56

Please sign in to comment.