diff --git a/package.json b/package.json index d3aae9a..7514dff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "oil-terminal", - "version": "0.0.3", + "version": "0.0.5", "license": "MIT", "author": "mysteryven", "description": "Manage and navigate file system easily from your terminal.", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8629d0f..55e3c61 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,7 +1,7 @@ lockfileVersion: '9.0' settings: - autoInstallPeers: true + autoInstallPeers: false excludeLinksFromLockfile: false importers: diff --git a/src/app.tsx b/src/app.tsx index 0cff3d4..fb8d81b 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -24,19 +24,14 @@ const App = (props: Props) => { const [list, setList] = useFileList(currentDir, [reloadFlag]) const [mode, setMode] = useState('Normal') - let initialIndex = Math.min(list.length, 1) + let initialIndex = list.length === 1 ? 0 : 1 // we are back to a parent dir if (lastDir) { initialIndex = list.findIndex((fileMeta) => fileMeta.filename === lastDir) } const [activeIndex, setActiveIndex] = useActiveIndex(initialIndex, list.length, mode, [currentDir, initialIndex]) - const [_debug, setDebug] = useState() const offset = useOffset(activeIndex, list.length) - useEffect(() => { - setDebug(`reloadFlag${reloadFlag}, currentDir: ${currentDir}, activeIndex: ${activeIndex}, mode: ${mode}`) - }, [reloadFlag, currentDir, activeIndex, mode]) - // switch mode useInput((_input, key) => { if (key.escape) {