override fun eventDispatched()

in src/main/kotlin/com/jetbrains/interactiveRebase/listeners/PopupListener.kt [29:52]


    override fun eventDispatched(event: AWTEvent) {
        if (event.id == WindowEvent.WINDOW_OPENED) {
            try {
                val source = event.source as JDialog

                if (source.title == "Conflicts") {
                    val root = gitUtils.getRoot()
                    if (root == null) {
                        log.info("Repository root is null")
                        return
                    }
                    val modelService = project.service<ModelService>()
                    val currentMergingCommit = gitUtils.getCurrentRebaseCommit(project, root)

                    if (currentMergingCommit != modelService.previousConflictCommit) {
                        source.dispose()
                        modelService.showCustomMergeDialog(currentMergingCommit, root)
                    }
                }
            } catch (e: ClassCastException) {
                print("")
            }
        }
    }