Skip to content

Commit

Permalink
revert electron to previous version
Browse files Browse the repository at this point in the history
  • Loading branch information
averissimo committed May 7, 2020
1 parent f7b9774 commit 68cc15d
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 36 deletions.
48 changes: 23 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"chai": "^4.2.0",
"coffeescript": "^1.9.3",
"devtron": "^1.4.0",
"electron": "^8.0.0",
"electron": "^7.1.7",
"electron-packager": "^14.1.1",
"gulp": "^4.0.2",
"gulp-changed": "^4.0.2",
Expand Down
3 changes: 1 addition & 2 deletions src/ui/views/messages.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,7 @@ drawMessage = (e, entity) ->
mclz = ['message']
mclz.push c for c in MESSAGE_CLASSES when e[c]?
title = if e.timestamp then moment(e.timestamp / 1000).calendar() else null
div id:e.event_id, key:e.event_id, class:mclz.join(' '), title:title,
dir: 'auto', ->
div id:e.event_id, key:e.event_id, class:mclz.join(' '), title:title, dir: 'auto', ->
if e.chat_message
content = e.chat_message?.message_content
format content
Expand Down
19 changes: 11 additions & 8 deletions src/ui/views/trayicon.coffee
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
{nativeImage} = require("electron");
path = require 'path'
os = require 'os'
i18n = require 'i18n'

{ Menu, Tray, nativeImage } = require('electron').remote

if os.platform() == 'darwin'
trayIcons =
trayIconsPath =
"read": path.join __dirname, '..', '..', 'icons', 'osx-icon-read-Template.png'
"unread": path.join __dirname, '..', '..', 'icons', 'osx-icon-unread-Template.png'

else if process.env.XDG_CURRENT_DESKTOP && process.env.XDG_CURRENT_DESKTOP.match(/KDE/)
# This is to work around a bug with electron apps + KDE not showing correct icon size.
trayIcons =
trayIconsPath =
"read": path.join __dirname, '..', '..', 'icons', '[email protected]'
"unread": path.join __dirname, '..', '..', 'icons', '[email protected]'

else
trayIcons =
trayIconsPath =
"read": path.join __dirname, '..', '..', 'icons', '[email protected]'
"unread": path.join __dirname, '..', '..', 'icons', '[email protected]'

trayIcons =
"read": nativeImage.createFromPath(trayIconsPath["read"])
"unread": nativeImage.createFromPath(trayIconsPath["unread"])

tray = null

# TODO: this is all WIP
Expand All @@ -29,15 +32,15 @@ quit = ->
compact = (array) -> item for item in array when item

create = () ->
tray = new Tray(nativeImage.createEmpty());
tray.setImage(nativeImage.createFromPath(trayIcons["read"]));
tray = new Tray trayIcons["read"]
tray.currentImage = 'read'
tray.setToolTip i18n.__('title:YakYak - Hangouts Client')
# Emitted when the tray icon is clicked
tray.on 'click', -> action 'togglewindow'

destroy = ->
tray.destroy() if tray
console.log('is Destroyed', tray.isDestroyed())
tray = null

update = (unreadCount, viewstate) ->
Expand Down Expand Up @@ -91,10 +94,10 @@ update = (unreadCount, viewstate) ->
# update icon
try
if unreadCount > 0
tray.setImage nativeImage.createFromPath(trayIcons["unread"]) unless tray.currentImage == 'unread'
tray.setImage trayIcons["unread"] unless tray.currentImage == 'unread'
tray.currentImage = 'unread'
else
tray.setImage nativeImage.createFromPath(trayIcons["read"]) unless tray.currentImage == 'read'
tray.setImage trayIcons["read"] unless tray.currentImage == 'read'
tray.currentImage = 'read'
catch e
console.log 'missing icons', e
Expand Down

0 comments on commit 68cc15d

Please sign in to comment.