mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-09-29 04:52:59 +02:00
fix NIP-98 token
This commit is contained in:
@@ -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" });
|
||||||
}
|
}
|
||||||
|
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user