Fix (yet another) potential issue with autosave overwriting files
This commit is contained in:
parent
2059d54b3b
commit
84db6b3d80
2 changed files with 5 additions and 3 deletions
|
@ -40,8 +40,8 @@ android {
|
|||
applicationId "com.wbrawner.simplemarkdown"
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 30
|
||||
versionCode 31
|
||||
versionName "0.8.9"
|
||||
versionCode 32
|
||||
versionName "0.8.10"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
buildConfigField "boolean", "ENABLE_CUSTOM_CSS", "false"
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ class MarkdownViewModel : ViewModel() {
|
|||
val fileName = MutableLiveData<String>("Untitled.md")
|
||||
val markdownUpdates = MutableLiveData<String>()
|
||||
val editorActions = MutableLiveData<EditorAction>()
|
||||
val uri = MutableLiveData<Uri>()
|
||||
val uri = MutableLiveData<Uri?>()
|
||||
private val isDirty = AtomicBoolean(false)
|
||||
|
||||
fun updateMarkdown(markdown: String?) {
|
||||
|
@ -70,7 +70,9 @@ class MarkdownViewModel : ViewModel() {
|
|||
|
||||
fun reset(untitledFileName: String) {
|
||||
fileName.postValue(untitledFileName)
|
||||
uri.postValue(null)
|
||||
markdownUpdates.postValue("")
|
||||
editorActions.postValue(EditorAction.Load(""))
|
||||
isDirty.set(false)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue