perf: avoid uneccessary notes list item rerenders (#1904)
This commit is contained in:
@@ -1,15 +1,22 @@
|
||||
import { log as utilsLog } from '@standardnotes/utils'
|
||||
import { isDev } from './Utils'
|
||||
|
||||
export enum LoggingDomain {
|
||||
DailyNotes,
|
||||
NoteView,
|
||||
ItemsList,
|
||||
NavigationList,
|
||||
}
|
||||
|
||||
const LoggingStatus: Record<LoggingDomain, boolean> = {
|
||||
[LoggingDomain.DailyNotes]: false,
|
||||
[LoggingDomain.NoteView]: false,
|
||||
[LoggingDomain.ItemsList]: false,
|
||||
[LoggingDomain.NavigationList]: false,
|
||||
}
|
||||
|
||||
export function log(domain: LoggingDomain, ...args: any[]): void {
|
||||
if (!LoggingStatus[domain]) {
|
||||
if (!isDev || !LoggingStatus[domain]) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user