summaryrefslogtreecommitdiffhomepage
path: root/app/lib
diff options
context:
space:
mode:
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/backend.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/lib/backend.js b/app/lib/backend.js
index b043a9b10e..dfe4fdd2c3 100644
--- a/app/lib/backend.js
+++ b/app/lib/backend.js
@@ -365,6 +365,25 @@ export class Backend {
}
}
+ async updateAccountExpiry() {
+ const ipc = this._ipc;
+ const store = this._store;
+
+ try {
+ await this._ensureAuthenticated();
+
+ const accountToken = await this._ipc.getAccount();
+ if (!accountToken) {
+ throw new BackendError('NO_ACCOUNT');
+ }
+
+ const accountData = await ipc.getAccountData(accountToken);
+ store.dispatch(accountActions.updateAccountExpiry(accountData.expiry));
+ } catch (e) {
+ log.error(`Failed to update account expiry: ${e.message}`);
+ }
+ }
+
async removeAccountFromHistory(accountToken: AccountToken) {
try {
await this._ensureAuthenticated();