mirror of
https://github.com/Equicord/Equicord.git
synced 2025-04-01 13:11:57 -04:00
Merge branch 'dev' into main
This commit is contained in:
commit
865e7ce2ca
6 changed files with 89 additions and 21 deletions
|
@ -30,6 +30,7 @@ import "./utils/quickCss";
|
|||
import "./webpack/patchWebpack";
|
||||
|
||||
import { openUpdaterModal } from "@components/VencordSettings/UpdaterTab";
|
||||
import { Logger } from "@utils/Logger";
|
||||
import { StartAt } from "@utils/types";
|
||||
|
||||
import { get as dsGet } from "./api/DataStore";
|
||||
|
@ -48,6 +49,37 @@ if (IS_REPORTER) {
|
|||
Settings.plugins.CharacterCounter.enabled = false;
|
||||
}
|
||||
|
||||
const logger = new Logger("Debug", "#a6d189");
|
||||
|
||||
let isFrozen = true;
|
||||
const checkInterval = 5000;
|
||||
const freezeChecker = setInterval(() => {
|
||||
if (isFrozen) {
|
||||
location.reload();
|
||||
}
|
||||
isFrozen = true;
|
||||
}, checkInterval);
|
||||
|
||||
function safeInit() {
|
||||
try {
|
||||
startAllPlugins(StartAt.Init);
|
||||
init();
|
||||
|
||||
const originalLoggerInfo = logger.info.bind(logger);
|
||||
logger.info = function (message) {
|
||||
originalLoggerInfo(message);
|
||||
if (message.includes("Completed Equicord initialization.")) {
|
||||
isFrozen = false;
|
||||
clearInterval(freezeChecker);
|
||||
}
|
||||
};
|
||||
} catch (error) {
|
||||
logger.error("Failed to initialize Equicord, reloading in 5 seconds...", error);
|
||||
clearInterval(freezeChecker);
|
||||
setTimeout(() => location.reload(), 5000);
|
||||
}
|
||||
}
|
||||
|
||||
async function syncSettings() {
|
||||
// pre-check for local shared settings
|
||||
if (
|
||||
|
@ -94,6 +126,8 @@ async function init() {
|
|||
|
||||
syncSettings();
|
||||
|
||||
logger.info("Completed Equicord initialization.");
|
||||
|
||||
if (!IS_WEB && !IS_UPDATER_DISABLED) {
|
||||
try {
|
||||
const isOutdated = await checkForUpdates();
|
||||
|
@ -139,10 +173,10 @@ async function init() {
|
|||
}
|
||||
}
|
||||
|
||||
startAllPlugins(StartAt.Init);
|
||||
init();
|
||||
safeInit();
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
try {
|
||||
startAllPlugins(StartAt.DOMContentLoaded);
|
||||
|
||||
if (IS_DISCORD_DESKTOP && Settings.winNativeTitleBar && navigator.platform.toLowerCase().startsWith("win")) {
|
||||
|
@ -151,4 +185,13 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||
textContent: "[class*=titleBar]{display: none!important}"
|
||||
}));
|
||||
}
|
||||
|
||||
isFrozen = false;
|
||||
clearInterval(freezeChecker);
|
||||
logger.info("DOMContentLoaded event handled successfully.");
|
||||
} catch (error) {
|
||||
logger.error("Error during DOMContentLoaded event, reloading in 5 seconds...", error);
|
||||
clearInterval(freezeChecker);
|
||||
setTimeout(() => location.reload(), 5000);
|
||||
}
|
||||
}, { once: true });
|
||||
|
|
|
@ -130,7 +130,20 @@ function generatePluginList() {
|
|||
}
|
||||
|
||||
if (enabledPlugins.length > 100 && !(isPluginDev(UserStore.getCurrentUser()?.id) || isEquicordPluginDev(UserStore.getCurrentUser()?.id))) {
|
||||
content = "We don't support users with more than 100 plugins enabled. Please disable some and try again.";
|
||||
return Alerts.show({
|
||||
title: "You are attempting to get support!",
|
||||
body: <div>
|
||||
<style>
|
||||
{'[class*="backdrop_"][style*="backdrop-filter"]{backdrop-filter:blur(16px) brightness(0.25) !important;}'}
|
||||
</style>
|
||||
<img src="https://media.tenor.com/QtGqjwBpRzwAAAAi/wumpus-dancing.gif" />
|
||||
<Forms.FormText>Before you ask for help,</Forms.FormText>
|
||||
<Forms.FormText>We do not handle support for users who use 100+ plugins</Forms.FormText>
|
||||
<Forms.FormText>issue could be plugin confliction</Forms.FormText>
|
||||
<Forms.FormText>try removing some plugins and see if it fixes!</Forms.FormText>
|
||||
</div>,
|
||||
cancelText: "Okay continue"
|
||||
});
|
||||
}
|
||||
|
||||
return content;
|
||||
|
@ -174,7 +187,10 @@ export default definePlugin({
|
|||
description: "Send Equicord plugin list",
|
||||
// @ts-ignore
|
||||
predicate: ctx => isPluginDev(UserStore.getCurrentUser()?.id) || isEquicordPluginDev(UserStore.getCurrentUser()?.id) || GUILD_ID === ctx?.guild?.id,
|
||||
execute: () => ({ content: generatePluginList() })
|
||||
execute: () => {
|
||||
const pluginList = generatePluginList();
|
||||
return { content: typeof pluginList === "string" ? pluginList : "Unable to generate plugin list." };
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
|
@ -199,7 +215,7 @@ export default definePlugin({
|
|||
</div>,
|
||||
confirmText: "Go to Equicord Support",
|
||||
cancelText: "Okay continue",
|
||||
onConfirm: () => VencordNative.native.openExternal("https://discord.gg/npnv52UQwY"),
|
||||
onConfirm: () => VencordNative.native.openExternal("https://discord.gg/equicord"),
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -234,7 +250,7 @@ export default definePlugin({
|
|||
body: <div>
|
||||
<Forms.FormText>You are using an externally updated Equicord version, the ability to help you here may be limited.</Forms.FormText>
|
||||
<Forms.FormText className={Margins.top8}>
|
||||
Please join the <Link href="https://discord.gg/5Xh2W87egW">Equicord Server</Link> for support,
|
||||
Please join the <Link href="https://discord.gg/equicord">Equicord Server</Link> for support,
|
||||
or if this issue persists on Vencord, continue on.
|
||||
</Forms.FormText>
|
||||
</div>
|
||||
|
@ -306,7 +322,12 @@ export default definePlugin({
|
|||
</Button>,
|
||||
<Button
|
||||
key="vc-plg-list"
|
||||
onClick={async () => sendMessage(props.channel.id, { content: generatePluginList() })}
|
||||
onClick={async () => {
|
||||
const pluginList = generatePluginList();
|
||||
if (typeof pluginList === "string") {
|
||||
sendMessage(props.channel.id, { content: pluginList });
|
||||
}
|
||||
}}
|
||||
>
|
||||
Run /equicord-plugins
|
||||
</Button>
|
||||
|
|
|
@ -76,6 +76,11 @@ export const settings = definePluginSettings({
|
|||
description: "Close other folders when opening a folder",
|
||||
default: false
|
||||
},
|
||||
closeServerFolder: {
|
||||
type: OptionType.BOOLEAN,
|
||||
description: "Close folder when selecting a server in that folder",
|
||||
default: false,
|
||||
},
|
||||
forceOpen: {
|
||||
type: OptionType.BOOLEAN,
|
||||
description: "Force a folder to open when switching to a server of that folder",
|
||||
|
@ -218,7 +223,7 @@ export default definePlugin({
|
|||
|
||||
flux: {
|
||||
CHANNEL_SELECT(data) {
|
||||
if (!settings.store.closeAllFolders && !settings.store.forceOpen)
|
||||
if (!settings.store.closeAllFolders && !settings.store.forceOpen && !settings.store.closeServerFolder)
|
||||
return;
|
||||
|
||||
if (lastGuildId !== data.guildId) {
|
||||
|
@ -229,6 +234,9 @@ export default definePlugin({
|
|||
if (settings.store.forceOpen && !ExpandedGuildFolderStore.isFolderExpanded(guildFolder.folderId)) {
|
||||
FolderUtils.toggleGuildFolderExpand(guildFolder.folderId);
|
||||
}
|
||||
if (settings.store.closeServerFolder && ExpandedGuildFolderStore.isFolderExpanded(guildFolder.folderId)) {
|
||||
FolderUtils.toggleGuildFolderExpand(guildFolder.folderId);
|
||||
}
|
||||
} else if (settings.store.closeAllFolders) {
|
||||
closeFolders();
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
*/
|
||||
|
||||
import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, OptionalMessageOption, RequiredMessageOption, sendBotMessage } from "@api/Commands";
|
||||
import { Devs, EquicordDevs } from "@utils/constants";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin from "@utils/types";
|
||||
|
||||
|
||||
|
@ -32,7 +32,7 @@ function mock(input: string): string {
|
|||
export default definePlugin({
|
||||
name: "MoreCommands",
|
||||
description: "Echo, Lenny, Mock, and More",
|
||||
authors: [Devs.Arjix, Devs.echo, Devs.Samu, EquicordDevs.ExoDev],
|
||||
authors: [Devs.Arjix, Devs.echo, Devs.Samu],
|
||||
commands: [
|
||||
{
|
||||
name: "echo",
|
||||
|
|
|
@ -984,10 +984,6 @@ export const EquicordDevs = Object.freeze({
|
|||
name: "vappstar",
|
||||
id: 747192967311261748n
|
||||
},
|
||||
ExoDev: {
|
||||
name: "ExoDev",
|
||||
id: 1325655837003223137n
|
||||
},
|
||||
voidbbg: {
|
||||
name: "voidbbg",
|
||||
id: 117126234588184582n
|
||||
|
|
|
@ -26,7 +26,7 @@ import { traceFunction } from "../debug/Tracer";
|
|||
import { Flux } from "./common";
|
||||
import { AnyModuleFactory, AnyWebpackRequire, ModuleExports, WebpackRequire } from "./wreq";
|
||||
|
||||
const logger = new Logger("Webpack");
|
||||
export const logger = new Logger("Webpack");
|
||||
|
||||
export let _resolveReady: () => void;
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue