Skip to content

Commit

Permalink
Minor cleanup of the file dialog code for attaching files.
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Barrera <chrisbarrera@icloud.com>
  • Loading branch information
Christopher Barrera committed Jul 5, 2024
1 parent 6000205 commit d3685e7
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions gpt4all-chat/qml/ChatView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Rectangle {
property var currentChat: ChatListModel.currentChat
property var chatModel: currentChat.chatModel
property var fileContents: ""
property var attachFile
signal addCollectionViewRequested()
signal addModelViewRequested()

Expand Down Expand Up @@ -1709,20 +1708,16 @@ Rectangle {
nameFilters: ["Text files (*.txt *.md *.rst)"]

onAccepted: {
attachFile = fileDialog.selectedFile;
var attachFile = fileDialog.selectedFile;
if (attachFile !== "") {
var request = new XMLHttpRequest();
request.onreadystatechange = function() {
console.log("Ready state changed: %1".arg(request.readyState));
console.log(attachFile);
if (request.readyState == XMLHttpRequest.DONE) {
fileContents = request.responseText;
}
}
request.open("GET", attachFile, true);
request.send();
console.log(fileContents);
console.log("^^contents^^");
}
}
}
Expand Down

0 comments on commit d3685e7

Please # to comment.