fix PermissionViewer, SuperReactionTweaks & SHC (#4147)
Co-authored-by: Vendicated <vendicated@riseup.net>
This commit is contained in:
parent
f571784231
commit
caba178b1c
5 changed files with 8 additions and 4 deletions
|
|
@ -16,6 +16,7 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { DataStore } from "@api/index";
|
||||
import { showNotification } from "@api/Notifications";
|
||||
import { definePluginSettings } from "@api/Settings";
|
||||
import { Devs } from "@utils/constants";
|
||||
|
|
@ -76,6 +77,8 @@ export default definePlugin({
|
|||
],
|
||||
|
||||
handleCrash(_this: any, errorState: any) {
|
||||
DataStore.del("KeepCurrentChannel_previousData");
|
||||
|
||||
if (IS_DEV) {
|
||||
try {
|
||||
if (errorState?.info && "componentStack" in errorState.info) {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ import openRolesAndUsersPermissionsModal from "./components/RolesAndUsersPermiss
|
|||
import UserPermissions from "./components/UserPermissions";
|
||||
import { getSortedRolesForMember, sortPermissionOverwrites } from "./utils";
|
||||
|
||||
const PopoutClasses = findCssClassesLazy("container", "scroller", "list");
|
||||
const PopoutClasses = findCssClassesLazy("container", "popoutRoleDot");
|
||||
|
||||
export const enum PermissionsSortOrder {
|
||||
HighestRole,
|
||||
|
|
|
|||
|
|
@ -32,7 +32,8 @@ import ReviewComponent from "./ReviewComponent";
|
|||
import ReviewsView, { ReviewsInputComponent } from "./ReviewsView";
|
||||
|
||||
const Paginator = findComponentByCodeLazy<ComponentProps<t.Paginator>>('rel:"prev",children:');
|
||||
const requirePaginator = extractAndLoadChunksLazy(['name:"SearchResults"'], new RegExp(`${DefaultExtractAndLoadChunksRegex.source}.{0,30}?name:"SearchResults"`));
|
||||
// This matches a massive module with ~230k chars so we need an anchor before to prevent REDOS
|
||||
const requirePaginator = extractAndLoadChunksLazy(['name:"SearchResults"'], new RegExp(`name:"StageChannelCall",renderLoader:.+?(?:${DefaultExtractAndLoadChunksRegex.source}).{0,30}?name:"SearchResults"`));
|
||||
|
||||
function Modal({ modalProps, modalKey, discordId, name, type }: { modalProps: any; modalKey: string, discordId: string; name: string; type: ReviewType; }) {
|
||||
const [data, setData] = useState<UserReviewsData>();
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ export default definePlugin({
|
|||
},
|
||||
{
|
||||
// Patch the header to only return allowed users and roles if it's a hidden channel or locked channel (Like when it's used on the HiddenChannelLockScreen)
|
||||
match: /return\(0,\i\.jsxs?\)\(\i\.\i,{channelId:(\i)\.id(?=.+?(\(0,\i\.jsxs?\)\("div",{className:\i\.\i,children:\[.{0,100}\i\.length>0.+?\]}\)),)/,
|
||||
match: /return\(0,\i\.jsxs?\)\(\i\.\i,{channelId:(\i)\.id,children:\[(?=.{0,1000}?(\(0,\i\.jsxs?\)\("div",{className:\i\.\i,children:\[.{0,100}\i\.length>0.+?\]}\)),)/,
|
||||
replace: (m, channel, allowedUsersAndRolesComponent) => `if($self.isHiddenChannel(${channel},true)){return${allowedUsersAndRolesComponent};}${m}`
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ export default definePlugin({
|
|||
{
|
||||
find: ".EMOJI_PICKER_CONSTANTS_EMOJI_CONTAINER_PADDING_HORIZONTAL)",
|
||||
replacement: {
|
||||
match: /(openPopoutType:void 0(?=.+?isBurstReaction:(\i).+?(\i===\i\.\i.REACTION)).+?\[\2,\i\]=\i\.useState\().+?\)/,
|
||||
match: /(openPopoutType:void 0(?=.+?isBurstReaction:(\i).+?;(\i===\i\.\i\.REACTION)&&\i\.push\().+?\[\2,\i\]=\i\.useState\()!1\)/,
|
||||
replace: (_, rest, _isBurstReactionVariable, isReactionIntention) => `${rest}$self.shouldSuperReactByDefault&&${isReactionIntention})`
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue