{
setVisible(v => !v);
}}
>
- {visible ?
:
}
+ {visible ?
:
}
)}
;
}
export default definePlugin({
- name: "FileViewer",
+ name: "PdfViewer",
description: "Preview PDF Files without having to download them",
authors: [Devs.AGreenPig],
dependencies: ["MessageAccessoriesAPI", "MessageUpdaterAPI",],
@@ -157,8 +147,7 @@ export default definePlugin({
}
],
start() {
- objectUrlsCache.setMaxSize(Math.round(settings.store.cacheSize));
- addAccessory("fileViewer", props => {
+ addAccessory("pdfViewer", props => {
const pdfAttachments = props.message.attachments.filter(a => a.content_type === "application/pdf");
if (!pdfAttachments.length) return null;
@@ -170,18 +159,13 @@ export default definePlugin({
);
}, -1);
-
- style = document.createElement("style");
- style.id = "VencordFileViewer";
- document.head.appendChild(style);
},
renderPreviewButton: ErrorBoundary.wrap(e => {
if (e.item.originalItem.content_type !== "application/pdf") return null;
return