refactor: add extra guard for sort change
This commit is contained in:
@@ -12,6 +12,8 @@ import {
|
|||||||
DecryptedItemInterface,
|
DecryptedItemInterface,
|
||||||
SNNote,
|
SNNote,
|
||||||
TagMutator,
|
TagMutator,
|
||||||
|
isSystemView,
|
||||||
|
isSmartView,
|
||||||
} from '@standardnotes/snjs'
|
} from '@standardnotes/snjs'
|
||||||
import { useState, useEffect, useCallback, useMemo, useRef } from 'react'
|
import { useState, useEffect, useCallback, useMemo, useRef } from 'react'
|
||||||
import { FileItemActionType } from '../AttachedFilesPopover/PopoverFileItemAction'
|
import { FileItemActionType } from '../AttachedFilesPopover/PopoverFileItemAction'
|
||||||
@@ -307,6 +309,11 @@ const ContentTableView = ({
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isNonFilesSystemView = isSmartView(selectedTag) && isSystemView(selectedTag)
|
||||||
|
if (isNonFilesSystemView) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
await application.mutator.changeAndSaveItem<TagMutator>(selectedTag, (mutator) => {
|
await application.mutator.changeAndSaveItem<TagMutator>(selectedTag, (mutator) => {
|
||||||
mutator.preferences = {
|
mutator.preferences = {
|
||||||
...mutator.preferences,
|
...mutator.preferences,
|
||||||
|
|||||||
Reference in New Issue
Block a user