feat: add imeta hash

This commit is contained in:
Kieran 2023-12-10 17:19:09 +00:00
parent 735d5fd5a5
commit d167579348
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
3 changed files with 20 additions and 13 deletions

View File

@ -215,6 +215,9 @@ export function NoteCreator() {
if (rx.metadata.width && rx.metadata.height) {
imeta.push(`dim ${rx.metadata.width}x${rx.metadata.height}`);
}
if (rx.metadata.hash) {
imeta.push(`x ${rx.metadata.hash}`);
}
v.extraTags.push(imeta);
}
} else if (rx?.error) {
@ -338,18 +341,18 @@ export function NoteCreator() {
onChange={e => {
note.update(
v =>
(v.selectedCustomRelays =
// set false if all relays selected
e.target.checked &&
(v.selectedCustomRelays =
// set false if all relays selected
e.target.checked &&
note.selectedCustomRelays &&
note.selectedCustomRelays.length == a.length - 1
? undefined
: // otherwise return selectedCustomRelays with target relay added / removed
a.filter(el =>
el === r
? e.target.checked
: !note.selectedCustomRelays || note.selectedCustomRelays.includes(el),
)),
? undefined
: // otherwise return selectedCustomRelays with target relay added / removed
a.filter(el =>
el === r
? e.target.checked
: !note.selectedCustomRelays || note.selectedCustomRelays.includes(el),
)),
);
}}
/>
@ -418,9 +421,9 @@ export function NoteCreator() {
onChange={e =>
note.update(
v =>
(v.zapSplits = arr.map((vv, ii) =>
ii === i ? { ...vv, weight: Number(e.target.value) } : vv,
)),
(v.zapSplits = arr.map((vv, ii) =>
ii === i ? { ...vv, weight: Number(e.target.value) } : vv,
)),
)
}
/>

View File

@ -62,6 +62,9 @@ export default async function VoidCatUpload(
const ret = {
url: resultUrl,
metadata: {
hash: rsp.file?.metadata?.digest,
},
} as UploadResult;
if (publisher) {

View File

@ -27,6 +27,7 @@ export interface UploadResult {
blurhash?: string;
width?: number;
height?: number;
hash?: string;
};
}