12345678910111213141516171819202122232425262728293031323334353637383940 |
- import { Component } from "@angular/core";
- import { NavController, ToastController } from "ionic-angular";
- import { Storage } from "@ionic/storage";
- @Component({
- selector: "page-settings",
- templateUrl: "settings.html"
- })
- export class SettingsPage {
- keywords: string;
- privateKey: string;
- publicKey: string;
- constructor(
- public navCtrl: NavController,
- public toastCtrl: ToastController,
- private storage: Storage
- ) {
- this.loadValuesFromStorage();
- }
- async loadValuesFromStorage() {
- this.privateKey = await this.storage.get("privateKey");
- this.publicKey = await this.storage.get("publicKey");
- this.keywords = await this.storage.get("keywords");
- }
- save() {
- this.storage.set("publicKey", this.publicKey);
- this.storage.set("privateKey", this.privateKey);
- this.storage.set("keywords", this.keywords);
- const toast = this.toastCtrl.create({
- message: "Successfully saved!",
- position: "bottom",
- duration: 3000
- });
- toast.present();
- }
- }
|