Fixes For BetterActivities

This commit is contained in:
thororen1234 2025-03-27 11:44:36 -04:00
parent f54fdd14a2
commit 5e337d628e
No known key found for this signature in database
2 changed files with 109 additions and 109 deletions

View file

@ -349,6 +349,7 @@ export default definePlugin({
if (settings.store.allActivitiesStyle === "carousel") { if (settings.store.allActivitiesStyle === "carousel") {
return ( return (
<ErrorBoundary noop onError={() => { }}>
<div style={{ display: "flex", flexDirection: "column" }}> <div style={{ display: "flex", flexDirection: "column" }}>
{activity && currentActivity?.id === activity.id ? ( {activity && currentActivity?.id === activity.id ? (
<ActivityView <ActivityView
@ -431,9 +432,11 @@ export default definePlugin({
</div> </div>
} }
</div> </div>
</ErrorBoundary>
); );
} else { } else {
return ( return (
<ErrorBoundary noop onError={() => { }}>
<div <div
style={{ style={{
display: "flex", display: "flex",
@ -460,6 +463,7 @@ export default definePlugin({
/> />
))} ))}
</div> </div>
</ErrorBoundary>
); );
} }
}, },
@ -479,7 +483,7 @@ export default definePlugin({
find: '"UserProfilePopoutBody"', find: '"UserProfilePopoutBody"',
replacement: { replacement: {
match: /(?<=(\i)\.id\)\}\)\),(\i).*?)\(0,.{0,100}\i\.activity\}\)/, match: /(?<=(\i)\.id\)\}\)\),(\i).*?)\(0,.{0,100}\i\.activity\}\)/,
replace: ",$self.showAllActivitiesComponent({ activity: $2, user: $1 })" replace: "$self.showAllActivitiesComponent({ activity: $2, user: $1 })"
}, },
predicate: () => settings.store.userPopout predicate: () => settings.store.userPopout
}, },

View file

@ -16,15 +16,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { LazyComponent } from "@utils/react"; import { findComponentByCodeLazy } from "@webpack";
import { filters, find } from "@webpack";
import { openLogModal } from "./LogsModal"; import { openLogModal } from "./LogsModal";
const HeaderBarIcon = LazyComponent(() => { const HeaderBarIcon = findComponentByCodeLazy(".HEADER_BAR_BADGE_TOP:", '.iconBadge,"top"');
const filter = filters.byCode(".HEADER_BAR_BADGE");
return find(m => m.Icon && filter(m.Icon)).Icon;
});
export function OpenLogsIcon() { export function OpenLogsIcon() {
return ( return (