fix: default nip96

This commit is contained in:
2024-09-12 14:56:06 +01:00
parent 736189d0d2
commit ce10d920f4
18 changed files with 139 additions and 417 deletions

View File

@ -261,7 +261,7 @@ export function NoteCreator() {
async function uploadFile(file: File) {
try {
if (file) {
if (file && uploader) {
const rx = await uploader.upload(file, file.name);
note.update(v => {
if (rx.header) {

View File

@ -10,10 +10,11 @@ import useFileUpload from "@/Utils/Upload";
interface AvatarEditorProps {
picture?: string;
onPictureChange?: (newPicture: string) => void;
privKey?: string;
}
export default function AvatarEditor({ picture, onPictureChange }: AvatarEditorProps) {
const uploader = useFileUpload();
export default function AvatarEditor({ picture, onPictureChange, privKey }: AvatarEditorProps) {
const uploader = useFileUpload(privKey);
const [error, setError] = useState("");
const [loading, setLoading] = useState(false);
@ -22,7 +23,7 @@ export default function AvatarEditor({ picture, onPictureChange }: AvatarEditorP
setLoading(true);
try {
const f = await openFile();
if (f) {
if (f && uploader) {
const rsp = await uploader.upload(f, f.name);
console.log(rsp);
if (typeof rsp?.error === "string") {