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 content = getValues().content;
const position = textAreaRef.current?.getCaretPosition(); const position = textAreaRef.current?.getCaretPosition();
if (position !== undefined) { if (position !== undefined) {
setValue("content", content.slice(0, position) + imageUrl + content.slice(position)); setValue("content", content.slice(0, position) + imageUrl + " " + content.slice(position));
} else setValue("content", content + imageUrl); } else setValue("content", content + imageUrl + " ");
} catch (e) { } catch (e) {
if (e instanceof Error) toast({ description: e.message, status: "error" }); 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 = {}; const headers: HeadersInit = {};
if (sign) { if (sign) {
// @ts-ignore // @ts-ignore
const token = await nip98.getToken(url, "post", sign, true); const token = await nip98.getToken(url, "POST", sign, true);
headers.Authorization = token; headers.Authorization = token;
} }