Skip to content

Commit 8565c60

Browse files
committed
lint fixes
1 parent c3361b5 commit 8565c60

3 files changed

Lines changed: 26 additions & 18 deletions

File tree

src/pages/PublicFlightView.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -827,14 +827,15 @@ export default function PublicFlightView() {
827827
<div className="bg-gray-900/50 rounded-xl border-2 border-gray-800 p-6 overflow-x-auto">
828828
<div className="flex items-center">
829829
{phases.map((item, index, array) => {
830+
type PhaseColor = {
831+
dot: string;
832+
bg: string;
833+
text: string;
834+
baseColor: string;
835+
};
830836
const phaseColor: Record<
831837
string,
832-
{
833-
dot: string;
834-
bg: string;
835-
text: string;
836-
baseColor: string;
837-
}
838+
PhaseColor
838839
> = {
839840
taxi: {
840841
dot: 'bg-yellow-500 shadow-yellow-500/50',
@@ -897,7 +898,7 @@ export default function PublicFlightView() {
897898
baseColor: 'indigo-500',
898899
},
899900
};
900-
const colors = (phaseColor as any)[
901+
const colors: PhaseColor = phaseColor[
901902
item.phase
902903
] || {
903904
dot: 'bg-gray-500 shadow-gray-500/50',

src/pages/VatsimCallback.tsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function VatsimCallback() {
88
const hasSubmitted = useRef(false);
99

1010
useEffect(() => {
11-
if (hasSubmitted.current) return; // prevent double-run in React StrictMode
11+
if (hasSubmitted.current) return;
1212
hasSubmitted.current = true;
1313

1414
const run = async () => {
@@ -20,25 +20,29 @@ export default function VatsimCallback() {
2020
return;
2121
}
2222
try {
23-
const res = await fetch(`${import.meta.env.VITE_SERVER_URL}/api/auth/vatsim/exchange`, {
24-
method: 'POST',
25-
headers: { 'Content-Type': 'application/json' },
26-
credentials: 'include',
27-
body: JSON.stringify({ code, state })
28-
});
23+
const res = await fetch(
24+
`${import.meta.env.VITE_SERVER_URL}/api/auth/vatsim/exchange`,
25+
{
26+
method: 'POST',
27+
headers: { 'Content-Type': 'application/json' },
28+
credentials: 'include',
29+
body: JSON.stringify({ code, state }),
30+
}
31+
);
2932
if (!res.ok) {
3033
navigate('/settings?error=vatsim_link_failed');
3134
return;
3235
}
3336
await refreshUser();
34-
// Clean up query params to avoid accidental re-exchange on back/refresh
3537
try {
3638
const url = new URL(window.location.href);
3739
url.search = '';
3840
window.history.replaceState({}, '', url.toString());
39-
} catch {}
41+
} catch {
42+
// If URL API is not supported, do nothing
43+
}
4044
navigate('/settings?vatsim_linked=true');
41-
} catch (err) {
45+
} catch {
4246
navigate('/settings?error=vatsim_link_failed');
4347
}
4448
};

src/utils/playSound.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ export function playAudioWithGain(audioElement: HTMLAudioElement, volume: number
2222
return;
2323
}
2424

25-
const audioContext = new (window.AudioContext || (window as any).webkitAudioContext)();
25+
const audioContext = new (
26+
window.AudioContext ||
27+
(window as Window & typeof globalThis & { webkitAudioContext?: typeof AudioContext }).webkitAudioContext!
28+
)();
2629
const source = audioContext.createMediaElementSource(audioElement);
2730
const gainNode = audioContext.createGain();
2831

0 commit comments

Comments
 (0)