Skip to content

Commit

Permalink
Two little tweaks post ai search ship (#54265)
Browse files Browse the repository at this point in the history
  • Loading branch information
heiskr authored Feb 5, 2025
1 parent b099e4a commit ce3ed1f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/frame/components/hooks/useQueryParam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 3 additions & 2 deletions src/frame/components/page-header/hooks/useInnerWindowWidth.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useState, useEffect } from 'react'
import throttle from 'lodash/throttle'

export function useInnerWindowWidth() {
const hasWindow = typeof window !== 'undefined'
Expand All @@ -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)
Expand Down

0 comments on commit ce3ed1f

Please sign in to comment.