Skip to content

Commit

Permalink
Add back coded needed to make trash list height cache clear
Browse files Browse the repository at this point in the history
  • Loading branch information
belcherj committed Jun 11, 2020
1 parent 10c63dc commit d39c0fb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/note-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,18 @@ export class NoteList extends Component<Props> {
this.toggleShortcuts(true);
}

UNSAFE_componentWillReceiveProps(nextProps: Props): void {
if (
nextProps.noteDisplay !== this.props.noteDisplay ||
nextProps.notes !== this.props.notes ||
nextProps.tagResultsFound !== this.props.tagResultsFound ||
nextProps.selectedNoteContent !== this.props.selectedNoteContent ||
nextProps.showNoteList !== this.props.showNoteList
) {
heightCache.clearAll();
}
}

componentDidUpdate(prevProps: Props) {
if (
prevProps.noteDisplay !== this.props.noteDisplay ||
Expand All @@ -231,7 +243,6 @@ export class NoteList extends Component<Props> {
// reselect when a note should be removed
if (
prevProps.selectedNote &&
prevProps.selectedNote.data.deleted &&
prevProps.selectedNote.data.deleted !== this.props.showTrash &&
this.state.selectedIndex &&
this.props.notes[this.state.selectedIndex]
Expand Down

0 comments on commit d39c0fb

Please sign in to comment.