Browse Source

wait for localforage callback before redirecting

should help clear out the draft when a post is created.

for #109
pull/110/head
Aaron Parecki 5 years ago
parent
commit
f8b122256f
No known key found for this signature in database GPG Key ID: 276C2817346D6056
  1. 3
      views/new-post.php

3
views/new-post.php

@ -815,7 +815,7 @@ $(function(){
if(typeof response == "string") {
response = JSON.parse(response);
}
localforage.removeItem('current-note');
localforage.removeItem('current-note', function(){
if(response.location) {
window.location = response.location;
// console.log(response.location);
@ -825,6 +825,7 @@ $(function(){
$("#test_success").addClass('hidden');
$("#test_error").removeClass('hidden');
}
});
} catch(e) {
$("#test_success").addClass('hidden');
$("#test_error").removeClass('hidden');

Loading…
Cancel
Save