🐛 Hide feedback toggle on self-hosted instances and use correct from address

This commit is contained in:
Luke Vella 2025-05-17 16:52:45 +01:00
parent 2a88b8d610
commit bb0a58ca12
No known key found for this signature in database
GPG key ID: 469CAD687F0D784C
2 changed files with 9 additions and 1 deletions

View file

@ -24,11 +24,16 @@ import { useForm } from "react-hook-form";
import { Trans } from "@/components/trans"; import { Trans } from "@/components/trans";
import { isSelfHosted } from "@/utils/constants";
import { submitFeedback } from "../actions"; import { submitFeedback } from "../actions";
import type { Feedback } from "../schema"; import type { Feedback } from "../schema";
import { feedbackSchema } from "../schema"; import { feedbackSchema } from "../schema";
export function FeedbackToggle() { export function FeedbackToggle() {
if (isSelfHosted) {
return null;
}
const form = useForm<Feedback>({ const form = useForm<Feedback>({
resolver: zodResolver(feedbackSchema), resolver: zodResolver(feedbackSchema),
}); });

View file

@ -140,7 +140,10 @@ export class EmailClient {
} }
try { try {
await this.transport.sendMail(options); await this.transport.sendMail({
...options,
from: options.from || this.config.mail.from,
});
return; return;
} catch (e) { } catch (e) {
console.error("Error sending email", e); console.error("Error sending email", e);