Skip to content

Commit

Permalink
fix add journal not reacting to selected journal
Browse files Browse the repository at this point in the history
  • Loading branch information
cloverich committed Aug 14, 2020
1 parent 43ded57 commit 5b1c31f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ui/src/journal/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ function Header(props: Props) {

const setEditing = useCallback(() => {
props.setEditing({
journal: state.journals[0].name,
journal: selectedJournal,
});
}, [state.journals]);
}, [state.journals, selectedJournal]);

if (!state.journals.length) {
// really, should be handled above. But this provides some protection
Expand Down
8 changes: 8 additions & 0 deletions ui/src/journal/journal.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { suite, test } from "mocha";

suite("header", function () {
test("current journal can be selected from the dropdown");
test(
"add button creates a document for today in the currently selected journal"
);
});

0 comments on commit 5b1c31f

Please sign in to comment.