Skip to content

Commit

Permalink
Fixing migration error for todo widget
Browse files Browse the repository at this point in the history
  • Loading branch information
joelshepherd committed Apr 2, 2022
1 parent c0eca2d commit 55c489a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## [2.5.1] - 2022-04-02

### Fixed

- Migration error that would cause the todo widget to crash

## [2.5.0] - 2022-04-02

### Added
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/widgets/todo/Todo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ const Todo: FC<Props> = ({ data = defaultData, setData }) => {
const items = data.items.filter((item) => !item.completed || showCompleted);
const show = !showMore ? data.show : undefined;

const keyBind = data.keyBind ?? "T";
useKeyPress(
() => dispatch(addTodo()),
[data.keyBind.toUpperCase(), data.keyBind.toLowerCase()],
[keyBind.toUpperCase(), keyBind.toLowerCase()],
);

return (
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/widgets/todo/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { State } from "./reducer";
export type Data = {
items: State;
show: number;
keyBind: string;
keyBind?: string;
};

export type Props = API<Data>;
Expand Down

0 comments on commit 55c489a

Please sign in to comment.