mirror of
https://github.com/Equicord/Equicord.git
synced 2025-01-19 05:43:35 -05:00
Update BetterActivities
This commit is contained in:
parent
ced03fec91
commit
aca51e64f8
1 changed files with 5 additions and 3 deletions
|
@ -127,7 +127,9 @@ const ActivityTooltip = ({ activity, application, user }: Readonly<{ activity: A
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
function getActivityApplication({ application_id }: Activity) {
|
function getActivityApplication(activity: Activity | null) {
|
||||||
|
if (!activity) return undefined;
|
||||||
|
const { application_id } = activity;
|
||||||
if (!application_id) return undefined;
|
if (!application_id) return undefined;
|
||||||
let application = ApplicationStore.getApplication(application_id);
|
let application = ApplicationStore.getApplication(application_id);
|
||||||
if (!application && fetchedApplications.has(application_id)) {
|
if (!application && fetchedApplications.has(application_id)) {
|
||||||
|
@ -309,7 +311,7 @@ export default definePlugin({
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
|
|
||||||
showAllActivitiesComponent({ activity, user, ...props }: Readonly<{ activity: Activity; user: User; application: Application; type: string; }>) {
|
showAllActivitiesComponent({ activity, user, ...props }: Readonly<{ activity: Activity | null; user: User; application: Application; type: string; }>) {
|
||||||
const [currentActivity, setCurrentActivity] = useState<Activity | null>(
|
const [currentActivity, setCurrentActivity] = useState<Activity | null>(
|
||||||
activity?.type !== 4 ? activity! : null
|
activity?.type !== 4 ? activity! : null
|
||||||
);
|
);
|
||||||
|
@ -340,7 +342,7 @@ export default definePlugin({
|
||||||
if (settings.store.allActivitiesStyle === "carousel") {
|
if (settings.store.allActivitiesStyle === "carousel") {
|
||||||
return (
|
return (
|
||||||
<div style={{ display: "flex", flexDirection: "column" }}>
|
<div style={{ display: "flex", flexDirection: "column" }}>
|
||||||
{currentActivity?.id === activity?.id ? (
|
{activity && currentActivity?.id === activity?.id ? (
|
||||||
<ActivityView
|
<ActivityView
|
||||||
activity={currentActivity}
|
activity={currentActivity}
|
||||||
user={user}
|
user={user}
|
||||||
|
|
Loading…
Reference in a new issue