feat: release Files view (#1236)

This commit is contained in:
Aman Harwara
2022-07-09 16:07:20 +05:30
committed by GitHub
parent 0aef604167
commit 5393eb71fe
9 changed files with 47 additions and 41 deletions

View File

@@ -37,12 +37,20 @@ const FileListItem: FunctionComponent<DisplayableListItemProps> = ({
const openContextMenu = useCallback(
async (posX: number, posY: number) => {
const { didSelect } = await selectionController.selectItem(item.uuid)
if (didSelect) {
let shouldOpenContextMenu = selected
if (!selected) {
const { didSelect } = await selectionController.selectItem(item.uuid)
if (didSelect) {
shouldOpenContextMenu = true
}
}
if (shouldOpenContextMenu) {
openFileContextMenu(posX, posY)
}
},
[selectionController, item.uuid, openFileContextMenu],
[selected, selectionController, item.uuid, openFileContextMenu],
)
const onClick = useCallback(async () => {

View File

@@ -41,8 +41,16 @@ const NoteListItem: FunctionComponent<DisplayableListItemProps> = ({
}
const openContextMenu = async (posX: number, posY: number) => {
const { didSelect } = await selectionController.selectItem(item.uuid, true)
if (didSelect) {
let shouldOpenContextMenu = selected
if (!selected) {
const { didSelect } = await selectionController.selectItem(item.uuid)
if (didSelect) {
shouldOpenContextMenu = true
}
}
if (shouldOpenContextMenu) {
openNoteContextMenu(posX, posY)
}
}