Оптимизирован код вложений, исправлена установка аватарки на диалог, а не у отправителя

This commit is contained in:
RoyceDa
2026-02-20 17:43:56 +02:00
parent db72246e5a
commit c64a7005d3
6 changed files with 22 additions and 17 deletions

View File

@@ -1,9 +1,9 @@
import { useContext } from "react";
import { AvatarContext } from "./AvatarProvider";
export function useSaveAvatar() {
export function useSaveAvatar() : (fromPublicKey: string, path : string, decryptedContent : string) => Promise<void> {
const context : any = useContext(AvatarContext);
if(!context){
if(!context){
throw new Error("useSaveAvatar must be used within an AvatarProvider");
}
return context.saveAvatar;