forked from Ivasoft/mattermost-mobile
* Global threads * Added translations * User avatar stack * In-Channel experience * Misc Fixes * Fixed fetchPostThread & added observer * using the observable for participants & check fix * Test case fix * Fix tablet view thread screen switching * No back button for tablets * folders for thread options only if needed * Using the existing observable * Users stack refactor fix * Reusing the user component * Refactor fix * Fixes double loaders when empty threads * Feedback * Moved some post options to common post options * Combined follow/unfollow functions * Feedback fixes * Addressing Feedback * Merge fix * Threads button component moved * Addressing feedbackk * Not rendering message when it's empty, removed unwanted Props exports * Addressing feedbac * Updated snapshot * Added emoji to removemarkdown component * Moved MD rendering into the component Co-authored-by: Mattermod <mattermod@users.noreply.github.com> Co-authored-by: koox00 <3829551+koox00@users.noreply.github.com>
28 lines
894 B
TypeScript
28 lines
894 B
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {withDatabase} from '@nozbe/watermelondb/DatabaseProvider';
|
|
import withObservables from '@nozbe/with-observables';
|
|
|
|
import {observePostSaved} from '@queries/servers/post';
|
|
import {observeCurrentTeam} from '@queries/servers/team';
|
|
|
|
import ThreadOptions from './thread_options';
|
|
|
|
import type {WithDatabaseArgs} from '@typings/database/database';
|
|
import type ThreadModel from '@typings/database/models/servers/thread';
|
|
|
|
type Props = WithDatabaseArgs & {
|
|
thread: ThreadModel;
|
|
};
|
|
|
|
const enhanced = withObservables(['thread'], ({database, thread}: Props) => {
|
|
return {
|
|
isSaved: observePostSaved(database, thread.id),
|
|
post: thread.post.observe(),
|
|
team: observeCurrentTeam(database),
|
|
};
|
|
});
|
|
|
|
export default withDatabase(enhanced(ThreadOptions));
|