Skip to content

Commit 68cc15d

Browse files
committed
revert electron to previous version
1 parent f7b9774 commit 68cc15d

File tree

4 files changed

+36
-36
lines changed

4 files changed

+36
-36
lines changed

package-lock.json

+23-25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"chai": "^4.2.0",
8080
"coffeescript": "^1.9.3",
8181
"devtron": "^1.4.0",
82-
"electron": "^8.0.0",
82+
"electron": "^7.1.7",
8383
"electron-packager": "^14.1.1",
8484
"gulp": "^4.0.2",
8585
"gulp-changed": "^4.0.2",

src/ui/views/messages.coffee

+1-2
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,7 @@ drawMessage = (e, entity) ->
246246
mclz = ['message']
247247
mclz.push c for c in MESSAGE_CLASSES when e[c]?
248248
title = if e.timestamp then moment(e.timestamp / 1000).calendar() else null
249-
div id:e.event_id, key:e.event_id, class:mclz.join(' '), title:title,
250-
dir: 'auto', ->
249+
div id:e.event_id, key:e.event_id, class:mclz.join(' '), title:title, dir: 'auto', ->
251250
if e.chat_message
252251
content = e.chat_message?.message_content
253252
format content

src/ui/views/trayicon.coffee

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
1-
{nativeImage} = require("electron");
21
path = require 'path'
32
os = require 'os'
43
i18n = require 'i18n'
54

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

87
if os.platform() == 'darwin'
9-
trayIcons =
8+
trayIconsPath =
109
"read": path.join __dirname, '..', '..', 'icons', 'osx-icon-read-Template.png'
1110
"unread": path.join __dirname, '..', '..', 'icons', 'osx-icon-unread-Template.png'
1211

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

1918
else
20-
trayIcons =
19+
trayIconsPath =
2120
"read": path.join __dirname, '..', '..', 'icons', '[email protected]'
2221
"unread": path.join __dirname, '..', '..', 'icons', '[email protected]'
2322

23+
trayIcons =
24+
"read": nativeImage.createFromPath(trayIconsPath["read"])
25+
"unread": nativeImage.createFromPath(trayIconsPath["unread"])
26+
2427
tray = null
2528

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

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

3941
destroy = ->
4042
tray.destroy() if tray
43+
console.log('is Destroyed', tray.isDestroyed())
4144
tray = null
4245

4346
update = (unreadCount, viewstate) ->
@@ -91,10 +94,10 @@ update = (unreadCount, viewstate) ->
9194
# update icon
9295
try
9396
if unreadCount > 0
94-
tray.setImage nativeImage.createFromPath(trayIcons["unread"]) unless tray.currentImage == 'unread'
97+
tray.setImage trayIcons["unread"] unless tray.currentImage == 'unread'
9598
tray.currentImage = 'unread'
9699
else
97-
tray.setImage nativeImage.createFromPath(trayIcons["read"]) unless tray.currentImage == 'read'
100+
tray.setImage trayIcons["read"] unless tray.currentImage == 'read'
98101
tray.currentImage = 'read'
99102
catch e
100103
console.log 'missing icons', e

0 commit comments

Comments
 (0)