Fix parsing of text file tasks

parseContent(text) doesn't check the text content being passed actually described a task, which causes some corner case scenarios to break (image task settings are incorrectly cleared because an empty image task is created).
This commit is contained in:
patriceac 2023-01-07 00:47:30 -08:00 committed by GitHub
parent 2d9853f1f4
commit 420f7549a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -451,7 +451,7 @@ async function parseContent(text) {
}
// Normal txt file.
const task = parseTaskFromText(text)
if (task) {
if (text.toLowerCase().match('seed:') && task) { // only parse valid task content
restoreTaskToUI(task)
return true
} else {