2020-10-12 10:25:59 +00:00
|
|
|
import App from '../../../base'
|
|
|
|
import { react2angular } from 'react2angular'
|
2020-12-14 11:44:10 +00:00
|
|
|
import { rootContext } from '../../../shared/context/root-context'
|
2020-10-12 10:25:59 +00:00
|
|
|
|
2020-11-24 11:58:08 +00:00
|
|
|
import ChatPane from '../components/chat-pane'
|
2020-10-12 10:25:59 +00:00
|
|
|
|
2020-11-24 11:58:08 +00:00
|
|
|
App.controller('ReactChatController', function($scope, ide) {
|
2021-01-11 11:57:38 +00:00
|
|
|
$scope.chatIsOpen = ide.$scope.ui.chatOpen
|
|
|
|
|
|
|
|
ide.$scope.$watch('ui.chatOpen', newValue => {
|
|
|
|
$scope.$applyAsync(() => {
|
|
|
|
$scope.chatIsOpen = newValue
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
2020-11-24 11:58:08 +00:00
|
|
|
$scope.resetUnreadMessages = () =>
|
2020-10-12 10:25:59 +00:00
|
|
|
ide.$scope.$broadcast('chat:resetUnreadMessages')
|
|
|
|
})
|
|
|
|
|
2020-12-14 11:44:10 +00:00
|
|
|
App.component(
|
|
|
|
'chat',
|
2021-01-11 11:57:38 +00:00
|
|
|
react2angular(rootContext.use(ChatPane), [
|
|
|
|
'resetUnreadMessages',
|
|
|
|
'chatIsOpen'
|
|
|
|
])
|
2020-12-14 11:44:10 +00:00
|
|
|
)
|