commit 178335fd6e8793e54e89d51cb877e9a53cbce4b3
parent 58bf026a4cd08235ac05a202b864038a7e85601c
Author: Sebastian <sebasjm@gmail.com>
Date: Tue, 15 Apr 2025 07:20:25 -0300
fix firefox reverts when clicking 'download pdf'
Diffstat:
4 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/packages/challenger-ui/src/pages/AnswerChallenge.tsx b/packages/challenger-ui/src/pages/AnswerChallenge.tsx
@@ -150,7 +150,7 @@ export function AnswerChallenge({
case HttpStatusCode.TooManyRequests:
return i18n.str`There have been too many attempts to request challenge transmissions.`;
case HttpStatusCode.InternalServerError:
- return i18n.str`Server is not able to respond due to internal problems.`;
+ return i18n.str`Server is unable to respond due to internal problems.`;
}
},
);
@@ -189,7 +189,7 @@ export function AnswerChallenge({
return i18n.str`There have been too many attempts to request challenge transmissions.`;
}
case HttpStatusCode.InternalServerError:
- return i18n.str`Server is not able to respond due to internal problems.`;
+ return i18n.str`Server is unable to respond due to internal problems.`;
default:
assertUnreachable(fail);
}
diff --git a/packages/challenger-ui/src/pages/AskChallenge.tsx b/packages/challenger-ui/src/pages/AskChallenge.tsx
@@ -187,7 +187,7 @@ export function AskChallenge({
case HttpStatusCode.TooManyRequests:
return i18n.str`There have been too many attempts to request challenge transmissions.`;
case HttpStatusCode.InternalServerError:
- return i18n.str`Server is not able to respond due to internal problems.`;
+ return i18n.str`Server is unable to respond due to internal problems.`;
}
},
);
diff --git a/packages/web-util/src/forms/fields/InputDownloadLink.tsx b/packages/web-util/src/forms/fields/InputDownloadLink.tsx
@@ -36,6 +36,7 @@ export function InputDownloadLink(props: Props & UIFormProps<boolean>): VNode {
href="#"
class="underline text-blue-600 hover:text-blue-900 visited:text-purple-600"
onClick={(e) => {
+ e.preventDefault();
onChange(true);
return (
fetch(url, {
diff --git a/packages/web-util/src/index.build.ts b/packages/web-util/src/index.build.ts
@@ -262,6 +262,16 @@ export function computeConfig(params: BuildParams): {
baseDir,
} = getPackageAndGitRoot(params.importMeta);
+ if (!params.type) {
+ throw Error(
+ `missing build type, it should be "test", "development" or "production"`,
+ );
+ }
+
+ if (!params.destination) {
+ throw Error(`missing destination folder`);
+ }
+
const plugins: Array<esbuild.Plugin> = [
copyFilesPlugin(params.source.assets),
];
@@ -290,18 +300,6 @@ export function computeConfig(params: BuildParams): {
}
}
}
- if (!params.type) {
- throw Error(
- `missing build type, it should be "test", "development" or "production"`,
- );
- }
-
- // if (!params.source.js) {
- // throw Error(`no javascript entry points, nothing to compile?`);
- // }
- if (!params.destination) {
- throw Error(`missing destination folder`);
- }
const esBuildOptions: esbuild.BuildOptions = {
...defaultEsBuildConfig,
@@ -329,7 +327,7 @@ export function computeConfig(params: BuildParams): {
export async function build(config: BuildParams) {
const { esBuildOptions, pkg } = computeConfig(config);
const res = await esbuild.build(esBuildOptions);
- fs.writeFileSync(`${config.destination}/version.txt`, pkg.version);
+ fs.writeFileSync(`${esBuildOptions.outdir}/version.txt`, pkg.version);
return res;
}