refactor: notes state management (#1031)

This commit is contained in:
Mo
2022-05-17 20:02:34 -05:00
committed by GitHub
parent 2f89f5dbb2
commit aeae2b644f
13 changed files with 255 additions and 266 deletions

View File

@@ -31,7 +31,6 @@ export class NoteGroupView extends PureComponent<Props, State> {
const controllerGroup = this.application.noteControllerGroup
this.removeChangeObserver = this.application.noteControllerGroup.addActiveControllerChangeObserver(() => {
const controllers = controllerGroup.noteControllers
this.setState({
controllers: controllers,
})
@@ -63,7 +62,7 @@ export class NoteGroupView extends PureComponent<Props, State> {
{!this.state.showMultipleSelectedNotes && (
<>
{this.state.controllers.map((controller) => {
return <NoteView application={this.application} controller={controller} />
return <NoteView key={controller.note.uuid} application={this.application} controller={controller} />
})}
</>
)}