fix hashchange listener
This commit is contained in:
@@ -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',
|
||||
() => {
|
||||
|
||||
Reference in New Issue
Block a user