fix hashchange listener

This commit is contained in:
2022-09-01 00:49:12 +08:00
parent 1b2800e386
commit e2505377cd

View File

@@ -26,7 +26,7 @@ class ControlBar extends PureComponent {
let text = decodeURIComponent(window.location.hash).substr(1);
if (text.lastIndexOf('?') !== -1)
text = text.substr(0, text.lastIndexOf('?')); // fuck wechat '#param?nsukey=...'
if (text === '##') return;
if (text !== '#' && text !== '##') {
this.setState(
{
search_text: text,
@@ -36,7 +36,9 @@ class ControlBar extends PureComponent {
},
);
}
}
console.log('add change lis');
window.addEventListener(
'hashchange',
() => {