Ensure we are always using conversationId for story actions
This commit is contained in:
parent
68adb736d3
commit
37f9346f57
3 changed files with 12 additions and 5 deletions
|
@ -163,6 +163,7 @@ export const StoriesPane = ({
|
|||
>
|
||||
{renderedStories.map(story => (
|
||||
<StoryListItem
|
||||
conversationId={story.conversationId}
|
||||
group={story.group}
|
||||
i18n={i18n}
|
||||
key={story.storyView.timestamp}
|
||||
|
@ -190,6 +191,7 @@ export const StoriesPane = ({
|
|||
{isShowingHiddenStories &&
|
||||
hiddenStories.map(story => (
|
||||
<StoryListItem
|
||||
conversationId={story.conversationId}
|
||||
key={story.storyView.timestamp}
|
||||
i18n={i18n}
|
||||
isHidden
|
||||
|
|
|
@ -20,6 +20,9 @@ export default {
|
|||
title: 'Components/StoryListItem',
|
||||
component: StoryListItem,
|
||||
argTypes: {
|
||||
conversationId: {
|
||||
defaultValue: getDefaultConversation().id,
|
||||
},
|
||||
i18n: {
|
||||
defaultValue: i18n,
|
||||
},
|
||||
|
|
|
@ -14,6 +14,7 @@ import { StoryImage } from './StoryImage';
|
|||
import { getAvatarColor } from '../types/Colors';
|
||||
|
||||
export type PropsType = Pick<ConversationStoryType, 'group' | 'isHidden'> & {
|
||||
conversationId: string;
|
||||
i18n: LocalizerType;
|
||||
onGoToConversation: (conversationId: string) => unknown;
|
||||
onHideStory: (conversationId: string) => unknown;
|
||||
|
@ -26,6 +27,7 @@ export type PropsType = Pick<ConversationStoryType, 'group' | 'isHidden'> & {
|
|||
};
|
||||
|
||||
export const StoryListItem = ({
|
||||
conversationId,
|
||||
group,
|
||||
i18n,
|
||||
isHidden,
|
||||
|
@ -83,7 +85,7 @@ export const StoryListItem = ({
|
|||
: i18n('StoryListItem__hide'),
|
||||
onClick: () => {
|
||||
if (isHidden) {
|
||||
onHideStory(sender.id);
|
||||
onHideStory(conversationId);
|
||||
} else {
|
||||
setHasConfirmHideStory(true);
|
||||
}
|
||||
|
@ -92,18 +94,18 @@ export const StoryListItem = ({
|
|||
{
|
||||
icon: 'StoryListItem__icon--info',
|
||||
label: i18n('StoryListItem__info'),
|
||||
onClick: () => viewUserStories(sender.id, true),
|
||||
onClick: () => viewUserStories(conversationId, true),
|
||||
},
|
||||
{
|
||||
icon: 'StoryListItem__icon--chat',
|
||||
label: i18n('StoryListItem__go-to-chat'),
|
||||
onClick: () => onGoToConversation(sender.id),
|
||||
onClick: () => onGoToConversation(conversationId),
|
||||
},
|
||||
]}
|
||||
moduleClassName={classNames('StoryListItem', {
|
||||
'StoryListItem--hidden': isHidden,
|
||||
})}
|
||||
onClick={() => viewUserStories(sender.id)}
|
||||
onClick={() => viewUserStories(conversationId)}
|
||||
popperOptions={{
|
||||
placement: 'bottom',
|
||||
strategy: 'absolute',
|
||||
|
@ -159,7 +161,7 @@ export const StoryListItem = ({
|
|||
<ConfirmationDialog
|
||||
actions={[
|
||||
{
|
||||
action: () => onHideStory(sender.id),
|
||||
action: () => onHideStory(conversationId),
|
||||
style: 'affirmative',
|
||||
text: i18n('StoryListItem__hide-modal--confirm'),
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue