Fixed minor bug

This commit is contained in:
Maxim Stewart 2020-05-11 15:49:58 -05:00
parent e82e80ad39
commit 3cd8fcea28
2 changed files with 6 additions and 7 deletions

View File

@ -188,8 +188,9 @@ def addNote():
text = request.values['entryText'].strip()
if request.method == 'POST' and text != '':
try:
encodedStr = text
decodedStr = base64.urlsafe_b64decode(encodedStr.encode('utf-8')).decode('utf-8')
encodedStr = text.strip()
decodedStrPart = base64.urlsafe_b64decode(encodedStr.encode('utf-8')).decode('utf-8')
decodedStr = unquote(decodedStrPart)
notesListDecoded.append(decodedStr)
notesListEncoded.append(encodedStr)

View File

@ -83,11 +83,9 @@ const deleteAllTextAction = () => {
const createFormData = (entry) => {
let form = new FormData();
for (var i = 0; i < entry.length; i++) {
// Encoded special characters then encode to b64
encodedStr = window.btoa(encodeURIComponent(note))
form.append("entryText", encodedStr);
}
// Encoded special characters then encode to b64
encodedStr = window.btoa(encodeURIComponent(entry))
form.append("entryText", encodedStr);
return form;
}