fix NIP-98 token

This commit is contained in:
hzrd149
2023-09-29 19:54:05 -05:00
parent d82fe489fc
commit 8e44b7ab04
2 changed files with 3 additions and 3 deletions

View File

@@ -81,8 +81,8 @@ export default function PostModal({
const content = getValues().content;
const position = textAreaRef.current?.getCaretPosition();
if (position !== undefined) {
setValue("content", content.slice(0, position) + imageUrl + content.slice(position));
} else setValue("content", content + imageUrl);
setValue("content", content.slice(0, position) + imageUrl + " " + content.slice(position));
} else setValue("content", content + imageUrl + " ");
} catch (e) {
if (e instanceof Error) toast({ description: e.message, status: "error" });
}

View File

@@ -42,7 +42,7 @@ export async function nostrBuildUploadImage(image: File, sign?: (draft: DraftNos
const headers: HeadersInit = {};
if (sign) {
// @ts-ignore
const token = await nip98.getToken(url, "post", sign, true);
const token = await nip98.getToken(url, "POST", sign, true);
headers.Authorization = token;
}