1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 01:36:22 +00:00

Moved viewType to outer scope so it invokes once (to save resources)

This commit is contained in:
pfftdammitchris
2018-02-24 07:10:46 -08:00
parent 9591a7cac2
commit ba888a7165

View File

@@ -780,6 +780,8 @@ class NoteList extends React.Component {
}
})
const viewType = this.getViewType()
const noteList = notes
.map(note => {
if (note == null) {
@@ -807,7 +809,7 @@ class NoteList extends React.Component {
pathname={location.pathname}
folderName={this.getNoteFolder(note).name}
storageName={this.getNoteStorage(note).name}
viewType={this.getViewType()}
viewType={viewType}
/>
)
}
@@ -823,7 +825,7 @@ class NoteList extends React.Component {
pathname={location.pathname}
folderName={this.getNoteFolder(note).name}
storageName={this.getNoteStorage(note).name}
viewType={this.getViewType()}
viewType={viewType}
/>
)
})