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