Skip to content

Commit 8897c39

Browse files
committed
fix a glitch at creating notes synced to files
1 parent 4564c6a commit 8897c39

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

app/src/main/kotlin/com/simplemobiletools/notes/pro/activities/MainActivity.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,10 @@ class MainActivity : SimpleActivity() {
482482
}
483483
}
484484

485-
private fun displayNewNoteDialog(value: String = "", title: String? = null) {
485+
private fun displayNewNoteDialog(value: String = "", title: String? = null, path: String = "") {
486486
NewNoteDialog(this, title) {
487487
it.value = value
488+
it.path = path
488489
addNewNote(it)
489490
}
490491
}
@@ -540,7 +541,7 @@ class MainActivity : SimpleActivity() {
540541
} else {
541542
runOnUiThread {
542543
OpenFileDialog(this, it.path) {
543-
displayNewNoteDialog(it.value, title = it.title)
544+
displayNewNoteDialog(it.value, title = it.title, it.path)
544545
}
545546
}
546547
}

app/src/main/kotlin/com/simplemobiletools/notes/pro/models/Note.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import java.io.FileNotFoundException
99

1010
@Entity(tableName = "notes", indices = [(Index(value = ["id"], unique = true))])
1111
data class Note(
12-
@PrimaryKey(autoGenerate = true) var id: Long?,
13-
@ColumnInfo(name = "title") var title: String,
14-
@ColumnInfo(name = "value") var value: String,
15-
@ColumnInfo(name = "type") var type: Int,
16-
@ColumnInfo(name = "path") var path: String = "") {
12+
@PrimaryKey(autoGenerate = true) var id: Long?,
13+
@ColumnInfo(name = "title") var title: String,
14+
@ColumnInfo(name = "value") var value: String,
15+
@ColumnInfo(name = "type") var type: Int,
16+
@ColumnInfo(name = "path") var path: String = "") {
1717

1818
fun getNoteStoredValue(): String? {
1919
return if (path.isNotEmpty()) {

0 commit comments

Comments
 (0)