Specify LazyThreadSafetyMode for inject and viewModel delegates
This commit is contained in:
@@ -23,7 +23,7 @@ import org.koitharu.kotatsu.utils.ext.viewLifecycleScope
|
||||
|
||||
class HistorySettingsFragment : BasePreferenceFragment(R.string.history_and_cache) {
|
||||
|
||||
private val trackerRepo by inject<TrackingRepository>()
|
||||
private val trackerRepo by inject<TrackingRepository>(mode = LazyThreadSafetyMode.NONE)
|
||||
|
||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||
addPreferencesFromResource(R.xml.pref_history)
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.io.File
|
||||
|
||||
class BackupDialogFragment : AlertDialogFragment<DialogProgressBinding>() {
|
||||
|
||||
private val viewModel by viewModel<BackupViewModel>()
|
||||
private val viewModel by viewModel<BackupViewModel>(mode = LazyThreadSafetyMode.NONE)
|
||||
|
||||
override fun onInflateView(
|
||||
inflater: LayoutInflater,
|
||||
|
||||
@@ -25,7 +25,7 @@ class RestoreDialogFragment : AlertDialogFragment<DialogProgressBinding>() {
|
||||
container: ViewGroup?
|
||||
) = DialogProgressBinding.inflate(inflater, container, false)
|
||||
|
||||
private val viewModel by viewModel<RestoreViewModel> {
|
||||
private val viewModel by viewModel<RestoreViewModel>(mode = LazyThreadSafetyMode.NONE) {
|
||||
parametersOf(arguments?.getString(ARG_FILE)?.toUriOrNull())
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import org.koitharu.kotatsu.databinding.ActivitySetupProtectBinding
|
||||
class ProtectSetupActivity : BaseActivity<ActivitySetupProtectBinding>(), TextWatcher,
|
||||
View.OnClickListener, TextView.OnEditorActionListener {
|
||||
|
||||
private val viewModel by viewModel<ProtectSetupViewModel>()
|
||||
private val viewModel by viewModel<ProtectSetupViewModel>(mode = LazyThreadSafetyMode.NONE)
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
Reference in New Issue
Block a user