Skip to content

Commit 3731944

Browse files
committed
Fix atis fetch
1 parent 301f6d4 commit 3731944

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

src/components/tools/ATIS.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ interface ATISData {
1818
interface ATISProps {
1919
icao: string;
2020
sessionId?: string;
21+
accessId?: string;
2122
activeRunway?: string;
2223
open: boolean;
2324
onClose: () => void;
@@ -28,6 +29,7 @@ interface ATISProps {
2829
export default function ATIS({
2930
icao,
3031
sessionId,
32+
accessId,
3133
activeRunway,
3234
open,
3335
onClose,
@@ -80,11 +82,11 @@ export default function ATIS({
8082

8183
useEffect(() => {
8284
const loadPreviousATIS = async () => {
83-
if (!sessionId || !icao || !open) return;
85+
if (!sessionId || !accessId || !icao || !open) return;
8486

8587
setIsLoadingPreviousATIS(true);
8688
try {
87-
const sessionData = await fetchSession(sessionId);
89+
const sessionData = await fetchSession(sessionId, accessId);
8890

8991
if (sessionData?.atis) {
9092
let atisData = null;
@@ -219,7 +221,7 @@ export default function ATIS({
219221
};
220222

221223
loadPreviousATIS();
222-
}, [sessionId, icao, open, availableRunways]);
224+
}, [sessionId, accessId, icao, open, availableRunways]);
223225

224226
useEffect(() => {
225227
if (icao && !fetchedAirports.has(icao)) {

src/components/tools/Toolbar.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export default function Toolbar({
140140
}
141141
};
142142

143-
const getAvatarUrl = (userId: string, avatar: string | null) => {
143+
const getAvatarUrl = (avatar: string | null) => {
144144
if (!avatar) return '/assets/app/default/avatar.webp';
145145
return avatar;
146146
};
@@ -358,11 +358,11 @@ export default function Toolbar({
358358
style={{
359359
position: 'relative',
360360
left: `${index * -10}px`,
361-
zIndex: 40, // Changed from 999999 to 40
361+
zIndex: 40,
362362
}}
363363
>
364364
<img
365-
src={getAvatarUrl(user.id, user.avatar)}
365+
src={getAvatarUrl(user.avatar)}
366366
alt={user.username}
367367
className="w-8 h-8 rounded-full shadow-md cursor-pointer transition-all"
368368
onError={(e) => {
@@ -482,7 +482,7 @@ export default function Toolbar({
482482
{ value: 'TWR', label: 'Tower' },
483483
{ value: 'APP', label: 'Approach' },
484484
]}
485-
value={position} // Updated to use prop
485+
value={position}
486486
onChange={handlePositionChange}
487487
placeholder="Select Position"
488488
disabled={!icao}
@@ -567,6 +567,7 @@ export default function Toolbar({
567567
<ATIS
568568
icao={icao ?? ''}
569569
sessionId={sessionId ?? ''}
570+
accessId={accessId ?? ''}
570571
activeRunway={activeRunway}
571572
open={atisOpen}
572573
onClose={handleAtisClose}

0 commit comments

Comments
 (0)