Skip to content

Commit

Permalink
organize more files, remove stayOnTop from mainWindow
Browse files Browse the repository at this point in the history
  • Loading branch information
RenanSui committed Sep 20, 2023
1 parent 9c8be6e commit 2bf7caa
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
13 changes: 8 additions & 5 deletions src/main/copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,29 @@ export const filterDirectory = async (srcDir: string, destDir: string) => {
try {
const srcDirStatus = fse.lstatSync(srcDir)

// return false if is a symbolic link
if (srcDirStatus.isSymbolicLink()) {
return false
}

const isSourceDir = srcDirStatus.isDirectory()

if (isSourceDir) {
// return true if is a dir
if (isSourceDir === true) {
if (!fse.existsSync(destDir)) fse.mkdirSync(destDir, { recursive: true })
// console.log('is a Dir')
return true
}

if (fse.existsSync(destDir) === false) {
// console.log('do not exist')
const dirExist = fse.existsSync(destDir)

// return true if do not exist
if (dirExist === false) {
return true
}

const isSimilar = await getSimilarity(srcDir, destDir)

// Not a dir, file exist and is not similar to each other
// return true if files are not similar
if (isSimilar === false) {
return true
}
Expand Down
1 change: 0 additions & 1 deletion src/main/createWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export const createWindow = () => {
resizable: false,
fullscreenable: false,
transparent: true,
alwaysOnTop: true,
show: false,
autoHideMenuBar: true,
icon: iconPath,
Expand Down
2 changes: 2 additions & 0 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ app.whenReady().then(() => {
mainWindow = windowInstance
tray = trayInstance

mainWindow.hide()

// check for updates
updateInterval = setInterval(() => autoUpdater.checkForUpdates(), 1000 * 600) // every 10 minutes
})
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/src/components/title-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ const TitleBar = ({
onClick={() => setShowMenu((prev) => !prev)}
>
{showMenu ? (
<Icons.chevronLeft className="text-white group-hover:text-green-300 stroke-[1.5]" />
<Icons.chevronLeft className="text-white group-hover:text-green-300 stroke-[1.5] mx-1" />
) : (
<Icons.alignLeft className="text-white group-hover:text-green-300 stroke-2" />
<Icons.alignLeft className="text-white group-hover:text-green-300 stroke-2 mx-1" />
)}
</IconShell>

Expand Down

0 comments on commit 2bf7caa

Please sign in to comment.