1
0
Fork 0

Add typing to SetVaultURL.ts.

This commit is contained in:
Kitteh 2021-05-08 01:57:08 +01:00
parent a9d3e8d1e7
commit ab3cc5fa70
2 changed files with 6 additions and 6 deletions

View file

@ -11,7 +11,7 @@ import { NewTOTPPage } from "./pages/TOTP/NewTOTP.js";
import { Page } from "./types/Page";
import { PwGenPage } from "./pages/PwGen";
import { SetLanguagePage } from "./pages/SetLanguage";
import { SetVaultURLPage } from "./pages/SetVaultURL.js";
import { SetVaultURLPage } from "./pages/SetVaultURL";
import { TOTPViewPage } from "./pages/TOTP/TOTPView.js";
import { TransitDecryptPage } from "./pages/Transit/TransitDecrypt.js";
import { TransitEncryptPage } from "./pages/Transit/TransitEncrypt.js";

View file

@ -1,13 +1,13 @@
import { Page } from "../types/Page";
import { changePage, setPageContent } from "../pageUtils";
import { makeElement } from "../htmlUtils";
import { pageState } from "../globalPageState.ts";
import { pageState } from "../globalPageState";
export class SetVaultURLPage extends Page {
constructor() {
super();
}
render() {
render(): void {
setPageContent(makeElement({
tag: "form",
id: "setVaultURLForm",
@ -43,12 +43,12 @@ export class SetVaultURLPage extends Page {
}));
document.getElementById("setVaultURLForm").addEventListener("submit", function (e) {
e.preventDefault();
let formData = new FormData(document.querySelector('#setVaultURLForm'));
pageState.apiURL = formData.get("vaultURL");
const formData = new FormData(document.querySelector('#setVaultURLForm'));
pageState.apiURL = formData.get("vaultURL") as string;
changePage("HOME");
});
}
get name() {
get name(): string {
return "Set Vault URL";
}
}