Skip to content

Commit

Permalink
fix NIP-98 token
Browse files Browse the repository at this point in the history
  • Loading branch information
hzrd149 committed Sep 30, 2023
1 parent d82fe48 commit 8e44b7a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/post-modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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" });
}
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/nostr-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 8e44b7a

Please sign in to comment.