mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-10 15:13:02 -04:00
Fix Some Bugs
This commit is contained in:
parent
7f4834d967
commit
01d6e7f771
5 changed files with 99 additions and 80 deletions
|
@ -10,7 +10,7 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch
|
|||
|
||||
### Extra included plugins
|
||||
<details>
|
||||
<summary>146 additional plugins</summary>
|
||||
<summary>147 additional plugins</summary>
|
||||
|
||||
### All Platforms
|
||||
- AllCallTimers by MaxHerbold & D3SOX
|
||||
|
@ -91,6 +91,7 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch
|
|||
- MessagePeek by HypedDomi
|
||||
- MessageTranslate by Samwich
|
||||
- MoreStickers by Leko & Arjix
|
||||
- MoreThemes by Kyuuhachi
|
||||
- NeverPausePreviews by vappstar
|
||||
- NewPluginsManager by Sqaaakoi
|
||||
- NoAppsAllowed by kvba
|
||||
|
|
|
@ -108,7 +108,7 @@ export default definePlugin({
|
|||
},
|
||||
{
|
||||
// Emoji category list
|
||||
find: "#{intl::EMOJI_CATEGORY_TOP_GUILD_EMOJI}",
|
||||
find: "#{intl::EMOJI_CATEGORY_TOP_GUILD_EMOJI},{guildName:",
|
||||
replacement: {
|
||||
match: /(?<=(\i)\.unshift\((\i)\):)(?=\1\.push\(\2\))/,
|
||||
replace: "$2.isNitroLocked||"
|
||||
|
|
|
@ -84,41 +84,50 @@ function BookmarkFolderOpenMenu(props: BookmarkProps) {
|
|||
onClose={() => FluxDispatcher.dispatch({ type: "CONTEXT_MENU_CLOSE" })}
|
||||
aria-label="Bookmark Folder Menu"
|
||||
>
|
||||
{bookmark.bookmarks.map((b, i) => <><Menu.MenuItem
|
||||
{bookmark.bookmarks.map((b, i) => (
|
||||
<Menu.MenuItem
|
||||
key={`bookmark-folder-entry-${b.channelId}`}
|
||||
id={`bookmark-folder-entry-${b.channelId}`}
|
||||
label={<div style={{
|
||||
label={
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
gap: "0.25rem"
|
||||
}}>
|
||||
<span style={{ overflow: "hidden", textOverflow: "ellipsis" }}>
|
||||
<span
|
||||
style={{
|
||||
overflow: "hidden",
|
||||
textOverflow: "ellipsis"
|
||||
}}>
|
||||
{b.name}
|
||||
</span>
|
||||
{bookmarkNotificationDot && <NotificationDot channelIds={[b.channelId]} />}
|
||||
</div>}
|
||||
</div>
|
||||
}
|
||||
icon={() => <BookmarkIcon bookmark={b} />}
|
||||
showIconFirst={true}
|
||||
action={() => switchChannel(b)} /><span>
|
||||
(
|
||||
bookmarkNotificationDot && <Menu.MenuGroup>
|
||||
action={() => switchChannel(b)}
|
||||
>
|
||||
{bookmarkNotificationDot && (
|
||||
<Menu.MenuGroup>
|
||||
<Menu.MenuItem
|
||||
key="mark-as-read"
|
||||
id="mark-as-read"
|
||||
label={getIntlMessage("MARK_AS_READ")}
|
||||
disabled={!ReadStateStore.hasUnread(b.channelId)}
|
||||
action={() => ReadStateUtils.ackChannel(ChannelStore.getChannel(b.channelId))} />
|
||||
action={() => ReadStateUtils.ackChannel(ChannelStore.getChannel(b.channelId))}
|
||||
/>
|
||||
</Menu.MenuGroup>
|
||||
)
|
||||
</span><span>
|
||||
)}
|
||||
<Menu.MenuGroup key="bookmarks">
|
||||
|
||||
<Menu.MenuItem
|
||||
key="edit-bookmark"
|
||||
id="edit-bookmark"
|
||||
label="Edit Bookmark"
|
||||
action={() => {
|
||||
const key = openModal(modalProps => <EditModal
|
||||
const key = openModal(modalProps =>
|
||||
<EditModal
|
||||
modalProps={modalProps}
|
||||
modalKey={key}
|
||||
bookmark={b}
|
||||
|
@ -127,16 +136,19 @@ function BookmarkFolderOpenMenu(props: BookmarkProps) {
|
|||
newBookmarks[i].name = name;
|
||||
methods.editBookmark(index, { bookmarks: newBookmarks });
|
||||
closeModal(key);
|
||||
}} />
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}} />
|
||||
}}
|
||||
/>
|
||||
<Menu.MenuItem
|
||||
key="delete-bookmark"
|
||||
id="delete-bookmark"
|
||||
label="Delete Bookmark"
|
||||
action={() => {
|
||||
methods.deleteBookmark(i, index);
|
||||
}} />
|
||||
}}
|
||||
/>
|
||||
<Menu.MenuItem
|
||||
key="remove-bookmark-from-folder"
|
||||
id="remove-bookmark-from-folder"
|
||||
|
@ -144,13 +156,13 @@ function BookmarkFolderOpenMenu(props: BookmarkProps) {
|
|||
action={() => {
|
||||
const newBookmarks = [...bookmark.bookmarks];
|
||||
newBookmarks.splice(i, 1);
|
||||
|
||||
methods.addBookmark(b);
|
||||
methods.editBookmark(index, { bookmarks: newBookmarks });
|
||||
}} />
|
||||
}}
|
||||
/>
|
||||
</Menu.MenuGroup>
|
||||
</span>
|
||||
</>)}
|
||||
</Menu.MenuItem>
|
||||
))}
|
||||
</Menu.Menu>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Vencord, a Discord client mod
|
||||
* Copyright (c) 2024 Vendicated and contributors
|
||||
* Copyright (c) 2025 Vendicated and contributors
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
|
@ -10,35 +10,10 @@ import { definePluginSettings } from "@api/Settings";
|
|||
import { getUserSettingLazy } from "@api/UserSettings";
|
||||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { Devs } from "@utils/constants";
|
||||
import { proxyLazy } from "@utils/lazy";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { findComponentByCodeLazy } from "@webpack";
|
||||
import { ChannelStore, Constants, Forms, MessageStore, RestAPI, Tooltip, useEffect, useState, useStateFromStores } from "@webpack/common";
|
||||
import type { ComponentType, HTMLAttributes } from "react";
|
||||
|
||||
declare enum SpinnerTypes {
|
||||
WANDERING_CUBES = "wanderingCubes",
|
||||
CHASING_DOTS = "chasingDots",
|
||||
PULSING_ELLIPSIS = "pulsingEllipsis",
|
||||
SPINNING_CIRCLE = "spinningCircle",
|
||||
SPINNING_CIRCLE_SIMPLE = "spinningCircleSimple",
|
||||
LOW_MOTION = "lowMotion",
|
||||
}
|
||||
|
||||
type Spinner = ComponentType<Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
||||
type?: SpinnerTypes;
|
||||
animated?: boolean;
|
||||
className?: string;
|
||||
itemClassName?: string;
|
||||
"aria-label"?: string;
|
||||
}> & {
|
||||
Type: typeof SpinnerTypes;
|
||||
};
|
||||
|
||||
const { Spinner } = proxyLazy(() => Forms as any as {
|
||||
Spinner: Spinner,
|
||||
SpinnerTypes: typeof SpinnerTypes;
|
||||
});
|
||||
import { ChannelStore, Constants, MessageStore, RestAPI, Tooltip, useEffect, useState, useStateFromStores } from "@webpack/common";
|
||||
import type { ComponentType } from "react";
|
||||
|
||||
const MessageDisplayCompact = getUserSettingLazy("textAndImages", "messageDisplayCompact")!;
|
||||
|
||||
|
@ -104,7 +79,7 @@ export default definePlugin({
|
|||
find: "#{intl::REPLY_QUOTE_MESSAGE_NOT_LOADED}",
|
||||
replacement: {
|
||||
// Should match two places
|
||||
match: /(\i\.clickable),\{/g,
|
||||
match: /(\i\.\i),\{(?=className:\i\(\)\(\i\.repliedTextPreview,\i\.clickable)/g,
|
||||
replace: "$self.ReplyTooltip,{Component:$1,vcProps:arguments[0],"
|
||||
},
|
||||
predicate: () => settings.store.onReply,
|
||||
|
@ -112,8 +87,8 @@ export default definePlugin({
|
|||
{
|
||||
find: "#{intl::MESSAGE_FORWARDED}",
|
||||
replacement: {
|
||||
match: /(null:.{0,20})(\i\.\i\i),\{/,
|
||||
replace: "$1$self.ForwardTooltip,{Component:$2,vcProps:arguments[0],"
|
||||
match: /(\i\.\i),\{(?=className:\i\.footerContainer)/g,
|
||||
replace: "$self.ForwardTooltip,{Component:$1,vcProps:arguments[0],"
|
||||
},
|
||||
predicate: () => settings.store.onForward,
|
||||
},
|
||||
|
@ -159,9 +134,8 @@ function MessagePreview({ channelId, messageId }) {
|
|||
|
||||
const compact = settings.store.display === "compact" ? true : settings.store.display === "cozy" ? false : rawCompact;
|
||||
|
||||
// TODO handle load failure
|
||||
if (!message) {
|
||||
return <Spinner type={Spinner.Type.PULSING_ELLIPSIS} />;
|
||||
return <span>Loading...</span>;
|
||||
}
|
||||
|
||||
return <ChannelMessage
|
||||
|
|
32
src/equicordplugins/moreThemes/index.tsx
Normal file
32
src/equicordplugins/moreThemes/index.tsx
Normal file
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* Vencord, a Discord client mod
|
||||
* Copyright (c) 2025 Vendicated and contributors
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin from "@utils/types";
|
||||
|
||||
export default definePlugin({
|
||||
name: "MoreThemes",
|
||||
description: "Enables Darker and Midnight themes",
|
||||
authors: [Devs.Kyuuhachi],
|
||||
|
||||
patches: [
|
||||
{ // matches twice: the settings menu and the settings context menu
|
||||
find: '("appearance_settings")',
|
||||
replacement: {
|
||||
match: /\("appearance_settings"\)/,
|
||||
replace: "$&||true"
|
||||
},
|
||||
all: true,
|
||||
},
|
||||
{ // make it actually save the setting instead of falling back to dark
|
||||
find: ')("ThemeStore"))return',
|
||||
replacement: {
|
||||
match: /(?<=\)\("ThemeStore"\))(?=\)return)/,
|
||||
replace: "&&false"
|
||||
},
|
||||
}
|
||||
],
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue