[NEW] Adds extra validation on minimizing or restoring the window (#544)
[NEW] Adds extra validation on minimizing or restoring the window (#544)

* Adds extra option to trigger change in tray icon

When minimizing/restoring the window it doesn't fire the "open/close" events,
so if you minimize it and right-click the tray icon you will see "Hide" option,
clicking it won't change anything as the window is already hidden

* Removes console.log

* On clicking and window visible, should close it

if window is visible left-click should hide it

RocketChat/Rocket.Chat.Electron,RocketChat/Rocket.Chat.Electron,RocketChat/Rocket.Chat.Electron