mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-28 23:32:26 +00:00
Merge pull request #3650 from overleaf/ta-file-tree-new-doc-listener-fix
Prevent Multiple Listeners on FileTreeReactBridge GitOrigin-RevId: 49a09238156472f6cf18eafbf628a0443e9214a9
This commit is contained in:
parent
6e8a4e70dd
commit
8d3bb116d8
1 changed files with 10 additions and 2 deletions
|
@ -76,7 +76,11 @@ App.controller('FileTreeController', function($scope, $modal, ide, $rootScope) {
|
|||
}
|
||||
})
|
||||
|
||||
if (window.showReactFileTree) {
|
||||
if (
|
||||
window.showReactFileTree &&
|
||||
!window.FileTreeReactBridgeOpenNewDocModalListened
|
||||
) {
|
||||
window.FileTreeReactBridgeOpenNewDocModalListened = true
|
||||
window.addEventListener(
|
||||
'FileTreeReactBridge.openNewDocModal',
|
||||
({ detail }) => {
|
||||
|
@ -203,7 +207,11 @@ App.controller('NewFileModalController', function(
|
|||
$modalInstance.dismiss('done')
|
||||
})
|
||||
|
||||
if (window.showReactFileTree) {
|
||||
if (
|
||||
window.showReactFileTree &&
|
||||
!window.FileTreeReactBridgeOpenNewFileModalListened
|
||||
) {
|
||||
window.FileTreeReactBridgeOpenNewFileModalListened = true
|
||||
window.addEventListener(
|
||||
'FileTreeReactBridge.openNewFileModal',
|
||||
({ detail }) => {
|
||||
|
|
Loading…
Reference in a new issue