|
@@ -8,6 +8,7 @@ import {
|
|
import { Storage } from "@ionic/storage";
|
|
import { Storage } from "@ionic/storage";
|
|
import { CryptoProvider } from "../../providers/crypto/crypto";
|
|
import { CryptoProvider } from "../../providers/crypto/crypto";
|
|
import { SocialSharing } from "@ionic-native/social-sharing";
|
|
import { SocialSharing } from "@ionic-native/social-sharing";
|
|
|
|
+import { P2pDatabaseGunProvider } from "../../providers/p2p-database-gun/p2p-database-gun";
|
|
import { PgpKeyServerProvider } from "../../providers/pgp-key-server/pgp-key-server";
|
|
import { PgpKeyServerProvider } from "../../providers/pgp-key-server/pgp-key-server";
|
|
|
|
|
|
@Component({
|
|
@Component({
|
|
@@ -30,7 +31,8 @@ export class SettingsPage {
|
|
private loadingCtrl: LoadingController,
|
|
private loadingCtrl: LoadingController,
|
|
private sharing: SocialSharing,
|
|
private sharing: SocialSharing,
|
|
private alertCtrl: AlertController,
|
|
private alertCtrl: AlertController,
|
|
- private openpgp: PgpKeyServerProvider
|
|
|
|
|
|
+ private openpgp: PgpKeyServerProvider,
|
|
|
|
+ private gun: P2pDatabaseGunProvider,
|
|
) {
|
|
) {
|
|
this.loadValuesFromStorage();
|
|
this.loadValuesFromStorage();
|
|
|
|
|
|
@@ -95,12 +97,20 @@ export class SettingsPage {
|
|
this.storage.set("revocationCert", this.revocationCertificate);
|
|
this.storage.set("revocationCert", this.revocationCertificate);
|
|
this.storage.set("keywords", this.keywords ? this.keywords.trim() : "");
|
|
this.storage.set("keywords", this.keywords ? this.keywords.trim() : "");
|
|
|
|
|
|
|
|
+
|
|
this.showToast("Successfully saved!");
|
|
this.showToast("Successfully saved!");
|
|
}
|
|
}
|
|
|
|
|
|
async publishPublicKey() {
|
|
async publishPublicKey() {
|
|
await this.openpgp.publishPubKey(this.publicKey);
|
|
await this.openpgp.publishPubKey(this.publicKey);
|
|
this.showToast("Publc key published");
|
|
this.showToast("Publc key published");
|
|
|
|
+
|
|
|
|
+ const userId = await this.storage.get("userId");
|
|
|
|
+ console.log("userid is:",userId);
|
|
|
|
+ await this.gun.setEmail(userId, this.email);
|
|
|
|
+ //test if stored in gun
|
|
|
|
+ const email = await this.gun.getEmail(userId);
|
|
|
|
+ console.log("email:",email);
|
|
}
|
|
}
|
|
|
|
|
|
exportPrivateKey() {
|
|
exportPrivateKey() {
|