This commit is contained in:
smolgrrr 2024-08-12 16:28:19 +10:00
parent c664a20681
commit 7346368a2b
2 changed files with 1 additions and 37 deletions

View File

@ -180,38 +180,6 @@ const NewNoteCard = ({
)}
<PlusCircleIcon className="h-4 w-4 text-neutral-400 cursor-pointer" onClick={pickEmoji} />
</div>
<div className="flex items-center">
<ServerIcon
className="h-4 w-4 text-neutral-400 cursor-pointer"
onClick={() => document.getElementById("file_input")?.click()}
/>
<input
type="file"
name="file_input"
id="file_input"
style={{ display: "none" }}
onChange={async (e) => {
const file_input = e.target.files?.[0];
if (file_input) {
// Check if file size is greater than 2.5MB
if (file_input.size > 2.5 * 1024 * 1024) {
setFileSizeError(true);
return;
}
setUploadingFile(true);
const attachedFile = await attachFile(file_input);
setFile(attachedFile);
setUploadingFile(false);
setFileSizeError(false);
}
}}
/>
{uploadingFile ? (
<div className="flex animate-spin text-sm text-gray-300">
<ArrowPathIcon className="h-4 w-4 ml-auto" />
</div>
) : null}
</div>
<button
type="submit"
className={`bg-black border h-9 inline-flex items-center justify-center px-4 rounded-lg text-white font-medium text-sm ${doingWorkProp || uploadingFile ? 'cursor-not-allowed' : ''}`}

View File

@ -11,8 +11,6 @@ type Subscribe = {
unsub?: boolean;
};
const blacklistUrl = ["lain.la", "casualcrypto.date", "files.catbox.moe", "i.ibb.co", "matrix", "dump.li", "files.v0l.io"];
const subList: Array<Subscription> = [];
const currentSubList: Array<Subscribe> = [];
const relayMap = new Map<string, Relay>();
@ -42,9 +40,7 @@ const subscribe = (
) => {
const sub = relay.subscribe([filter], {
onevent(event) {
if (!blacklistUrl.some(blacklistedUrl => event.content.includes(blacklistedUrl))) {
cb(event, relay.url);
}
cb(event, relay.url);
},
});
subList.push(sub);