Skip to content

Commit

Permalink
popstate
Browse files Browse the repository at this point in the history
  • Loading branch information
kenu committed Mar 23, 2024
1 parent 29bebc1 commit 005bf90
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions web/public/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@ function processHash() {

window.addEventListener('popstate', function (event) {
const hash = decodeURIComponent(location.hash)?.replace('#', '')
document.getElementById('channelLink').innerHTML = ''
document.getElementById('keyword').value = hash
if (hash) {
document.getElementById('keyword').value = hash
} else {
document.getElementById('channelLink').innerHTML = ''
document.getElementById('keyword').value = ''
}
search()
})

Expand Down

0 comments on commit 005bf90

Please sign in to comment.