From 24d179eee7444639cd55c1d52028b5c9b0da06b8 Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Sun, 19 Jun 2022 12:51:44 +0200 Subject: [PATCH] Fixed #344 --- src/components/ContextMenu/instance.ts | 2 +- src/components/ContextMenu/status.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ContextMenu/instance.ts b/src/components/ContextMenu/instance.ts index 3e0cd165..862a09e6 100644 --- a/src/components/ContextMenu/instance.ts +++ b/src/components/ContextMenu/instance.ts @@ -29,7 +29,7 @@ const contextMenuInstance = ({ const { theme } = useTheme() const currentInstance = useSelector(getInstanceUrl) - const instance = status.uri && status.uri.split(new RegExp(/\/\/(.*?)\//))[1] + const instance = status?.uri && status.uri.split(new RegExp(/\/\/(.*?)\//))[1] const queryClient = useQueryClient() const mutation = useTimelineMutation({ diff --git a/src/components/ContextMenu/status.ts b/src/components/ContextMenu/status.ts index 5579a390..20f94fb6 100644 --- a/src/components/ContextMenu/status.ts +++ b/src/components/ContextMenu/status.ts @@ -70,7 +70,7 @@ const contextMenuStatus = ({ getInstanceAccount, (prev, next) => prev.id === next.id ) - const ownAccount = instanceAccount?.id === status.account.id + const ownAccount = instanceAccount?.id === status?.account.id if (ownAccount) { const accountMenuItems: ContextMenuAction[] = [