SuperReactionTweaks: only super react by default if user has nitro
This commit is contained in:
parent
e3fd954512
commit
2d8715adf0
1 changed files with 6 additions and 1 deletions
|
@ -7,6 +7,7 @@
|
|||
import { definePluginSettings } from "@api/Settings";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { UserStore } from "@webpack/common";
|
||||
|
||||
export const settings = definePluginSettings({
|
||||
superReactByDefault: {
|
||||
|
@ -49,7 +50,7 @@ export default definePlugin({
|
|||
find: ".trackEmojiSearchEmpty,200",
|
||||
replacement: {
|
||||
match: /(\.trackEmojiSearchEmpty,200(?=.+?isBurstReaction:(\i).+?(\i===\i\.EmojiIntention.REACTION)).+?\[\2,\i\]=\i\.useState\().+?\)/,
|
||||
replace: (_, rest, isBurstReactionVariable, isReactionIntention) => `${rest}$self.settings.store.superReactByDefault&&${isReactionIntention})`
|
||||
replace: (_, rest, isBurstReactionVariable, isReactionIntention) => `${rest}$self.shouldSuperReactByDefault&&${isReactionIntention})`
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -59,5 +60,9 @@ export default definePlugin({
|
|||
if (settings.store.unlimitedSuperReactionPlaying) return true;
|
||||
if (playingCount <= settings.store.superReactionPlayingLimit) return true;
|
||||
return false;
|
||||
},
|
||||
|
||||
get shouldSuperReactByDefault() {
|
||||
return settings.store.superReactByDefault && UserStore.getCurrentUser().premiumType != null;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue