mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-17 21:27:01 +05:30
all: bump dependencies
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
92ebb82a6a
commit
24990cde08
6 changed files with 17 additions and 15 deletions
|
@ -3,7 +3,7 @@ plugins {
|
|||
kotlin("android")
|
||||
kotlin("kapt")
|
||||
id("dagger.hilt.android.plugin")
|
||||
id("org.jetbrains.compose") version "0.4.0-build179"
|
||||
id("org.jetbrains.compose") version Dependencies.JB_COMPOSE_VERSION
|
||||
id("shot")
|
||||
`versioning-plugin`
|
||||
`lobsters-plugin`
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package dev.msfjarvis.lobsters.ui.settings
|
||||
|
||||
import android.content.Context
|
||||
import androidx.activity.compose.registerForActivityResult
|
||||
import androidx.activity.compose.rememberLauncherForActivityResult
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.compose.runtime.Composable
|
||||
import dev.msfjarvis.lobsters.data.backup.BackupHandler
|
||||
|
@ -20,8 +20,8 @@ fun BackupOption(
|
|||
coroutineScope: CoroutineScope,
|
||||
) {
|
||||
val result =
|
||||
registerForActivityResult(ActivityResultContracts.CreateDocument()) { uri ->
|
||||
if (uri == null) return@registerForActivityResult
|
||||
rememberLauncherForActivityResult(ActivityResultContracts.CreateDocument()) { uri ->
|
||||
if (uri == null) return@rememberLauncherForActivityResult
|
||||
context.contentResolver.openOutputStream(uri)?.let {
|
||||
coroutineScope.launch(Dispatchers.IO) {
|
||||
it.write(backupHandler.exportSavedPosts())
|
||||
|
@ -43,8 +43,8 @@ fun RestoreOption(
|
|||
coroutineScope: CoroutineScope,
|
||||
) {
|
||||
val result =
|
||||
registerForActivityResult(ActivityResultContracts.GetContent()) { uri ->
|
||||
if (uri == null) return@registerForActivityResult
|
||||
rememberLauncherForActivityResult(ActivityResultContracts.GetContent()) { uri ->
|
||||
if (uri == null) return@rememberLauncherForActivityResult
|
||||
context.contentResolver.openInputStream(uri)?.let {
|
||||
coroutineScope.launch(Dispatchers.IO) {
|
||||
backupHandler.importSavedPosts(it.readBytes())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue