From 7af5445a94dd5d16e74596d1955be8eb3445a30b Mon Sep 17 00:00:00 2001 From: Daniel M Date: Sat, 6 Jan 2024 16:36:02 -0500 Subject: [PATCH] fix:handle no internet connection better --- gradle.properties | 2 +- .../com/dsoftware/ghmanager/data/WorkflowRunListLoader.kt | 2 +- .../com/dsoftware/ghmanager/ui/panels/WorkflowRunListPanel.kt | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index f5baa649..70e3ec9c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,7 +12,7 @@ pluginUntilBuild=235.* # IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension platformType=IC #platformVersion=LATEST-EAP-SNAPSHOT -platformVersion=2023.2.5 +platformVersion=2023.3.2 # Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html # Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22 diff --git a/src/main/kotlin/com/dsoftware/ghmanager/data/WorkflowRunListLoader.kt b/src/main/kotlin/com/dsoftware/ghmanager/data/WorkflowRunListLoader.kt index 50620741..1b99d5ad 100644 --- a/src/main/kotlin/com/dsoftware/ghmanager/data/WorkflowRunListLoader.kt +++ b/src/main/kotlin/com/dsoftware/ghmanager/data/WorkflowRunListLoader.kt @@ -62,7 +62,7 @@ class WorkflowRunListLoader( Disposer.register(parentDisposable, this) val scheduler = AppExecutorUtil.getAppScheduledExecutorService() task = scheduler.scheduleWithFixedDelay({ - if (refreshRuns) loadMore(update = true) + if (refreshRuns && error == null) loadMore(update = true) }, 1, frequency(), TimeUnit.SECONDS) LOG.debug("Create CollectionListModel() and loader") listModel.removeAll() diff --git a/src/main/kotlin/com/dsoftware/ghmanager/ui/panels/WorkflowRunListPanel.kt b/src/main/kotlin/com/dsoftware/ghmanager/ui/panels/WorkflowRunListPanel.kt index 35ed001a..f7715f24 100644 --- a/src/main/kotlin/com/dsoftware/ghmanager/ui/panels/WorkflowRunListPanel.kt +++ b/src/main/kotlin/com/dsoftware/ghmanager/ui/panels/WorkflowRunListPanel.kt @@ -272,10 +272,10 @@ internal class WorkflowRunListLoaderPanel( return } LOG.warn("Got error when getting workflow-runs: $error") - runListComponent.emptyText.appendText( + runListComponent.emptyText.setText( "Can't load workflow runs - check that the token you set in GitHub settings have sufficient permissions", SimpleTextAttributes.ERROR_ATTRIBUTES - ).appendSecondaryText( + ).appendLine( getLoadingErrorText(workflowRunsLoader.url, error), SimpleTextAttributes.ERROR_ATTRIBUTES, null