Skip to content

Commit a249b59

Browse files
nilcheck forcepoll channel
1 parent 40354cc commit a249b59

File tree

4 files changed

+23
-19
lines changed

4 files changed

+23
-19
lines changed

gui/src/pages/matches.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import * as Table from '@/ui/table'
99
import type { model } from '@model'
1010
import { Button } from '@/ui/button'
1111
import { type LocalizationKey } from '@/main/i18n'
12-
import { Tooltip } from '@/ui/tooltip';
12+
import { Tooltip } from '@/ui/tooltip'
1313

1414
export function MatchesListPage() {
1515
const { t } = useTranslation()
@@ -112,7 +112,9 @@ export function MatchesListPage() {
112112
interactive
113113
>
114114
<Tooltip text={t('copy')}>
115-
<span className="block overflow-hidden overflow-ellipsis w-12">{log.replayId}</span>
115+
<span className='block w-12 overflow-hidden overflow-ellipsis'>
116+
{log.replayId}
117+
</span>
116118
</Tooltip>
117119
</Table.Td>
118120
</Table.Tr>

gui/src/pages/tracking/tracking-live-updater.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export function TrackingLiveUpdater() {
5353
{mr > 0 && <SmallStat text='MR' value={`${mr == -1 ? t('placement') : mr}`} />}
5454
</div>
5555
</dl>
56-
<div className='flex flex-1 h-[calc(100%-32px)] pb-5 pt-3'>
56+
<div className='flex h-[calc(100%-32px)] flex-1 pb-5 pt-3'>
5757
<div className='w-full'>
5858
<dl className='whitespace-nowrap text-lg'>
5959
<div className='flex justify-between gap-2'>
@@ -91,7 +91,7 @@ export function TrackingLiveUpdater() {
9191
initial={{ opacity: 0 }}
9292
animate={{ opacity: 1 }}
9393
transition={{ delay: 0.35 }}
94-
className='relative h-full flex-0 grid'
94+
className='flex-0 relative grid h-full'
9595
>
9696
<PieChart
9797
className='mx-auto h-52 w-full'
@@ -122,7 +122,7 @@ export function TrackingLiveUpdater() {
122122
</linearGradient>
123123
</defs>
124124
</PieChart>
125-
<div className="flex justify-between self-end gap-2">
125+
<div className='flex justify-between gap-2 self-end'>
126126
<Tooltip text={t('cooldown')} disabled={!refreshDisabled}>
127127
<Button
128128
disabled={refreshDisabled}
@@ -139,9 +139,7 @@ export function TrackingLiveUpdater() {
139139
{t('refresh')}
140140
</Button>
141141
</Tooltip>
142-
<Button
143-
onClick={() => trackingActor.send({ type: 'cease' })}
144-
>
142+
<Button onClick={() => trackingActor.send({ type: 'cease' })}>
145143
<Icon icon='fa6-solid:stop' className='mr-3 h-5 w-5' />
146144
{t('stop')}
147145
</Button>

gui/src/ui/tooltip.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
import React from 'react'
22
import { motion } from 'framer-motion'
33

4-
export function Tooltip(props: React.PropsWithChildren & {
5-
text: string
6-
disabled?: boolean
7-
}) {
4+
export function Tooltip(
5+
props: React.PropsWithChildren & {
6+
text: string
7+
disabled?: boolean
8+
}
9+
) {
810
return (
9-
<div
10-
className="group z-[9999] relative inline-flex justify-center"
11-
>
11+
<div className='group relative z-[9999] inline-flex justify-center'>
1212
{props.children}
13-
{!props.disabled &&
13+
{!props.disabled && (
1414
<motion.span
1515
key='tooltip-text'
16-
className="select-none pointer-events-none z-50 group-hover:opacity-100 group-hover:visible opacity-0 invisible transition-all top-[-33px] absolute rounded-full border text-black bg-white px-2.5 pt-1 pb-0.5 text-sm font-semibold">
16+
className='pointer-events-none invisible absolute top-[-33px] z-50 select-none rounded-full border bg-white px-2.5 pb-0.5 pt-1 text-sm font-semibold text-black opacity-0 transition-all group-hover:visible group-hover:opacity-100'
17+
>
1718
{props.text}
1819
</motion.span>
19-
}
20+
)}
2021
</div>
2122
)
2223
}

pkg/tracker/t8/track.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ func (t *T8Tracker) poll(ctx context.Context, session *model.Session, pollRate t
9999
defer func() {
100100
ticker.Stop()
101101
close(t.forcePollChan)
102+
t.forcePollChan = nil
102103
wails.EventsEmit(ctx, "stopped-tracking")
103104
}()
104105

@@ -151,7 +152,9 @@ func (t *T8Tracker) pollFn(ctx context.Context, session *model.Session) {
151152
}
152153

153154
func (t *T8Tracker) ForcePoll() {
154-
t.forcePollChan <- struct{}{}
155+
if t.forcePollChan != nil {
156+
t.forcePollChan <- struct{}{}
157+
}
155158
}
156159

157160
func (t *T8Tracker) Stop() {

0 commit comments

Comments
 (0)