Files
mattermost-mobile/types/launch/index.ts
Elias Nahum d35eac8bd3 Gekidou servers (#5960)
* Servers logout and websocket state

* addNewServer uility and rename file

* add LaunchType for add new server

* added time to LaunchProps type

* Remove unnecessary props for launchToHome

* Fix local action updateLastPostAt

* Batch fetchProfilesPerChannels requests in chunks of 50

* WS handleUserAddedToChannelEvent to return early if no channelId is set

* WS handleNewPostEvent to batch update last_post_at

* add common actions to sync other servers

* Entry actions to sync other servers data

* Do not attempt to fetch notification data if payload does not contain a channelId

* Set database as default at the end of the login flow

* Handle logout when other servers remain

* Handle Server options

* Show alert when logging out from the account screen

* Add workaround to have Lottie animate the loading component

* Fix badge position in ServerIcon component

* Server screen to support adding new server

* Fix login screen to display error when credentials do not match

* add localization strings

* fix DatabaseProvider to update on server switch

* Fix home icon and server icon subscriptions and badge display

* Add dependencies to onLogout callback

* feedback

* Only updateLastPostAt if needed
2022-02-14 16:39:29 -03:00

63 lines
1.4 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
export interface DeepLink {
serverUrl: string;
teamName: string;
}
export interface DeepLinkChannel extends DeepLink {
channelName: string;
}
export interface DeepLinkDM extends DeepLink {
userName: string;
}
export interface DeepLinkPermalink extends DeepLink {
postId: string;
}
export interface DeepLinkGM extends DeepLink {
channelId: string;
}
export interface DeepLinkPlugin extends DeepLink {
id: string;
}
export const DeepLinkType = {
Channel: 'channel',
DirectMessage: 'dm',
GroupMessage: 'gm',
Invalid: 'invalid',
Permalink: 'permalink',
Plugin: 'plugin',
} as const;
export type DeepLinkType = typeof DeepLinkType[keyof typeof DeepLinkType];
export interface DeepLinkWithData {
type: DeepLinkType;
data?: DeepLinkChannel | DeepLinkDM | DeepLinkGM | DeepLinkPermalink | DeepLinkPlugin;
}
export const LaunchType = {
AddServer: 'add-server',
Normal: 'normal',
DeepLink: 'deeplink',
Notification: 'notification',
Upgrade: 'upgrade',
} as const;
export type LaunchType = typeof LaunchType[keyof typeof LaunchType];
export interface LaunchProps {
extra?: DeepLinkWithData | NotificationWithData;
launchType: LaunchType;
launchError?: Boolean;
serverUrl?: string;
displayName?: string;
time?: number;
}