mattermost-mobile/app/actions/views/threads.ts
Anurag Shivarathri a81b56212e
MM-38784, MM-38409 New messages line in threads screen & Pull to refresh for global threads screen (#5690)
* New messages line in threads & Pull to refresh for global threads

* Updated snapshot

* Using postlist's RefreshControl component

* Updated threadlist snapshot

* Reverting snapshot

* Updated Snapshots

* Snapshots updated

* Added 'thread last viewed at' to handle new messages line correctly

* Lint fix

* Updated snapshots

* Reverted comparision check

* Remove unused code

* Batching actions

* Do not add new message line for self messages

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-10-07 15:14:34 +05:30

31 lines
847 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {ViewTypes} from '@constants';
export function updateThreadLastViewedAt(threadId: string, lastViewedAt: number) {
return {
type: ViewTypes.THREAD_LAST_VIEWED_AT,
data: {
threadId,
lastViewedAt,
},
};
}
export const handleViewingGlobalThreadsScreen = () => (
{
type: ViewTypes.VIEWING_GLOBAL_THREADS_SCREEN,
}
);
export const handleNotViewingGlobalThreadsScreen = () => ({
type: ViewTypes.NOT_VIEWING_GLOBAL_THREADS_SCREEN,
});
export const handleViewingGlobalThreadsAll = () => ({
type: ViewTypes.VIEWING_GLOBAL_THREADS_ALL,
});
export const handleViewingGlobalThreadsUnreads = () => ({
type: ViewTypes.VIEWING_GLOBAL_THREADS_UNREADS,
});