summaryrefslogtreecommitdiffhomepage
path: root/app/lib
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@codeispoetry.ru>2017-03-17 13:00:07 +0000
committerAndrej Mihajlov <and@codeispoetry.ru>2017-03-17 13:00:07 +0000
commitecdc49cc5866631aef05c5ffab91e46ff907bc36 (patch)
tree7e01663f6489fbc2c89315f846012e2d6b97b647 /app/lib
parent3f44c0681bf6786a3fe6b6a0ded129028c8d1f7d (diff)
downloadmullvadvpn-ecdc49cc5866631aef05c5ffab91e46ff907bc36.tar.xz
mullvadvpn-ecdc49cc5866631aef05c5ffab91e46ff907bc36.zip
Update tray assets and hide spinner when window is visible
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/tray-icon-manager.js19
1 files changed, 16 insertions, 3 deletions
diff --git a/app/lib/tray-icon-manager.js b/app/lib/tray-icon-manager.js
index 3e25c6cf85..e22ac231f2 100644
--- a/app/lib/tray-icon-manager.js
+++ b/app/lib/tray-icon-manager.js
@@ -53,6 +53,7 @@ export default class TrayIconManager {
/**
* Get current icon type
+ * @type {TrayIconType}
* @memberOf TrayIconManager
*/
get iconType() {
@@ -61,16 +62,28 @@ export default class TrayIconManager {
/**
* Set current icon type
+ * @type {TrayIconType}
* @memberOf TrayIconManager
*/
set iconType(type) {
+ this.updateIconType(type, false);
+ }
+
+ /**
+ * Set current icon type with options
+ *
+ * @param {TrayIconType} type - new icon type
+ * @param {bool} skipAnimation - pass true to skip animation to last frame. Has no effect on repeating animations.
+ * @returns
+ *
+ * @memberOf TrayIconManager
+ */
+ updateIconType(type, skipAnimation) {
// no-op if same animator requested
if(this._iconType === type) { return; }
// do not animate if setting icon for the first time
- const skipAnimation = this._iconType === null;
-
- this._updateType(type, skipAnimation);
+ this._updateType(type, this._iconType === null || skipAnimation);
}
/**