ShowHiddenThings: Fix showing ModView

This commit is contained in:
Nuckyz 2025-01-22 22:22:43 -03:00
parent 17f1ef275e
commit ed99ae7f23
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9
3 changed files with 15 additions and 4 deletions

View file

@ -31,7 +31,7 @@ import { findByCodeLazy, findComponentByCodeLazy } from "@webpack";
import { ApplicationAssetUtils, Button, FluxDispatcher, Forms, React, UserStore } from "@webpack/common";
const useProfileThemeStyle = findByCodeLazy("profileThemeStyle:", "--profile-gradient-primary-color");
const ActivityView = findComponentByCodeLazy('location:"UserProfileActivityCard",');
const ActivityView = findComponentByCodeLazy(".party?(0", ".card");
const ShowCurrentGame = getUserSettingLazy<boolean>("status", "showCurrentGame")!;
@ -399,6 +399,17 @@ export default definePlugin({
stop: () => setRpc(true),
settings,
patches: [
{
find: ".party?(0",
all: true,
replacement: {
match: /\i\.id===\i\.id\?null:/,
replace: ""
}
}
],
settingsAboutComponent: () => {
const activity = useAwaiter(createActivity);
const gameActivityEnabled = ShowCurrentGame.useSetting();
@ -449,7 +460,7 @@ export default definePlugin({
{activity[0] && <ActivityView
activity={activity[0]}
user={UserStore.getCurrentUser()}
currentUser={{ id: "0" }}
currentUser={UserStore.getCurrentUser()}
/>}
</div>
</>

View file

@ -391,7 +391,7 @@ export default definePlugin({
},
// Separate patch for allowing using custom app icons
{
find: /\.getCurrentDesktopIcon.{0,25}\.isPremium/,
find: "?24:30,",
replacement: {
match: /\i\.\i\.isPremium\(\i\.\i\.getCurrentUser\(\)\)/,
replace: "true"

View file

@ -58,7 +58,7 @@ export default definePlugin({
},
},
{
find: /context:\i,checkElevated:!1\}\),\i\.\i.{0,200}autoTrackExposure/,
find: /,checkElevated:!1}\),\i\.\i\)}(?<=getCurrentUser\(\);return.+?)/,
predicate: () => settings.store.showModView,
replacement: {
match: /return \i\.\i\(\i\.\i\(\{user:\i,context:\i,checkElevated:!1\}\),\i\.\i\)/,