Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove empty localStorage entries #132

Merged
merged 1 commit into from
Jan 13, 2020
Merged

Conversation

Situphen
Copy link

Make sure that EasyMDE do not create empty localStorage entries.

@Situphen
Copy link
Author

Hi @Ionaru, do you know when this could be merged? :)

@@ -1945,7 +1945,12 @@ EasyMDE.prototype.autosave = function () {
this.options.autosave.loaded = true;
}

localStorage.setItem('smde_' + this.options.autosave.uniqueId, easyMDE.value());
var value = easyMDE.value();
if (value != '') {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (value != '') {
if (value !== '') {

It's better to always use tripe-equals

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

@Ionaru Ionaru merged commit c39b521 into Ionaru:master Jan 13, 2020
Ionaru added a commit that referenced this pull request Jan 13, 2020
@Situphen Situphen deleted the localstorage branch January 14, 2020 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants