Hidden stories list/unhide stories
This commit is contained in:
parent
c165bc964a
commit
d776deae01
5 changed files with 84 additions and 14 deletions
|
@ -52,7 +52,7 @@ export const Stories = ({
|
|||
const storyIndex = stories.findIndex(
|
||||
x => x.conversationId === conversationIdToView
|
||||
);
|
||||
if (storyIndex >= stories.length - 1) {
|
||||
if (storyIndex >= stories.length - 1 || storyIndex === -1) {
|
||||
setConversationIdToView(undefined);
|
||||
return;
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ export const Stories = ({
|
|||
const storyIndex = stories.findIndex(
|
||||
x => x.conversationId === conversationIdToView
|
||||
);
|
||||
if (storyIndex === 0) {
|
||||
if (storyIndex <= 0) {
|
||||
setConversationIdToView(undefined);
|
||||
return;
|
||||
}
|
||||
|
@ -77,16 +77,7 @@ export const Stories = ({
|
|||
hiddenStories={hiddenStories}
|
||||
i18n={i18n}
|
||||
onBack={toggleStoriesView}
|
||||
onStoryClicked={conversationId => {
|
||||
const storyIndex = stories.findIndex(
|
||||
x => x.conversationId === conversationId
|
||||
);
|
||||
const foundStory = stories[storyIndex];
|
||||
|
||||
if (foundStory) {
|
||||
setConversationIdToView(conversationId);
|
||||
}
|
||||
}}
|
||||
onStoryClicked={setConversationIdToView}
|
||||
openConversationInternal={openConversationInternal}
|
||||
queueStoryDownload={queueStoryDownload}
|
||||
stories={stories}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue