Commit 42e5f515 authored by Kazurin Nanako's avatar Kazurin Nanako Committed by John Wu

Fix "double install" caused by config changes

Configuration changes in FlashFragment may cause the installation process to be triggered twice. The simplest way to reproduce this behavior is to choose a module ZIP file in landscape mode (which is the default on some tablets).

This commit fixes the problem by ensuring `savedInstanceState == null` before starting installation.
parent 90545057
...@@ -51,7 +51,9 @@ class FlashFragment : BaseFragment<FragmentFlashMd2Binding>() { ...@@ -51,7 +51,9 @@ class FlashFragment : BaseFragment<FragmentFlashMd2Binding>() {
defaultOrientation = activity?.requestedOrientation ?: -1 defaultOrientation = activity?.requestedOrientation ?: -1
activity?.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_NOSENSOR activity?.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_NOSENSOR
viewModel.startFlashing() if (savedInstanceState == null) {
viewModel.startFlashing()
}
} }
@SuppressLint("WrongConstant") @SuppressLint("WrongConstant")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment