diff --git a/src/equicordplugins/betterActivities/index.tsx b/src/equicordplugins/betterActivities/index.tsx index 429fb356..2956acb0 100644 --- a/src/equicordplugins/betterActivities/index.tsx +++ b/src/equicordplugins/betterActivities/index.tsx @@ -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; let application = ApplicationStore.getApplication(application_id); if (!application && fetchedApplications.has(application_id)) { @@ -309,7 +311,7 @@ export default definePlugin({ 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?.type !== 4 ? activity! : null ); @@ -340,7 +342,7 @@ export default definePlugin({ if (settings.store.allActivitiesStyle === "carousel") { return (
- {currentActivity?.id === activity?.id ? ( + {activity && currentActivity?.id === activity?.id ? (