diff --git a/app/src/main/java/dev/lucasnlm/antimine/control/ControlDialogFragment.kt b/app/src/main/java/dev/lucasnlm/antimine/control/ControlDialogFragment.kt index e0facfd9..8340533f 100644 --- a/app/src/main/java/dev/lucasnlm/antimine/control/ControlDialogFragment.kt +++ b/app/src/main/java/dev/lucasnlm/antimine/control/ControlDialogFragment.kt @@ -9,14 +9,17 @@ import android.widget.BaseAdapter import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AppCompatDialogFragment import dev.lucasnlm.antimine.R +import dev.lucasnlm.antimine.cloud.CloudSaveManager import dev.lucasnlm.antimine.control.view.ControlItemView import dev.lucasnlm.antimine.control.view.SimpleControlItemView import dev.lucasnlm.antimine.control.viewmodel.ControlEvent import dev.lucasnlm.antimine.control.viewmodel.ControlViewModel import dev.lucasnlm.antimine.core.control.ControlStyle +import org.koin.android.ext.android.inject import org.koin.androidx.viewmodel.ext.android.viewModel class ControlDialogFragment : AppCompatDialogFragment() { + private val cloudSaveManager by inject() private val controlViewModel by viewModel() private val adapter by lazy { ControlListAdapter(controlViewModel) } @@ -33,6 +36,7 @@ class ControlDialogFragment : AppCompatDialogFragment() { if (activity is DialogInterface.OnDismissListener) { (activity as DialogInterface.OnDismissListener).onDismiss(dialog) } + cloudSaveManager.uploadSave() super.onDismiss(dialog) }