mattermost-mobile/app/queries/servers/features.ts
Daniel Espino García ba52acb26f
Add GM as DM feature support (#7515)
* Add GM as DM feature support

* Minor fix

* Address feedback

* Fix case for non set channel notify prop

* Fix strings
2023-09-26 18:35:40 +02:00

18 lines
607 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {of as of$} from 'rxjs';
import {switchMap} from 'rxjs/operators';
import {GM_AS_DM_VERSION} from '@constants/versions';
import {isMinimumServerVersion} from '@utils/helpers';
import {observeConfigValue} from './system';
import type {Database} from '@nozbe/watermelondb';
export const observeHasGMasDMFeature = (database: Database) => {
return observeConfigValue(database, 'Version').pipe(
switchMap((v) => of$(isMinimumServerVersion(v, ...GM_AS_DM_VERSION))),
);
};