Skip to content

Commit 4993f40

Browse files
committed
refactor(ollamaManager): simplify status messages for model updates
The commit simplifies the status messages displayed when updating Ollama models by: - Removing conditional message logic based on hostname selection - Standardising the success message to always use "updated to" - Simplifying the error message to consistently use "updating" terminology - Removing unnecessary variables that were used for message construction
1 parent c36a4c8 commit 4993f40

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/ollamaManager.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,11 @@ export class OllamaManager {
6262
}
6363
await config.update("ollamaModel", selectedModel, true)
6464

65-
const action = includeHostnameSelection ? "selected" : "changed to"
66-
67-
window.setStatusBarMessage(`✓ Ollama model '${selectedModel}' ${action} successfully`, 4000)
65+
window.setStatusBarMessage(`✓ Ollama model updated to '${selectedModel}' successfully`, 4000)
6866

6967
return true
7068
} catch (error) {
71-
const operation = includeHostnameSelection ? "selecting" : "changing"
72-
console.error(`Error ${operation} Ollama model:`, error)
69+
console.error(`Error updating Ollama model:`, error)
7370

7471
if (error instanceof Error) {
7572
if (error.message.includes("ECONNREFUSED") || error.message.includes("fetch")) {

0 commit comments

Comments
 (0)