diff --git a/src/allPages.ts b/src/allPages.ts index f17cb40..39ffc4f 100644 --- a/src/allPages.ts +++ b/src/allPages.ts @@ -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"; diff --git a/src/pages/SetVaultURL.js b/src/pages/SetVaultURL.ts similarity index 84% rename from src/pages/SetVaultURL.js rename to src/pages/SetVaultURL.ts index 4ed1b94..1ab06b3 100644 --- a/src/pages/SetVaultURL.js +++ b/src/pages/SetVaultURL.ts @@ -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"; } }