summaryrefslogtreecommitdiffhomepage
path: root/app
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@codeispoetry.ru>2017-03-21 17:41:15 +0000
committerAndrej Mihajlov <and@codeispoetry.ru>2017-03-21 17:41:15 +0000
commite0b13a670f0e21fcca057b19afe45dc9d5312219 (patch)
tree8c417d7ae29e046555ab6abb43f668d7b1b163d4 /app
parentcbeba1ae2986360e9f699b71c06c16fe9ea3775e (diff)
downloadmullvadvpn-e0b13a670f0e21fcca057b19afe45dc9d5312219.tar.xz
mullvadvpn-e0b13a670f0e21fcca057b19afe45dc9d5312219.zip
Add Backend.hasCredits
Diffstat (limited to 'app')
-rw-r--r--app/lib/backend.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/lib/backend.js b/app/lib/backend.js
index d78504b1c8..242deabe9e 100644
--- a/app/lib/backend.js
+++ b/app/lib/backend.js
@@ -192,6 +192,19 @@ export default class Backend extends EventEmitter {
get paidUntil() { return this._paidUntil; }
/**
+ * Tells whether account has credits
+ *
+ * @type {bool}
+ * @readonly
+ *
+ * @memberOf Backend
+ */
+ get hasCredits() {
+ return this._paidUntil !== null &&
+ moment(this._paidUntil).isAfter(moment());
+ }
+
+ /**
* Server IP address or domain name
*
* @type {string}