Skip to content

Commit

Permalink
fix: fixed error #9 when adding a text extract
Browse files Browse the repository at this point in the history
  • Loading branch information
elblogbruno committed Mar 4, 2021
1 parent fba0434 commit ee4c50e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 1 addition & 3 deletions Chrome Extension/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ async function AddTextToMind(info,tab) {
var text = info.selectionText;
var url = tab.url;
urlParams = `add_text_to_mind?url=${url}&text=${text}`;

req.open("GET", baseUrl+urlParams, true);

req.onreadystatechange = function() { // Call a function when the state changes.
if (this.readyState === XMLHttpRequest.DONE && this.status === 200) {
parseAndSwitchResponse(this.responseText);
Expand Down Expand Up @@ -146,7 +145,6 @@ async function ProcessSelection(info,tab) {
default:
break;
}

req.open("GET", baseUrl+urlParams, true);
req.send();

Expand Down
3 changes: 3 additions & 0 deletions Python Server/app/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ async def add_url_to_mind():
async def add_text_to_mind():
url = request.args.get('url')
text = request.args.get('text')
if len(request.args) > 2:
l = request.args.to_dict()
text = text + " & " + str(list(l)[-1])
return str(notion.add_text_to_database(text, url))


Expand Down

0 comments on commit ee4c50e

Please sign in to comment.