Skip to content

Commit

Permalink
fix: Fixed getModels function not called when initial start.
Browse files Browse the repository at this point in the history
  • Loading branch information
imoize committed Sep 5, 2024
1 parent 15378f0 commit 467f30a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions package/contents/ui/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,18 +239,18 @@ function checkStat() {
xhr.onreadystatechange = function() {
if (xhr.readyState === XMLHttpRequest.DONE) {
if (xhr.status === 200) {
if (ollamaRunning === false) {
getModels();
}
ollamaRunning = true;

updateActionButton("Stop Ollama", Qt.resolvedUrl("icons/stop.svg"), "stopOllama");

// console.log("Ollama Running: " + ollamaRunning + " | Ollama is running");
} else {
endAll();
ollamaRunning = false;

models.clear();
runningModels.clear();

updateActionButton("Start Ollama", Qt.resolvedUrl("icons/start.svg"), "startOllama");

// console.log("Ollama Running: " + ollamaRunning + " | Ollama is not running");
Expand Down
2 changes: 1 addition & 1 deletion package/contents/ui/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ PlasmoidItem {

Component.onCompleted: () => {
Utils.checkStat();
Utils.getModels();
// Utils.getModels();
}

ListModel {
Expand Down

0 comments on commit 467f30a

Please sign in to comment.