Skip to content

Commit

Permalink
Common: Don't show empty task when creating new todo.txt file
Browse files Browse the repository at this point in the history
  • Loading branch information
xuhcc committed Jan 3, 2020
1 parent b568922 commit 1fafff9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,7 @@
## 1.2.0

- Mobile, Web: Renamed 'Projects' page to 'Tags', added contexts to it.
- Mobile, Web: Not showing empty task when creating new todo.txt file.

## 1.1.0

Expand Down
6 changes: 5 additions & 1 deletion src/app/shared/todo-file.service.ts
Expand Up @@ -133,7 +133,11 @@ export class TodoFileService implements OnDestroy {
return;
}
this.content = content;
this.todoItems = TodoTxt.parse(this.content, getExtensions());
if (this.content === '') {
this.todoItems = [];
} else {
this.todoItems = TodoTxt.parse(this.content, getExtensions());
}
this.fileChanged.next(true); // true = IDs are probably changed
try {
showToast('File loaded');
Expand Down

0 comments on commit 1fafff9

Please sign in to comment.