Skip to content

Commit

Permalink
fixup! App CheckのtokenをAPI使用時に取得するように変更
Browse files Browse the repository at this point in the history
  • Loading branch information
MurakawaTakuya committed Jan 28, 2025
1 parent 05647d4 commit 874c657
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
15 changes: 15 additions & 0 deletions src/Components/DashBoard/DashBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,18 @@ export default function DashBoard({
limit,
})
.then((data) => {
if (
!data ||
!data.successResults ||
!data.failedResults ||
!data.pendingResults
) {
showSnackBar({
message: "データの取得に失敗しました。ログインし直してください。",
type: "warning",
});
return;
}
// 既に追加されている場合は追加しない
setSuccessResults((prev) => {
const newResults = data.successResults.filter(
Expand Down Expand Up @@ -213,6 +225,9 @@ export default function DashBoard({
limit: 1,
})
.then((data) => {
if (!data.successResults) {
return;
}
if (data.successResults.length > 0) {
setLastPostDate(data.successResults[0].post?.submittedAt);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Components/Progress/Progress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default function Progress({
return (
<SuccessStep
key={result.goalId}
result={result as GoalWithIdAndUserData}
result={result}
user={user as User}
isBlured={
result.post?.submittedAt && lastPostDate
Expand All @@ -64,15 +64,15 @@ export default function Progress({
return (
<FailedStep
key={result.goalId}
result={result as GoalWithIdAndUserData}
result={result}
user={user as User}
/>
);
} else if (result.type === "pending") {
return (
<PendingStep
key={result.goalId}
result={result as GoalWithIdAndUserData}
result={result}
user={user as User}
/>
);
Expand Down

0 comments on commit 874c657

Please sign in to comment.