Skip to content

Commit

Permalink
Merge pull request #70 from jun-brro/request
Browse files Browse the repository at this point in the history
feat: error status alert
  • Loading branch information
jun-brro authored May 21, 2024
2 parents 67dca60 + 5bc6ba6 commit 199acc4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export const KakaoAuthProvider = ({ children }: { children: ReactNode }) => {
setIsKakaoLoggedIn(sessionExists);
}, [cookies.sessionId]);

const setKakaoLoginStatus = (status: boolean) => {
setIsKakaoLoggedIn(status);
sessionStorage.setItem("isKakaoLoggedIn", JSON.stringify(status));
const setKakaoLoginStatus = () => {
setIsKakaoLoggedIn(true);
sessionStorage.setItem("isKakaoLoggedIn", "true");
};

const getKakaoLoginStatus = (): boolean => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@ const KakaoLoginButton: React.FC = () => {
}, [navigate, getKakaoLoginStatus]);

const handleLogin = () => {
const loginWindow = window.open(`${apiUrl}/login/kakao`);
window.location.href = `${apiUrl}/login/kakao`;

const checkLoginStatus = setInterval(() => {
if (getKakaoLoginStatus()) {
clearInterval(checkLoginStatus);
loginWindow?.close();
setKakaoLoginStatus(true);
navigate("/", { replace: true });
window.location.replace("https://www.sunnybraille.com");
}
}, 1000);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ const KakaoLoginHandler: React.FC = () => {
.then((response) => {
if (response.ok) {
setKakaoLoginStatus(true);
navigate("/");
} else {
console.error("Session login failed");
console.error("Session login failed", response);
alert("Session login failed");
}
})
Expand Down
2 changes: 2 additions & 0 deletions my-app/src/components/FileNameDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const FileNameDisplay: React.FC<FileNameDisplayProps> = ({ fileId }) => {

try {
const apiUrl = process.env.REACT_APP_API_URL; // API 주소


const response = await axios.get(`${apiUrl}/transcriptions/${fileId}`);
const originalFileName = response.data.originalFileName;

Expand Down

0 comments on commit 199acc4

Please sign in to comment.