Fix ExportMessages

This commit is contained in:
thororen1234 2025-07-07 14:27:17 -04:00
parent 1f6a9ea8c1
commit ad4363d95a
No known key found for this signature in database

View file

@ -9,12 +9,10 @@ import { definePluginSettings } from "@api/Settings";
import { EquicordDevs } from "@utils/constants";
import { showItemInFolder } from "@utils/native";
import definePlugin, { OptionType } from "@utils/types";
import { findByPropsLazy } from "@webpack";
import { saveFile } from "@utils/web";
import { Menu } from "@webpack/common";
import { Message } from "discord-types/general";
const { saveFile } = findByPropsLazy("saveFile", "openFile");
const settings = definePluginSettings({
openFileAfterExport: {
type: OptionType.BOOLEAN,
@ -66,7 +64,7 @@ async function exportMessage(message: Message) {
if (result && settings.store.openFileAfterExport) {
showItemInFolder(result);
}
} else { // for web
} else {
const file = new File([content], filename, { type: "text/plain" });
saveFile(file);
}