From 1b76d7742b15a9d99f6f996978da972f600c6360 Mon Sep 17 00:00:00 2001 From: Dmitrii Chechetkin Date: Tue, 28 May 2024 12:23:45 -0400 Subject: [PATCH] bumps version and adresses slow operation on EDT --- build.gradle.kts | 2 +- .../intellij/tree/iq/settings/OpenAISettingsState.java | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index a08850f9..07202e4e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,7 +4,7 @@ plugins { } group = "com.couchbase" -version = "1.1.1" +version = "1.1.2" java { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 diff --git a/src/main/java/com/couchbase/intellij/tree/iq/settings/OpenAISettingsState.java b/src/main/java/com/couchbase/intellij/tree/iq/settings/OpenAISettingsState.java index 68d1467d..4394144b 100644 --- a/src/main/java/com/couchbase/intellij/tree/iq/settings/OpenAISettingsState.java +++ b/src/main/java/com/couchbase/intellij/tree/iq/settings/OpenAISettingsState.java @@ -151,9 +151,11 @@ public String getApiKey() { } public void setApiKey(String apiKey) { - var credentialAttributes = createCredentialAttributes(getModelPage()); - PasswordSafe.getInstance().setPassword(credentialAttributes, apiKey); - setApiKeyMasked(maskText(apiKey)); + ApplicationManager.getApplication().executeOnPooledThread(() -> { + var credentialAttributes = createCredentialAttributes(getModelPage()); + PasswordSafe.getInstance().setPassword(credentialAttributes, apiKey); + setApiKeyMasked(maskText(apiKey)); + }); } private static String maskText(String text) {