fix zap splits for large lists

This commit is contained in:
Kieran 2023-09-19 09:37:24 +01:00
parent 9fb6f0dfee
commit 803c8ee05e
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
3 changed files with 18 additions and 9 deletions

View File

@ -163,11 +163,12 @@ export default function SendSats(props: SendSatsProps) {
<FormattedMessage defaultMessage="Send sats splits to" />
)}
</h2>
<div className="flex g4">
<div className="flex g4 f-wrap">
{props.targets.map(v => (
<ProfileImage
pubkey={v.value}
showUsername={false}
showFollowingMark={false}
imageOverlay={formatShort(Math.floor((amount?.amount ?? 0) * (v.weight / total)))}
/>
))}

View File

@ -190,17 +190,21 @@ export class Zapper {
}
async #getService(t: ZapTarget) {
if (t.type === "lnurl") {
const svc = new LNURL(t.value);
await svc.load();
return svc;
} else if (t.type === "pubkey") {
const profile = await this.system.ProfileLoader.fetchProfile(t.value);
if (profile) {
const svc = new LNURL(profile.lud16 ?? profile.lud06 ?? "");
try {
if (t.type === "lnurl") {
const svc = new LNURL(t.value);
await svc.load();
return svc;
} else if (t.type === "pubkey") {
const profile = await this.system.ProfileLoader.fetchProfile(t.value);
if (profile) {
const svc = new LNURL(profile.lud16 ?? profile.lud06 ?? "");
await svc.load();
return svc;
}
}
}catch {
// nothing
}
}
}

View File

@ -410,6 +410,10 @@ input:disabled {
justify-content: space-between;
}
.f-wrap {
flex-flow: wrap;
}
.g2 {
gap: 2px;
}