diff --git a/src/equicordplugins/downloadAllAttachments/index.tsx b/src/equicordplugins/downloadAllAttachments/index.tsx index b3955139e..a33964d97 100644 --- a/src/equicordplugins/downloadAllAttachments/index.tsx +++ b/src/equicordplugins/downloadAllAttachments/index.tsx @@ -15,15 +15,6 @@ import { ChannelStore, showToast, Toasts } from "@webpack/common"; const logger = new Logger("DownloadAllAttachments"); async function downloadAll(attachments: MessageAttachment[]) { - let dir: FileSystemDirectoryHandle; - try { - dir = await window.showDirectoryPicker({ mode: "readwrite" }); - } catch (e) { - if (e instanceof DOMException && e.name === "AbortError") return; - logger.error("Failed to open directory picker:", e); - return; - } - const usedNames = new Map(); function uniqueName(original: string): string { @@ -36,31 +27,21 @@ async function downloadAll(attachments: MessageAttachment[]) { : `${original.slice(0, dot)}_${count}${original.slice(dot)}`; } - const tasks = attachments.map(a => ({ attachment: a, filename: uniqueName(a.filename) })); - - const results = await Promise.allSettled(tasks.map(async ({ attachment, filename }) => { + const results = await Promise.allSettled(attachments.map(async attachment => { + const filename = uniqueName(attachment.filename); if (!attachment.proxy_url) throw new Error("Missing Proxy URL"); const res = await fetch(attachment.proxy_url); if (!res.ok) throw new Error(`HTTP ${res.status}`); - if (!res.body) throw new Error("Response body is empty"); - let fileHandle: FileSystemFileHandle | undefined; - try { - fileHandle = await dir.getFileHandle(filename, { create: true }); - const writable = await fileHandle.createWritable(); - try { - await res.body.pipeTo(writable); - } catch (e) { - await writable.abort(); - throw e; - } - } catch (e) { - if (fileHandle) { - try { await dir.removeEntry(filename); } catch { } - } - throw e; - } + const blob = await res.blob(); + const url = URL.createObjectURL(blob); + + const a = document.createElement("a"); + a.href = url; + a.download = filename; + a.click(); + URL.revokeObjectURL(url); })); const failed = results.filter(r => { diff --git a/src/equicordplugins/homeTyping/index.tsx b/src/equicordplugins/homeTyping/index.tsx index b32cd8a9c..d612771cb 100644 --- a/src/equicordplugins/homeTyping/index.tsx +++ b/src/equicordplugins/homeTyping/index.tsx @@ -4,6 +4,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ +import "./styles.css"; + import { Devs } from "@utils/constants"; import { classNameFactory } from "@utils/css"; import definePlugin from "@utils/types"; @@ -36,7 +38,7 @@ export default definePlugin({ replacement: [ { - match: /(\(0,\i.jsxs?\)\(\i,{}\))/, + match: /(?<=BUTTON_HOME.{0,10}children:)(\(0,\i.jsxs?\)\(\i,{}\))/, replace: "arguments[0].user == null ? null : (vcIsTyping ? $self.TypingIcon() : $1)" }, // define isTyping earlier in the function so i dont bReAk ThE rUlEs Of HoOkS diff --git a/src/equicordplugins/homeTyping/styles.css b/src/equicordplugins/homeTyping/styles.css new file mode 100644 index 000000000..fe3f4b554 --- /dev/null +++ b/src/equicordplugins/homeTyping/styles.css @@ -0,0 +1,3 @@ +.vc-home-typing-dots { + margin-right: 2px; +} \ No newline at end of file diff --git a/src/equicordplugins/messageLoggerEnhanced/settings.tsx b/src/equicordplugins/messageLoggerEnhanced/settings.tsx index fc8a87480..6ff1309f0 100644 --- a/src/equicordplugins/messageLoggerEnhanced/settings.tsx +++ b/src/equicordplugins/messageLoggerEnhanced/settings.tsx @@ -189,7 +189,7 @@ export const settings = definePluginSettings({ attachmentFileExtensions: { default: "png,jpg,jpeg,gif,webp,mp4,webm,mp3,ogg,wav", type: OptionType.STRING, - description: "Comma separated list of file extensions to save. Attachments with file extensions not in this list will not be saved. Leave empty to save all attachments.", + description: "Comma separated list of file extensions to save. Attachments with file extensions not in this list will not be saved.", onChange: (value: string) => { let processedValue = "";