diff options
| author | Grant Ammons <grant@pipelinedealsco.com> | 2016-09-19 05:27:44 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-09-19 05:27:44 -0400 |
| commit | c3c8817de6228557ba865465e3d639a104578587 (patch) | |
| tree | b5e004011606f1cc44eba196bff8f1bd33e795b7 /todolist/app.go | |
| parent | aa0580af8066b030c720a20b5e79e98a53d1ec11 (diff) | |
| parent | 144ac3243b4920d267f224732d9deff0f9f2cc52 (diff) | |
Merge pull request #9 from Bunchhieng/master
Only allow to open web app if .todos.json exists in current directory
Diffstat (limited to 'todolist/app.go')
| -rw-r--r-- | todolist/app.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/todolist/app.go b/todolist/app.go index 7f64366..44d97f5 100644 --- a/todolist/app.go +++ b/todolist/app.go @@ -153,8 +153,13 @@ func (a *App) getGroups(input string, todos []*Todo) *GroupedTodos { return grouped } -func (a *App) Load() { - a.TodoList.Load(a.TodoStore.Load()) +func (a *App) Load() error { + todos, err := a.TodoStore.Load() + if err != nil { + return err + } + a.TodoList.Load(todos) + return nil } func (a *App) Save() { |
