mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-28 02:06:23 +00:00
now it's a FindStoreLazy call
This commit is contained in:
parent
22c68df975
commit
4faaa1382e
1 changed files with 7 additions and 9 deletions
|
@ -9,8 +9,8 @@ import "./styles.css";
|
|||
import { definePluginSettings } from "@api/Settings";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { findStoreLazy } from "@webpack";
|
||||
import { Message, User } from "discord-types/general";
|
||||
|
||||
interface UsernameProps {
|
||||
author: { nick: string; };
|
||||
message: Message;
|
||||
|
@ -18,10 +18,6 @@ interface UsernameProps {
|
|||
isRepliedMessage: boolean;
|
||||
userOverride?: User;
|
||||
}
|
||||
|
||||
if (Vencord.Webpack.findStoreLazy("StreamerModeStore").enabled) {
|
||||
var Streamer = new Boolean(true);
|
||||
}
|
||||
const settings = definePluginSettings({
|
||||
mode: {
|
||||
type: OptionType.SELECT,
|
||||
|
@ -43,7 +39,7 @@ const settings = definePluginSettings({
|
|||
description: "Also apply functionality to reply previews",
|
||||
},
|
||||
});
|
||||
|
||||
const StreamerMode = findStoreLazy("StreamerModeStore");
|
||||
export default definePlugin({
|
||||
name: "ShowMeYourName",
|
||||
description: "Display usernames next to nicks, or no nicks at all",
|
||||
|
@ -59,6 +55,7 @@ export default definePlugin({
|
|||
],
|
||||
settings,
|
||||
|
||||
|
||||
renderUsername: ({ author, message, isRepliedMessage, withMentionPrefix, userOverride }: UsernameProps) => {
|
||||
try {
|
||||
const user = userOverride ?? message.author;
|
||||
|
@ -71,13 +68,14 @@ export default definePlugin({
|
|||
if (username === nick || isRepliedMessage && !settings.store.inReplies)
|
||||
return prefix + nick;
|
||||
if (settings.store.mode === "user-nick")
|
||||
if (Streamer) {
|
||||
return <>{prefix}{nick} <span className="vc-smyn-suffix">{username[0]}...</span></>;
|
||||
if (StreamerMode.enabled) {
|
||||
return <>{prefix}{username} <span className="vc-smyn-suffix">{nick}...</span></>;
|
||||
} else {
|
||||
return <>{prefix}{username} <span className="vc-smyn-suffix">{nick}</span></>;
|
||||
}
|
||||
if (settings.store.mode === "nick-user")
|
||||
if (Streamer) {
|
||||
if (StreamerMode.enabled) {
|
||||
console.log("yeah");
|
||||
return <>{prefix}{nick} <span className="vc-smyn-suffix">{username[0]}...</span></>;
|
||||
} else {
|
||||
return <>{prefix}{nick} <span className="vc-smyn-suffix">{username}</span></>;
|
||||
|
|
Loading…
Reference in a new issue