evsar3 / sshfs-win-manager

A GUI for SSHFS-Win (https://github.com/billziss-gh/sshfs-win)
MIT License
1.11k stars 84 forks source link

Closing the window using Alt+F4 breaks the GUI #145

Open LoganDark opened 2 years ago

LoganDark commented 2 years ago

If you use Alt+F4 to close the window, then the window gets destroyed and the tray icon stops working. Clicking results in this:

image

TypeError: Cannot read property 'show' of null
    at Tray.<anonymous>
    at Tray.emit (events.js:182:13)

Closing the window using the X button works properly.

Henu3duka commented 2 years ago

+1

LoganDark commented 2 years ago

+1

Use reactions for this.

ace510 commented 2 years ago

lemme know if I should open a new issue, but I'm having this same exact error

LoganDark commented 2 years ago

Don't open a new issue if it's the same error

ace510 commented 2 years ago

it crashes really soon after it launches, if there are any filesystem logs I'm happy to paste them

LoganDark commented 2 years ago

it crashes really soon after it launches, if there are any filesystem logs I'm happy to paste them

That's a different problem

evsar3 commented 2 years ago

Hello guys!

It seems that when you close using ALT+F4 the window gets destroyed not only hidden as it should be. I will take a look.

LoganDark commented 2 years ago

Hello guys!

It seems that when you close using ALT+F4 the window gets destroyed not only hidden as it should be. I will take a look.

For Electron you should be listening to the window close event (and just calling window close when clicking the close button), not having the close button run special logic

evsar3 commented 2 years ago

This was my first and only program using Electron, so... I made a couple mistakes along the way. Including choosing a very outdated boilerplate... Now I have to almost completely redo this program. 😔

LoganDark commented 2 years ago

The program works pretty well in the meantime, so feel free to take your time. :P

Saumya-Gupta-26 commented 7 months ago

If anyone stumbles upon this in the future --- open task manager, search for sshfs and most likely it is running in the background. Kill it and launch again, it should work