make dev setup better (#116)

* make dev setup better

* chage docs

* remove the need of github login
This commit is contained in:
KM Koushik
2025-03-17 21:33:43 +11:00
committed by GitHub
parent 8b9d81ab2a
commit 0a1d93ac60
13 changed files with 129 additions and 74 deletions

View File

@@ -17,6 +17,7 @@ import { Input } from "@unsend/ui/src/input";
import { Button } from "@unsend/ui/src/button";
import Spinner from "@unsend/ui/src/spinner";
import { toast } from "@unsend/ui/src/toaster";
import { isLocalhost } from "~/utils/client";
const FormSchema = z.object({
region: z.string(),
@@ -65,14 +66,16 @@ export const AddSesSettingsForm: React.FC<SesSettingsProps> = ({
});
function onSubmit(data: z.infer<typeof FormSchema>) {
if (!data.unsendUrl.startsWith("https://")) {
const localhost = isLocalhost();
if (!data.unsendUrl.startsWith("https://") && !localhost) {
form.setError("unsendUrl", {
message: "URL must start with https://",
});
return;
}
if (data.unsendUrl.includes("localhost")) {
if (data.unsendUrl.includes("localhost") && !localhost) {
form.setError("unsendUrl", {
message: "URL must be a valid url",
});