diff --git a/src/main/kotlin/cn/yiiguxing/plugin/translate/diagnostic/ReportSubmitter.kt b/src/main/kotlin/cn/yiiguxing/plugin/translate/diagnostic/ReportSubmitter.kt index 006513225..96ff14faa 100644 --- a/src/main/kotlin/cn/yiiguxing/plugin/translate/diagnostic/ReportSubmitter.kt +++ b/src/main/kotlin/cn/yiiguxing/plugin/translate/diagnostic/ReportSubmitter.kt @@ -83,7 +83,7 @@ internal class ReportSubmitter : ErrorReportSubmitter() { private fun requestNewCredentials(project: Project?, parentComponent: JComponent?) { val (user, token) = try { - TranslationGitHubAppService.instance.auth(project, parentComponent as JComponent) ?: return + TranslationGitHubAppService.auth(project, parentComponent as JComponent) ?: return } catch (e: Exception) { LOG.w("Failed to request new credentials", e) diff --git a/src/main/kotlin/cn/yiiguxing/plugin/translate/diagnostic/github/TranslationGitHubAppService.kt b/src/main/kotlin/cn/yiiguxing/plugin/translate/diagnostic/github/TranslationGitHubAppService.kt index 2c57bf052..a777fd039 100644 --- a/src/main/kotlin/cn/yiiguxing/plugin/translate/diagnostic/github/TranslationGitHubAppService.kt +++ b/src/main/kotlin/cn/yiiguxing/plugin/translate/diagnostic/github/TranslationGitHubAppService.kt @@ -3,23 +3,16 @@ package cn.yiiguxing.plugin.translate.diagnostic.github import cn.yiiguxing.plugin.translate.diagnostic.github.auth.* import cn.yiiguxing.plugin.translate.message import cn.yiiguxing.plugin.translate.util.Application -import com.intellij.openapi.components.Service -import com.intellij.openapi.components.service import com.intellij.openapi.project.Project import com.intellij.util.concurrency.annotations.RequiresEdt import javax.swing.JComponent -@Service -internal class TranslationGitHubAppService private constructor() { +internal object TranslationGitHubAppService { - companion object { - private const val CLIENT_ID = "e8a353548fe014bb27de" + private const val CLIENT_ID = "e8a353548fe014bb27de" - private val SCOPES: Array = arrayOf("public_repo") - - val instance: TranslationGitHubAppService = service() - } + private val SCOPES: Array = arrayOf("public_repo") @RequiresEdt