This commit is contained in:
@@ -24,7 +24,14 @@ export default function GuestJoin() {
|
||||
setRoomInfo(res.data.room);
|
||||
setStatus({ running: res.data.running });
|
||||
} catch (err) {
|
||||
setError(err.response?.data?.error || t('room.guestRoomNotFound'));
|
||||
const status = err.response?.status;
|
||||
if (status === 403) {
|
||||
setError(t('room.guestAccessNotEnabled'));
|
||||
} else if (status === 404) {
|
||||
setError(t('room.guestRoomNotFound'));
|
||||
} else {
|
||||
setError(t('room.guestRoomNotFound'));
|
||||
}
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
@@ -61,7 +68,14 @@ export default function GuestJoin() {
|
||||
window.location.href = res.data.joinUrl;
|
||||
}
|
||||
} catch (err) {
|
||||
toast.error(err.response?.data?.error || t('room.guestJoinFailed'));
|
||||
const status = err.response?.status;
|
||||
if (status === 403) {
|
||||
toast.error(t('room.guestWrongAccessCode'));
|
||||
} else if (status === 400) {
|
||||
toast.error(t('room.guestWaitingMessage'));
|
||||
} else {
|
||||
toast.error(t('room.guestJoinFailed'));
|
||||
}
|
||||
} finally {
|
||||
setJoining(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user