chore: formatting

This commit is contained in:
kieran 2024-10-10 21:39:09 +01:00
parent 2e789b222c
commit 52fe83d815
No known key found for this signature in database
GPG Key ID: DE71CEB3925BE941
3 changed files with 31 additions and 25 deletions

View File

@ -189,7 +189,8 @@ export default function NostrProviderDialog({
function currentBalance() {
if (!info) return;
return <div>
return (
<div>
<p>
<FormattedMessage defaultMessage="Balance" id="H5+NAX" />
</p>
@ -205,15 +206,18 @@ export default function NostrProviderDialog({
<AccountWithdrawl provider={provider} onFinish={loadInfo} />
</div>
</div>
);
}
function balanceTimeEstimate() {
if (!info) return;
return <div>
return (
<div>
<small>
<FormattedMessage defaultMessage="About {estimate}" values={{ estimate: calcEstimate() }} />
</small>
</div>
);
}
function streamEditor() {
@ -288,7 +292,7 @@ export default function NostrProviderDialog({
return (
<>
{showEndpoints && streamEndpoints()}
{showBalance&& currentBalance()}
{showBalance && currentBalance()}
{showEstimate && balanceTimeEstimate()}
{streamEditor()}
{forwardInputs()}

View File

@ -31,9 +31,9 @@ export function useCurrentStreamFeed(link: NostrLink, leaveOpen = false, evPrelo
const q = useRequestBuilder(sub);
return useMemo(() => {
const hosting = [...q, ...(evPreload ? [evPreload] : [])].filter(
a => getHost(a) === author || a.pubkey === author
).sort((a, b) => (b.created_at > a.created_at ? 1 : -1));
const hosting = [...q, ...(evPreload ? [evPreload] : [])]
.filter(a => getHost(a) === author || a.pubkey === author)
.sort((a, b) => (b.created_at > a.created_at ? 1 : -1));
return hosting.at(0);
}, [q]);
}

View File

@ -171,9 +171,11 @@ export class NostrStreamProvider implements StreamProvider {
const u = `${this.url}${path}`;
const token = await pub.generic(eb => {
return eb.kind(EventKind.HttpAuthentication)
return eb
.kind(EventKind.HttpAuthentication)
.content("")
.tag(["u", u]).tag(["method", method])
.tag(["u", u])
.tag(["method", method])
.createdAt(unixNow() + Math.floor(TimeSync / 1000));
});
const rsp = await fetch(u, {