Merge remote-tracking branch 'origin/main' into feat/onboarding-wizard

This commit is contained in:
Marc-André Bombeck committed 2026-09-10 20:53:38 +02:00
commit 8ed46eef58
49 files changed
+3199 -307

No files matched your search

+14 -2
View File
@@ -72,8 +72,20 @@ export function NtfyCard({ isAuthenticated }: { isAuthenticated: boolean }) {
}),
});
if (!res.ok) {
const json = await res.json();
throw new Error(json.error || t("common.error"));
const json = (await res.json()) as {
error?: string;
meta?: { errorCode?: string };
};
// A coded refusal (the private-origin policy) translates like the
// test button's; anything else shows the server sentence.
const code = json.meta?.errorCode;
const key = code ? `settings.testConnection.errors.${code}` : null;
const translated = key ? t(key) : null;
throw new Error(
translated && translated !== key
? translated
: json.error || t("common.error"),
);
}
},
onSuccess: () => {
+14 -2
View File
@@ -72,8 +72,20 @@ export function WebhookCard({ isAuthenticated }: { isAuthenticated: boolean }) {
}),
});
if (!res.ok) {
const json = await res.json();
throw new Error(json.error || t("common.error"));
const json = (await res.json()) as {
error?: string;
meta?: { errorCode?: string };
};
// A coded refusal (the private-origin policy) translates like the
// test button's; anything else shows the server sentence.
const code = json.meta?.errorCode;
const key = code ? `settings.testConnection.errors.${code}` : null;
const translated = key ? t(key) : null;
throw new Error(
translated && translated !== key
? translated
: json.error || t("common.error"),
);
}
},
onSuccess: () => {