From 84db6b3d805caa704b75dbcb75ab327f7e799599 Mon Sep 17 00:00:00 2001 From: William Brawner Date: Thu, 8 Oct 2020 09:20:57 -0700 Subject: [PATCH] Fix (yet another) potential issue with autosave overwriting files --- app/build.gradle | 4 ++-- .../wbrawner/simplemarkdown/viewmodel/MarkdownViewModel.kt | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 9bddd0d..a2fd5b6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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" } diff --git a/app/src/main/java/com/wbrawner/simplemarkdown/viewmodel/MarkdownViewModel.kt b/app/src/main/java/com/wbrawner/simplemarkdown/viewmodel/MarkdownViewModel.kt index f90aad0..d7dd37c 100644 --- a/app/src/main/java/com/wbrawner/simplemarkdown/viewmodel/MarkdownViewModel.kt +++ b/app/src/main/java/com/wbrawner/simplemarkdown/viewmodel/MarkdownViewModel.kt @@ -15,7 +15,7 @@ class MarkdownViewModel : ViewModel() { val fileName = MutableLiveData("Untitled.md") val markdownUpdates = MutableLiveData() val editorActions = MutableLiveData() - val uri = MutableLiveData() + val uri = MutableLiveData() 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) }