Skip to content

Commit

Permalink
small cosmetic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
zManuu committed Oct 4, 2023
1 parent d145e54 commit 8cc4936
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/main/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { type Directory } from '../shared/Directory'
import { FsEntry, cleanPath, isHidden } from '../shared/FsEntry'
import { exec } from 'child_process'

const MAX_PREVIEW_FILE_SIZE = 1 * 1024 * 1024 // = 1mb
const MAX_PREVIEW_FILE_SIZE = 0.5 * 1024 * 1024 // = 0.5mb

export function enable() {
console.log('enabling the browser window')
Expand Down Expand Up @@ -34,13 +34,14 @@ export function enable() {

handleRequest('requestPreview', async (_ev, args) => {
if (!fsSync.existsSync(args.path)) {
return "ERROR: File doesn't exist."
// eslint-disable-next-line prettier/prettier
return 'ERROR: File doesn\'t exist.'
}

if (!args.path.includes('.')) {
// requested preview of directory
const children = await fs.readdir(args.path)
return children.join('\n')
return '|- ' + children.join('\n|- ')
}

const fileStats = fsSync.statSync(args.path)
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/components/BrowseUpComponent.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div
class="w-full h-min bg-slate-700 border-2 border-slate-600 p-3 flex justify-start items-center space-x-5 cursor-pointer hover:bg-slate-600"
class="w-full h-min bg-slate-700 border-2 border-slate-600 p-3 flex justify-start items-center space-x-5 cursor-pointer hover:bg-slate-600 select-none"
@click="handleClick"
>
<h1>..</h1>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/components/FsEntryComponent.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div
class="w-full h-min bg-slate-700 border-2 border-slate-600 p-3 flex justify-start items-center space-x-5 cursor-pointer hover:bg-slate-600"
class="w-full h-min bg-slate-700 border-2 border-slate-600 p-3 flex justify-start items-center space-x-5 cursor-pointer hover:bg-slate-600 select-none"
:class="{ 'bg-slate-800': fsEntry.isHidden }"
@click="handleClick"
>
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/src/views/BrowserView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
@handle-click="handleClick(fsEntry)"
/>
</ScrollComponent>
<div v-if="selectedFsEntry" class="w-1/3 bg-slate-700 space-y-[2vh]">
<div v-if="selectedFsEntry" class="w-1/3 space-y-[2vh]">
<ScrollComponent axis="vertical" class="h-[49vh]">
<ContextMenuComponent :fs-entry="selectedFsEntry" />
</ScrollComponent>
<div class="h-[2vh] bg-slate-600"></div>
<ScrollComponent axis="both" class="h-[49vh]">
<PreviewComponent :fs-entry="selectedFsEntry" />
</ScrollComponent>
Expand Down

0 comments on commit 8cc4936

Please sign in to comment.