Skip to content

Commit

Permalink
vinceglb#51 Don't init FileKit if in inspection (preview) mode
Browse files Browse the repository at this point in the history
  • Loading branch information
griffinsorrentino committed Jun 28, 2024
1 parent 500b202 commit fd97089
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.platform.LocalContext
import io.github.vinceglb.filekit.core.FileKit
import androidx.compose.ui.platform.LocalInspectionMode

@Composable
internal actual fun InitFileKit() {
val componentActivity = LocalContext.current as ComponentActivity
LaunchedEffect(Unit) {
FileKit.init(componentActivity)
if (!LocalInspectionMode.current) {
val componentActivity = LocalContext.current as ComponentActivity
LaunchedEffect(Unit) {
FileKit.init(componentActivity)
}
}
}

0 comments on commit fd97089

Please sign in to comment.