diff --git a/src/views/FormImport.ts b/src/views/FormImport.ts index 52d49ef..2f0b485 100644 --- a/src/views/FormImport.ts +++ b/src/views/FormImport.ts @@ -1,9 +1,9 @@ -import * as J from "fp-ts/Json"; import { O, type Option, ensureError, pipe } from "@std"; import * as E from "fp-ts/Either"; +import * as J from "fp-ts/Json"; +import { FormDefinition } from "src/core/formDefinition"; import { InvalidData, MigrationError, migrateToLatest } from "src/core/formDefinitionSchema"; import { Readable, writable } from "svelte/store"; -import { FormDefinition } from "src/core/formDefinition"; type State = E.Either>; type UiState = { @@ -44,7 +44,7 @@ function matchState(state: State, matchers: Matchers): T { function noop() {} -export function makeFormInputModel({ createForm }: FormImportDeps): FormImportModel { +export function makeFormImportModel({ createForm }: FormImportDeps): FormImportModel { const state = writable(E.of(O.none)); const setErrors = (errors: string[]) => state.set(E.left(errors)); const resetState = () => state.set(E.of(O.none)); diff --git a/src/views/FormImportView.ts b/src/views/FormImportView.ts index bf08b6e..8e242f7 100644 --- a/src/views/FormImportView.ts +++ b/src/views/FormImportView.ts @@ -1,6 +1,6 @@ import { App, Modal } from "obsidian"; +import { FormImportDeps, makeFormImportModel } from "./FormImport"; import FormImport from "./FormImport.svelte"; -import { FormImportDeps, makeFormInputModel } from "./FormImport"; /** * This class is just the minimum glue code to bind our core logic * with the svelte UI and obsidian API modal. @@ -23,7 +23,7 @@ export class FormImportModal extends Modal { const { contentEl } = this; this._component = new FormImport({ target: contentEl, - props: { model: makeFormInputModel(this.deps) }, + props: { model: makeFormImportModel(this.deps) }, }); } }