forked from eatvio/eatvio_app
feat(order info): added order info screen
This commit is contained in:
@@ -27,7 +27,7 @@ class WsManager {
|
||||
Stream<ChannelReadEvent>? get clientTypingStream => _privateDirectChatChannel?.bind('client-typing');
|
||||
|
||||
Future<void> initialize() async {
|
||||
if (this.client == null) {
|
||||
if (client == null) {
|
||||
try {
|
||||
await TokenStorage.haveTokenInStorage();
|
||||
final wsUrl = await wsService.getWebsocket();
|
||||
@@ -37,7 +37,7 @@ class WsManager {
|
||||
key: wsUrl.key,
|
||||
host: wsUrl.host,
|
||||
shouldSupplyMetadataQueries: true,
|
||||
metadata: PusherChannelsOptionsMetadata.byDefault(),
|
||||
metadata: const PusherChannelsOptionsMetadata.byDefault(),
|
||||
port: 443,
|
||||
);
|
||||
client = PusherChannelsClient.websocket(
|
||||
@@ -58,7 +58,7 @@ class WsManager {
|
||||
|
||||
await client?.connect();
|
||||
|
||||
this.client = client;
|
||||
client = client;
|
||||
userId = wsUrl.userId;
|
||||
|
||||
await _initPrivateNotificationsChannel();
|
||||
@@ -82,10 +82,10 @@ class WsManager {
|
||||
|
||||
Future<void> _initPrivateNotificationsChannel() async {
|
||||
final token = await TokenStorage.getTokenFromStorage();
|
||||
_privateNotificationChannel = await client?.privateChannel(
|
||||
_privateNotificationChannel = client?.privateChannel(
|
||||
'$newNotificationsChannelName.$userId',
|
||||
authorizationDelegate: EndpointAuthorizableChannelTokenAuthorizationDelegate.forPrivateChannel(
|
||||
authorizationEndpoint: Uri.parse(baseUrl + '/broadcasting/auth'),
|
||||
authorizationEndpoint: Uri.parse('$baseUrl/broadcasting/auth'),
|
||||
headers: {
|
||||
'Authorization': 'Bearer $token',
|
||||
},
|
||||
@@ -95,10 +95,10 @@ class WsManager {
|
||||
|
||||
Future<void> _initPrivateMessagesChannel() async {
|
||||
final token = await TokenStorage.getTokenFromStorage();
|
||||
_privateMessagesChannel = await client?.privateChannel(
|
||||
_privateMessagesChannel = client?.privateChannel(
|
||||
'$newMessagesChannelName.$userId',
|
||||
authorizationDelegate: EndpointAuthorizableChannelTokenAuthorizationDelegate.forPrivateChannel(
|
||||
authorizationEndpoint: Uri.parse(baseUrl + '/broadcasting/auth'),
|
||||
authorizationEndpoint: Uri.parse('$baseUrl/broadcasting/auth'),
|
||||
headers: {
|
||||
'Authorization': 'Bearer $token',
|
||||
},
|
||||
@@ -108,10 +108,10 @@ class WsManager {
|
||||
|
||||
Future<void> initPrivateDirectChatChannel(String chatId) async {
|
||||
final token = await TokenStorage.getTokenFromStorage();
|
||||
_privateDirectChatChannel = await client?.privateChannel(
|
||||
_privateDirectChatChannel = client?.privateChannel(
|
||||
'$directChatChannelName.$chatId',
|
||||
authorizationDelegate: EndpointAuthorizableChannelTokenAuthorizationDelegate.forPrivateChannel(
|
||||
authorizationEndpoint: Uri.parse(baseUrl + '/broadcasting/auth'),
|
||||
authorizationEndpoint: Uri.parse('$baseUrl/broadcasting/auth'),
|
||||
headers: {
|
||||
'Authorization': 'Bearer $token',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user