mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
Moved viewType to outer scope so it invokes once (to save resources)
This commit is contained in:
@@ -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}
|
||||
/>
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user