Browse Source

Add alert message for invalid actions

rohit.gowda 4 years ago
parent
commit
77e102c02b
1 changed files with 4 additions and 1 deletions
  1. 4 1
      app/src/pages/settings/settings.ts

+ 4 - 1
app/src/pages/settings/settings.ts

@@ -97,11 +97,14 @@ export class SettingsPage {
       this.publishPrivateKey();
     }
     else{
-      this.createAlert("No Keys","No keys to save!");
+      this.createAlert("No Keys","Please generate the keypair before saving!");
     }
   }
 
   async publishPublicKey() {
+     if (!this.publicKey || !this.privateKey) {
+       this.createAlert("No Keypair to Publish","Please generate the keypair before trying to publish!");
+     }
     await this.openpgp.publishPubKey(this.publicKey);
     this.showToast("Publc key published");