summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@codeispoetry.ru>2017-03-16 16:12:58 +0000
committerAndrej Mihajlov <and@codeispoetry.ru>2017-03-16 16:12:58 +0000
commit4f4144487a076f6a05e3fa7babcb2232719d6b3d (patch)
tree0e93faac914ff0f4c4d6dc34c1baa376e9a19483
parentbb1d4b2d864664ebce9a6c51a8383483df9ee107 (diff)
downloadmullvadvpn-4f4144487a076f6a05e3fa7babcb2232719d6b3d.tar.xz
mullvadvpn-4f4144487a076f6a05e3fa7babcb2232719d6b3d.zip
Add support for NativeImage
-rw-r--r--app/lib/tray-animator.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/lib/tray-animator.js b/app/lib/tray-animator.js
index b018a67a56..75a4079112 100644
--- a/app/lib/tray-animator.js
+++ b/app/lib/tray-animator.js
@@ -66,7 +66,15 @@ export class TrayAnimation {
assert(images.length > 0);
this._source = images.slice();
- this._nativeImages = images.map(path => nativeImage.createFromPath(path))
+ this._nativeImages = images.map((pathOrNativeImage) => {
+ if(typeof(pathOrNativeImage) === 'string') {
+ return nativeImage.createFromPath(path);
+ } else if(typeof(pathOrNativeImage) === 'NativeImage') {
+ return pathOrNativeImage;
+ }
+ return nativeImage.createEmpty();
+ });
+
this._speed = 200; // ms
this._repeat = false;
this._reverse = false;