Files
mattermost-mobile/app/database/models/server/my_channel.ts
Avinash Lingaloo 2c193f2133 [GEKIDOU] Bottom Tab Navigation (#5600)
* Started with bottom tabs layout

* code clean up

* Added animation to bottom tab bar

* returns null if not focused

* code clean up

* Updating layout

* Updated modal screen

* Updated animation

* Updated animation

* Fix SafeArea on Home

* A few clean ups

* code clean up

* Fix issue with navigation on Android

* Use React Navigation in combination of RNN & create bottom tab bar

* Set tab bar line separator height to 0.5

* Fix snapshot tests

* Add home tab mention badge

* Apply new themes

* Home Tab badge

* Remove unused constants

Co-authored-by: Avinash Lingaloo <>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2021-08-31 14:58:53 -04:00

46 lines
1.7 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {Relation} from '@nozbe/watermelondb';
import {field, immutableRelation} from '@nozbe/watermelondb/decorators';
import Model, {Associations} from '@nozbe/watermelondb/Model';
import {MM_TABLES} from '@constants/database';
import type ChannelModel from '@typings/database/models/servers/channel';
const {CHANNEL, MY_CHANNEL} = MM_TABLES.SERVER;
/**
* MyChannel is an extension of the Channel model but it lists only the Channels the app's user belongs to
*/
export default class MyChannelModel extends Model {
/** table (name) : MyChannel */
static table = MY_CHANNEL;
static associations: Associations = {
[CHANNEL]: {type: 'belongs_to', key: 'id'},
};
/** last_post_at : The timestamp for any last post on this channel */
@field('last_post_at') lastPostAt!: number;
/** last_viewed_at : The timestamp showing the user's last viewed post on this channel */
@field('last_viewed_at') lastViewedAt!: number;
/** manually_unread : Determine if the user marked a post as unread */
@field('manually_unread') manuallyUnread!: boolean;
/** mentions_count : The number of mentions on this channel */
@field('mentions_count') mentionsCount!: number;
/** message_count : The derived number of unread messages on this channel */
@field('message_count') messageCount!: number;
/** roles : The user's privileges on this channel */
@field('roles') roles!: string;
/** channel : The relation pointing to the CHANNEL table */
@immutableRelation(CHANNEL, 'id') channel!: Relation<ChannelModel>;
}