mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-18 10:57:04 -04:00
SHC: Fix emoji rendering & allowed users/roles edge cases (#895)
Co-authored-by: V <vendicated@riseup.net>
This commit is contained in:
parent
88ad4f1b05
commit
336c7bdd5e
3 changed files with 50 additions and 6 deletions
|
@ -19,14 +19,13 @@
|
|||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { LazyComponent } from "@utils/misc";
|
||||
import { formatDuration } from "@utils/text";
|
||||
import { find, findByPropsLazy } from "@webpack";
|
||||
import { find, findByPropsLazy, findStoreLazy } from "@webpack";
|
||||
import { FluxDispatcher, GuildMemberStore, GuildStore, moment, Parser, PermissionStore, SnowflakeUtils, Text, Timestamp, Tooltip } from "@webpack/common";
|
||||
import type { Channel } from "discord-types/general";
|
||||
import type { ComponentType } from "react";
|
||||
|
||||
import { VIEW_CHANNEL } from "..";
|
||||
|
||||
|
||||
enum SortOrderTypes {
|
||||
LATEST_ACTIVITY = 0,
|
||||
CREATION_DATE = 1
|
||||
|
@ -93,6 +92,10 @@ const TagComponent = LazyComponent(() => find(m => {
|
|||
return code.includes(".Messages.FORUM_TAG_A11Y_FILTER_BY_TAG") && !code.includes("increasedActivityPill");
|
||||
}));
|
||||
|
||||
const EmojiStore = findStoreLazy("EmojiStore");
|
||||
const EmojiParser = findByPropsLazy("convertSurrogateToName");
|
||||
const EmojiUtils = findByPropsLazy("getURL", "buildEmojiReactionColorsPlatformed");
|
||||
|
||||
const ChannelTypesToChannelNames = {
|
||||
[ChannelTypes.GUILD_TEXT]: "text",
|
||||
[ChannelTypes.GUILD_ANNOUNCEMENT]: "announcement",
|
||||
|
@ -242,9 +245,15 @@ function HiddenChannelLockScreen({ channel }: { channel: ExtendedChannel; }) {
|
|||
<div className="shc-lock-screen-default-emoji-container">
|
||||
<Text variant="text-md/normal">Default reaction emoji:</Text>
|
||||
{Parser.defaultRules[defaultReactionEmoji.emojiName ? "emoji" : "customEmoji"].react({
|
||||
name: defaultReactionEmoji.emojiName ?? "",
|
||||
emojiId: defaultReactionEmoji.emojiId
|
||||
})}
|
||||
name: defaultReactionEmoji.emojiName
|
||||
? EmojiParser.convertSurrogateToName(defaultReactionEmoji.emojiName)
|
||||
: EmojiStore.getCustomEmojiById(defaultReactionEmoji.emojiId)?.name ?? "",
|
||||
emojiId: defaultReactionEmoji.emojiId ?? void 0,
|
||||
surrogate: defaultReactionEmoji.emojiName ?? void 0,
|
||||
src: defaultReactionEmoji.emojiName
|
||||
? EmojiUtils.getURL(defaultReactionEmoji.emojiName)
|
||||
: void 0
|
||||
}, void 0, { key: "0" })}
|
||||
</div>
|
||||
}
|
||||
{channel.hasFlag(ChannelFlags.REQUIRE_TAG) &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue