Skip to content

Commit

Permalink
Merge pull request #138 from PoolC/dev
Browse files Browse the repository at this point in the history
실서버 반영
  • Loading branch information
jinoov committed Aug 6, 2024
2 parents f1746c5 + 2119abb commit f4394be
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion apps/baekjoon-hub/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "PoolC Baekjoon Hub",
"version": "1.0.5",
"version": "1.0.6",
"description": "Yonsei Univ Programming Club PoolC integration with Baekjoon",
"action": {
"default_icon": "assets/images/logo-poolc.png",
Expand Down
6 changes: 3 additions & 3 deletions apps/baekjoon-hub/scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ const POOLC_BASE_URL = 'https://poolc.org/api';
const appFetch = (...args) =>
fetch(...args).then((res) => {
if (res.status === 401) {
throw new Error('unauthorized');
throw new Error('UNAUTHORIZED');
}

if (res.status >= 400) {
throw new Error('fetch error. please check network tab');
throw new Error('FETCH_ERROR');
}
return res;
});
Expand Down Expand Up @@ -35,7 +35,7 @@ function handleMessage(request, _, sendResponse) {
},
})
.then(() => sendResponse({ success: true }))
.catch(() => sendResponse({ success: false }));
.catch((e) => sendResponse({ success: false, reason: e.message }));
});
}
// login check
Expand Down
4 changes: 3 additions & 1 deletion apps/baekjoon-hub/scripts/baekjoon/baekjoon.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,12 @@ function startLoader() {
title: psData.titles[0].title,
});
} catch (error) {
showErrorToast(`
if (error === 'UNAUTHORIZED') {
showErrorToast(`
인증이 만료되었습니다. 😭<br/>
<a href=${`chrome-extension://${chrome.runtime.id}/login.html`} style="color: #212529; font-weight: 700;">해당 링크</a>를 통해 다시 로그인해주세요. 🙏
`);
}
console.error(error);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/baekjoon-hub/scripts/baekjoon/parsing.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ async function notifyProblemSolved({ language, level, problemId, problemTags, su
if (res.success) {
resolve();
} else {
reject();
reject(res.reason);
}
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ export default function MessageAllListContent() {
</Space>
<List
itemLayout="horizontal"
dataSource={conversations.toReversed()}
dataSource={conversations}
renderItem={(item) => (
<List.Item>
<Link to={`/${MENU.MESSAGE}/${item.id}`} className={styles.listItemLink}>
<Space direction="vertical" className={styles.fullWidth}>
<Space className={styles.metaInfo}>
<Typography.Text className={styles.messageType}>{item.otherLoginID === me.loginID ? item.starterLoginID : item.otherLoginID}</Typography.Text>
<Typography.Text className={styles.messageType}>{item.otherName === me.name ? item.starterName : item.otherName}</Typography.Text>
<Typography.Text>{dayjs(item.lastMessage?.sentAt).format('YYYY-MM-DD HH:mm:ss')}</Typography.Text>
</Space>
<Typography.Text>{item.lastMessage?.content}</Typography.Text>
Expand Down

0 comments on commit f4394be

Please sign in to comment.