* Add connection banner * Switch icon depending on whether it is connected or not * Clean timeout and change text * Handle optimistic approach * Piggyback server item fix * Use toMilliseconds util function * Set the websocket as disconnected when we are manually closing it * Do not hide banner when app state changes Co-authored-by: Daniel Espino <danielespino@MacBook-Pro-de-Daniel.local>
15 lines
548 B
TypeScript
15 lines
548 B
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import withObservables from '@nozbe/with-observables';
|
|
|
|
import {withServerUrl} from '@context/server';
|
|
import websocket_manager from '@managers/websocket_manager';
|
|
|
|
import ConnectionBanner from './connection_banner';
|
|
|
|
const enhanced = withObservables(['serverUrl'], ({serverUrl}: {serverUrl: string}) => ({
|
|
isConnected: websocket_manager.observeConnected(serverUrl),
|
|
}));
|
|
|
|
export default withServerUrl(enhanced(ConnectionBanner));
|