Skip to content

Commit 6382a5f

Browse files
fix: resolve GitHub Actions failures in lint and E2E mobile workflows
Fixes two ESLint warnings that were causing lint workflow to fail: - app/[locale]/page.tsx: Move tick() call inside useEffect to avoid unstable dependency - ServiceWorkerRegistration.tsx: Move setPermission inside useEffect to avoid unstable dependency Fixes E2E mobile test viewport issue: - SoundSelector.tsx: Change dropdown from fixed h-64 to responsive max-h-48 md:max-h-64 to ensure preview buttons are within viewport on mobile devices All changes verified locally: - pnpm lint: passes with --max-warnings=0 - pnpm build: successful production build
1 parent bb5801d commit 6382a5f

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

app/[locale]/page.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ export default function Home() {
3333
const start = timerState?.start ?? (() => {})
3434
const pause = timerState?.pause ?? (() => {})
3535
const reset = timerState?.reset ?? (() => {})
36-
const tick = timerState?.tick ?? (() => {})
37-
3836
const soundPreset = settingsState?.soundPreset ?? 'gentle-bell'
3937
const volume = settingsState?.volume ?? 70
4038

@@ -59,14 +57,14 @@ export default function Home() {
5957

6058
// Set up interval for ticking when timer is running
6159
useEffect(() => {
62-
if (!isRunning) return
60+
if (!isRunning || !timerState?.tick) return
6361

6462
const interval = setInterval(() => {
65-
tick()
63+
timerState.tick()
6664
}, 1000)
6765

6866
return () => clearInterval(interval)
69-
}, [isRunning, tick])
67+
}, [isRunning, timerState])
7068

7169
// Play sound and show notification when timer completes
7270
useEffect(() => {

components/notifications/ServiceWorkerRegistration.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ import {
1313
* Registers the Service Worker on app load and syncs notification permission state
1414
*/
1515
export function ServiceWorkerRegistration() {
16-
const setPermission = useStore(useNotificationStore, (state) => state.setPermission) ?? (() => {})
16+
const notificationStore = useStore(useNotificationStore, (state) => state)
1717

1818
useEffect(() => {
19+
const setPermission = notificationStore?.setPermission ?? (() => {})
20+
1921
// Register Service Worker
2022
registerServiceWorker().then((registration) => {
2123
if (registration) {
@@ -40,7 +42,7 @@ export function ServiceWorkerRegistration() {
4042
console.warn('[Notifications] Permission monitoring not supported:', error)
4143
})
4244
}
43-
}, [setPermission])
45+
}, [notificationStore])
4446

4547
// This component doesn't render anything
4648
return null

components/settings/SoundSelector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export function SoundSelector({ value, onChange }: SoundSelectorProps) {
8787

8888
<Select.Portal>
8989
<Select.Content
90-
className="overflow-scroll h-64 rounded-lg border-2 border-bg-secondary bg-white shadow-lg"
90+
className="overflow-auto max-h-48 md:max-h-64 rounded-lg border-2 border-bg-secondary bg-white shadow-lg"
9191
position="popper"
9292
sideOffset={5}
9393
>

0 commit comments

Comments
 (0)