Two little tweaks post ai search ship (#54265)
This commit is contained in:
@@ -43,7 +43,6 @@ export function useQueryParam(
|
||||
|
||||
// If the query param changes in the URL, update the state
|
||||
useEffect(() => {
|
||||
console.log('updating state')
|
||||
const paramValue = router.query[queryParamKey]
|
||||
|
||||
if (paramValue) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useState, useEffect } from 'react'
|
||||
import throttle from 'lodash/throttle'
|
||||
|
||||
export function useInnerWindowWidth() {
|
||||
const hasWindow = typeof window !== 'undefined'
|
||||
@@ -14,9 +15,9 @@ export function useInnerWindowWidth() {
|
||||
|
||||
useEffect(() => {
|
||||
if (hasWindow) {
|
||||
const handleResize = function () {
|
||||
const handleResize = throttle(function () {
|
||||
setWidth(getWidth())
|
||||
}
|
||||
}, 100)
|
||||
|
||||
window.addEventListener('resize', handleResize)
|
||||
return () => window.removeEventListener('resize', handleResize)
|
||||
|
||||
Reference in New Issue
Block a user