Skip to content

Commit

Permalink
fix(drafts): load draft only if textarea is present
Browse files Browse the repository at this point in the history
  • Loading branch information
g-div committed Oct 11, 2017
1 parent d59eee3 commit 1db4180
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build/embed.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/embed/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import comments_tpl from './comments.jst.html';
const preview = $(`${target} .schnack-form blockquote.schnack-body`);

const draft = window.localStorage.getItem(`schnack-draft-${slug}`);
if (draft) textarea.value = draft;
if (draft && textarea) textarea.value = draft;

const postBtn = $(target + ' .schnack-button');
const previewBtn = $(target + ' .schnack-preview');
Expand Down

0 comments on commit 1db4180

Please sign in to comment.