Merge pull request #1139 from PR0M3TH3AN/improve-scalability-ux-15527506408449322934

Improve scalability limits and magnet upload UX
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2026-01-07 20:29:51 -05:00
commit c405eebea7
2 files changed
+19 -2

No files matched your search

+5 -2
View File
@@ -5856,11 +5856,14 @@ export class NostrClient {
/**
* fetchVideos => old approach
*/
async fetchVideos() {
async fetchVideos(options = {}) {
const requestedLimit = Number(options?.limit);
const resolvedLimit = this.clampVideoRequestLimit(requestedLimit, DEFAULT_VIDEO_REQUEST_LIMIT);
const filter = {
kinds: [30078],
"#t": ["video"],
limit: 300,
limit: resolvedLimit,
since: 0,
};
+14
View File
@@ -744,6 +744,20 @@ export class UploadModal {
);
}
const hasDirectUrl = typeof rawPayload.url === "string" && rawPayload.url.trim().length > 0;
const hasMagnet = typeof rawPayload.magnet === "string" && rawPayload.magnet.trim().length > 0;
if (!hasDirectUrl && hasMagnet) {
const confirmed = typeof window !== "undefined" && window.confirm
? window.confirm("You are uploading with a magnet link only.\n\nSince this video is not hosted on a server, it will only be playable as long as you (or others) continue seeding it.\n\nDo you want to proceed?")
: true;
if (!confirmed) {
this.updateCustomSubmitButtonState();
return;
}
}
const nip71Metadata = this.nip71FormManager.collectSection("custom");
if (nip71Metadata) {
rawPayload.nip71 = nip71Metadata;