+{nativeImage} = require("electron");
 path = require 'path'
 os   = require 'os'
 i18n = require 'i18n'

compact = (array) -> item for item in array when item

create = () ->
    tray = new Tray trayIcons["read"]
    tray.currentImage = 'read'
    tray.setToolTip i18n.__('title:YakYak - Hangouts Client')
    # Emitted when the tray icon is clicked

    # update icon
    try
        if unreadCount > 0
            tray.setImage nativeImage.createFromPath(trayIcons["unread"]) unless tray.currentImage == 'unread'
            tray.currentImage = 'unread'
        else
            tray.setImage nativeImage.createFromPath(trayIcons["read"]) unless tray.currentImage == 'read'
            tray.currentImage = 'read'
    catch e
        console.log 'missing icons', e
