diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/handler.ts | 19 | ||||
| -rw-r--r-- | src/lib/translations/index.js | 8 | ||||
| -rw-r--r-- | src/lib/types.ts | 22 |
3 files changed, 31 insertions, 18 deletions
diff --git a/src/lib/handler.ts b/src/lib/handler.ts index 03795ad9..559761f0 100644 --- a/src/lib/handler.ts +++ b/src/lib/handler.ts @@ -1,14 +1,13 @@ import { goto } from "$app/navigation"; import { applyAction } from "$app/forms"; -export default (submitting) => - () => { - submitting = true; - return async ({ result }) => { - if (result.type === "redirect") { - goto(result.location); - } else { - await applyAction(result); - } - }; +export default (toggle) => () => { + toggle(); + return async ({ result }) => { + if (result.type === "redirect") { + goto(result.location); + } else { + await applyAction(result); + } }; +}; diff --git a/src/lib/translations/index.js b/src/lib/translations/index.js index ae2fcedf..cd7c20dd 100644 --- a/src/lib/translations/index.js +++ b/src/lib/translations/index.js @@ -1,17 +1,9 @@ import i18n from "sveltekit-i18n"; -import lang from "./lang.json"; - -const availableLocales = Object.keys(lang); -const trans = {}; -for (let i = 0; i < availableLocales.length; i++) { - trans[availableLocales[i]] = { lang }; -} export const defaultLocale = "en"; const config = { fallbackLocale: "en", - translations: trans, loaders: [ { locale: "en", diff --git a/src/lib/types.ts b/src/lib/types.ts new file mode 100644 index 00000000..33f78c85 --- /dev/null +++ b/src/lib/types.ts @@ -0,0 +1,22 @@ +export interface Message { + author: User; + created_at: number; + recipient: User; +} + +export interface Note { + created_at: number; + seen: number; +} + +export interface User { + id: string; +} + +export interface Invoice { + id?: string; + memoPrompt?: boolean; + memo?: string; + rate: number; + type: string; +} |
