rdesktop^2
filip mertens 1 year ago
parent d1073ed322
commit 7dac9f1731
  1. 10
      libs/remix-ui/search/src/lib/components/results/SearchHelper.ts
  2. 2
      libs/remix-ui/search/src/lib/context/context.tsx

@ -1,9 +1,18 @@
import { EOL } from 'os' import { EOL } from 'os'
import { SearchResultLineLine } from '../../types' import { SearchResultLineLine } from '../../types'
import isElectron from 'is-electron'
export const getDirectory = async (dir: string, plugin: any) => { export const getDirectory = async (dir: string, plugin: any) => {
let result = [] let result = []
if (isElectron()) {
const files = await plugin.call('fs', 'glob', dir, '**/*')
// only get path property of files
result = files.map(x => x.path)
} else {
const files = await plugin.call('fileManager', 'readdir', dir) const files = await plugin.call('fileManager', 'readdir', dir)
const fileArray = normalize(files) const fileArray = normalize(files)
for (const fi of fileArray) { for (const fi of fileArray) {
@ -16,6 +25,7 @@ export const getDirectory = async (dir: string, plugin: any) => {
} }
} }
} }
}
return result return result
} }

@ -311,7 +311,6 @@ export const SearchProvider = ({
} }
useEffect(() => { useEffect(() => {
return
plugin.on('filePanel', 'setWorkspace', async workspace => { plugin.on('filePanel', 'setWorkspace', async workspace => {
value.setSearchResults(null) value.setSearchResults(null)
value.clearUndo() value.clearUndo()
@ -418,6 +417,7 @@ export const SearchProvider = ({
}, [state.count]) }, [state.count])
useEffect(() => { useEffect(() => {
console.log('STATE CHANGED', files)
if (state.find) { if (state.find) {
(async () => { (async () => {
try { try {

Loading…
Cancel
Save