1
0
mirror of synced 2025-12-22 03:16:52 -05:00

Two little tweaks post ai search ship (#54265)

This commit is contained in:
Kevin Heis
2025-02-05 13:08:52 -08:00
committed by GitHub
parent b099e4a9e3
commit ce3ed1f01d
2 changed files with 3 additions and 3 deletions

View File

@@ -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) {

View File

@@ -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)