Ver código fonte

Add alert message for invalid actions

rohit.gowda 4 anos atrás
pai
commit
77e102c02b
1 arquivos alterados com 4 adições e 1 exclusões
  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();
       this.publishPrivateKey();
     }
     }
     else{
     else{
-      this.createAlert("No Keys","No keys to save!");
+      this.createAlert("No Keys","Please generate the keypair before saving!");
     }
     }
   }
   }
 
 
   async publishPublicKey() {
   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);
     await this.openpgp.publishPubKey(this.publicKey);
     this.showToast("Publc key published");
     this.showToast("Publc key published");