Clean saved content iff submitted successfully

parent b01fc29c
......@@ -190,12 +190,17 @@ function submit_post() {
}),
success: function (oid) {
if ("failed" === oid)
{
show_msg_layer("Post new article failed, please check!");
else if ("_____colt_____Intro" === title)
return;
}
if ("_____colt_____Intro" === title)
window.location.pathname = "/about";
else
window.location.pathname = "/article/preview/oid/" + oid;
// We shouldn't clean the saved content before it submitted successfully
localStorage.setItem('colt.saved_content', "");
}
})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment