Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
Fix issue #121 - notes with resources but no content weren't created
Browse files Browse the repository at this point in the history
When creating a note, but not explicitly providing content, geeknote
assumes the editor should be used to collect user input.  It then
creates a note only when the content is changed.  If the content
remains empty, no note would have been created.

Now, we create the new note anyway even when the empty content is unchanged.
Perhaps a better fix would be to create the note only if a resource
were provided in that case.  I'm not sure that's obvious behavior though.
  • Loading branch information
jeffkowalski committed Oct 1, 2019
1 parent 5cc6a91 commit 4aba8fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion geeknote/geeknote.py
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ def _editWithEditorInThread(
result = True
prevChecksum = editor.getTempfileChecksum()
while True:
if prevChecksum != editor.getTempfileChecksum() and result:
if (prevChecksum != editor.getTempfileChecksum() or not note) and result:
newContent = open(editor.tempfile, "r").read()
ext = os.path.splitext(editor.tempfile)[1]
mapping = {
Expand Down

0 comments on commit 4aba8fb

Please sign in to comment.