From 4210e4d14a5e821ac781f3288db54653b4396e90 Mon Sep 17 00:00:00 2001
From: Ryan Tharp <neuro@interx.net>
Date: Mon, 10 Feb 2020 20:14:01 -0800
Subject: [PATCH 1/2] fix no token detection conditions

---
 js/modules/loki_file_server_api.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/js/modules/loki_file_server_api.js b/js/modules/loki_file_server_api.js
index 9e097523b..8f1b530f8 100644
--- a/js/modules/loki_file_server_api.js
+++ b/js/modules/loki_file_server_api.js
@@ -240,12 +240,12 @@ class LokiFileServerInstance {
 // extends LokiFileServerInstance with functions we'd only perform on our own home server
 // so we don't accidentally send info to the wrong file server
 class LokiHomeServerInstance extends LokiFileServerInstance {
-  _setOurDeviceMapping(authorisations, isPrimary) {
+  async _setOurDeviceMapping(authorisations, isPrimary) {
     const content = {
       isPrimary: isPrimary ? '1' : '0',
       authorisations,
     };
-    if (!this.token) {
+    if (!this._server.token) {
       log.warn('_setOurDeviceMapping no token yet');
     }
     return this._server.setSelfAnnotation(
@@ -272,7 +272,7 @@ class LokiHomeServerInstance extends LokiFileServerInstance {
   // you only upload to your own home server
   // you can download from any server...
   uploadAvatar(data) {
-    if (!this.token) {
+    if (!this._server.token) {
       log.warn('uploadAvatar no token yet');
     }
     return this._server.uploadAvatar(data);

From 06672696909f8039e200e936b62b43dc11935dd2 Mon Sep 17 00:00:00 2001
From: Ryan Tharp <neuro@interx.net>
Date: Mon, 10 Feb 2020 20:15:15 -0800
Subject: [PATCH 2/2] remove unneeded async

---
 js/modules/loki_file_server_api.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/js/modules/loki_file_server_api.js b/js/modules/loki_file_server_api.js
index 8f1b530f8..1bd5fbc51 100644
--- a/js/modules/loki_file_server_api.js
+++ b/js/modules/loki_file_server_api.js
@@ -240,7 +240,7 @@ class LokiFileServerInstance {
 // extends LokiFileServerInstance with functions we'd only perform on our own home server
 // so we don't accidentally send info to the wrong file server
 class LokiHomeServerInstance extends LokiFileServerInstance {
-  async _setOurDeviceMapping(authorisations, isPrimary) {
+  _setOurDeviceMapping(authorisations, isPrimary) {
     const content = {
       isPrimary: isPrimary ? '1' : '0',
       authorisations,