diff --git a/frontend/src/lib/ui/AdvancedParameters.svelte b/frontend/src/lib/ui/AdvancedParameters.svelte
new file mode 100644
index 0000000..4dceecf
--- /dev/null
+++ b/frontend/src/lib/ui/AdvancedParameters.svelte
@@ -0,0 +1,47 @@
+
+
+
+
+ ($status && v < $status?.max_views) ||
+ $t('home.errors.max', { values: { n: $status?.max_views ?? 0 } })}
+ />
+
+
+
+
+ ($status && v < $status?.max_expiration) ||
+ $t('home.errors.max', { values: { n: $status?.max_expiration ?? 0 } })}
+ />
+
+
+
diff --git a/frontend/src/lib/ui/Loader.svelte b/frontend/src/lib/ui/Loader.svelte
new file mode 100644
index 0000000..313485c
--- /dev/null
+++ b/frontend/src/lib/ui/Loader.svelte
@@ -0,0 +1,41 @@
+
+
+
diff --git a/frontend/src/lib/views/Create.svelte b/frontend/src/lib/views/Create.svelte
index 94a2e43..2130128 100644
--- a/frontend/src/lib/views/Create.svelte
+++ b/frontend/src/lib/views/Create.svelte
@@ -7,13 +7,14 @@
import { create, PayloadToLargeError } from '$lib/api'
import { Crypto, Hex } from '$lib/crypto'
import { status } from '$lib/stores/status'
+ import AdvancedParameters from '$lib/ui/AdvancedParameters.svelte'
import Button from '$lib/ui/Button.svelte'
import FileUpload from '$lib/ui/FileUpload.svelte'
+ import Loader from '$lib/ui/Loader.svelte'
import MaxSize from '$lib/ui/MaxSize.svelte'
import Result, { type NoteResult } from '$lib/ui/NoteResult.svelte'
import Switch from '$lib/ui/Switch.svelte'
import TextArea from '$lib/ui/TextArea.svelte'
- import TextInput from '$lib/ui/TextInput.svelte'
let note: Note = {
contents: '',
@@ -27,7 +28,7 @@
let isFile = false
let timeExpiration = false
let description = ''
- let loading = false
+ let loading: string | null = null
let error: string | null = null
$: if (!advanced) {
@@ -56,7 +57,7 @@
async function submit() {
try {
error = null
- loading = true
+ loading = $t('common.encrypting')
const password = Hex.encode(Crypto.getRandomBytes(32))
const key = await Crypto.getKeyFromString(password)
@@ -75,6 +76,7 @@
if (timeExpiration) data.expiration = parseInt(note.expiration as any)
else data.views = parseInt(note.views as any)
+ loading = $t('common.uploading')
const response = await create(data)
result = {
password: password,
@@ -90,7 +92,7 @@
error = $t('home.errors.note_error')
}
} finally {
- loading = false
+ loading = null
}
}
@@ -102,7 +104,7 @@
{@html $status?.theme_text || $t('home.intro')}