Files
mattermost-mobile/app/helpers/api/post.ts
Kyriakos Z 5178091ab0 MM-40203: permalink modal viewer for mentions (#5999)
* Permalink initial commit

* Fixes: 10 items per page

* MM-40203: permalink modal viewer for mentions

Is triggered by pressing on an item in mentions,
and shows posts around that item, including the item in a modal.

* Adds previously deleted file

* address feedback

* Move showPermalink as a remote action

* address more feedback

* fetchPostsAround to only return PostModel

* Attempt to autoscroll to highlighted item

* Permalink to not highlight saved and pinned posts

* Add bottom margin using insets to permalink screen

* Use lottie loading indicator

* Switch to channel

* Missing translation string

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2022-03-14 16:41:46 -03:00

19 lines
440 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
export function filterPostsInOrderedArray(posts?: IDMappedObjects<Post>, order?: string[]) {
const result: IDMappedObjects<Post> = {};
if (!posts || !order) {
return result;
}
for (const id of order) {
if (posts[id]) {
result[id] = posts[id];
}
}
return result;
}