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