refactor(blog_post): Refactoring blog post create and conflict resolve

This commit is contained in:
2024-07-01 16:57:43 +03:00
parent beaaecad3c
commit a022d87adb
13 changed files with 23 additions and 56 deletions

View File

@@ -15,37 +15,6 @@ class InitializationCubit extends Cubit<InitializationState> {
final wsUrl = await chatRepository.getWebsocket();
PusherOptions options = PusherOptions(
host: 'socket.mobile-stage.eatvio.ru',
wsPort: 443,
encrypted: true,
auth: PusherAuth(
'wss://' + wsUrl.host + '/app/' + wsUrl.key,
headers: {
'Authorization': 'Bearer ${TokenStorage.getTokenFromStorage()}',
},
),
);
PusherClient pusherClient = PusherClient(
wsUrl.key,
options,
autoConnect: true,
enableLogging: true,
);
await pusherClient.connect();
emit(const InitializationState.success());
Channel channel = pusherClient.subscribe('private-direct-chat.' + '7909ea56-7822-4d5f-8892-134bc937127f');
channel.bind("pusher_internal:subscription_succeeded", (PusherEvent? event) {
channel.trigger("pusher_internal:subscription_succeeded", {});
});
channel.registerListener('pusher:subscribe', (data) => print(data.toString()));
} catch (e) {
print(e);
emit(InitializationState.error(errorMessage: e.toString()));