Fix: backward detection

This commit is contained in:
eight 2020-02-01 17:41:05 +08:00
parent 22748d0e18
commit f167e62b86

View File

@ -45,7 +45,8 @@ const router = (() => {
Send an empty string to remove the hash.
*/
if (buffer.length > 1) {
if (!hash && !buffer[buffer.length - 2].includes('#') || buffer[buffer.length - 2].endsWith(hash)) {
if (!hash && !buffer[buffer.length - 2].includes('#') ||
hash && buffer[buffer.length - 2].endsWith(hash)) {
history.back();
return;
}