Skip to content

Commit

Permalink
Merge pull request #60 from zkemail/chore/small-enhancements
Browse files Browse the repository at this point in the history
Chore/small enhancements
  • Loading branch information
javiersuweijie authored Oct 24, 2024
2 parents ca2d63a + f712d0e commit 7cf9d0d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/app/src/app/submit/email/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export async function processEmail(values: z.infer<typeof formSchema>, email: st
}
headerString = result.headers.toString();
const headerLength = result.headers.length;
const maxHeaderLength = Math.ceil(headerLength / 64) * 64;
const maxHeaderLength = (Math.ceil(headerLength / 64) + 2) * 64;
const domain = result.signingDomain;
const selector = result.selector;
res = {
Expand Down Expand Up @@ -65,7 +65,7 @@ export async function processEmail(values: z.infer<typeof formSchema>, email: st
}
splitBodyString = split[1];
}
const maxBodyLength = Math.ceil(splitBodyString.length / 64) * 64;
const maxBodyLength = (Math.ceil(splitBodyString.length / 64) + 2) * 64;
res = {
...res,
maxBodyLength,
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/app/try/[[...slug]]/content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ export function PageContent(props: ContentProps) {
<h2 className="text-3xl md:text-5xl tracking-tighter text-left font-extrabold mb-6">
{entry.slug}
</h2>
<p>{entry.description}</p>
<h4 className="text-xl md:text-2xl tracking-tighter text-left font-extrabold mb-4 mt-4">
Step 1: Provide an email sample
</h4>
Expand Down
3 changes: 2 additions & 1 deletion packages/app/src/components/entry-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ export function EntryForm({ onFormSubmit, entry }: EntryFormProps) {

function uploadEmail(e: FormEvent<HTMLInputElement>) {
if (e.currentTarget.files) {
setIsProcessingEmail(false);
for (let i = 0; i < e.currentTarget.files.length; i++) {
const file = e.currentTarget.files[i];
const reader = new FileReader();
Expand Down Expand Up @@ -543,7 +544,7 @@ export function EntryForm({ onFormSubmit, entry }: EntryFormProps) {
{fields.map((v, i) => {
return (
<div className='pl-8 pb-4' key={v.id}>
<div className="flex flex-row items-center"><b>Field #{i + 1}</b>{(maskingEnabled || i !== 0) && <Trash color="red" className="ml-2" onClick={() => removeValueObject(i)} />}</div>
<div className="flex flex-row items-center"><b>Field #{i + 1}</b> <Trash color="red" className="ml-2" onClick={() => removeValueObject(i)} /></div>
<FormField
control={form.control}
name={`parameters.values.${i}.name`}
Expand Down

0 comments on commit 7cf9d0d

Please sign in to comment.