Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Zhang (张涛) committed Apr 2, 2024
1 parent 4e5c42f commit 45ce612
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ function isValidCoverage(coverage) {
@ValidatorConstraint({ name: 'isValidCoverage', async: false })
export class IsValidCoverage implements ValidatorConstraintInterface {
validate(coverage: unknown) {
// if (Object.keys(coverage).length === 0) {
// return false;
// }
if (Object.keys(coverage).length === 0) {
return false;
}
return Object.values(coverage).every((item) => {
return isValidCoverage(item);
});
Expand Down
31 changes: 0 additions & 31 deletions packages/canyon-platform/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,38 +69,7 @@ function Index() {
const loc = useLocation();
const nav = useNavigate();

useEffect(() => {
if (loc.pathname === '/') {
nav('/projects');
}

try {
// @ts-ignore
fetch(window.__canyon__.dsn, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${localStorage.getItem('token')}`,
},
body: JSON.stringify({
// @ts-ignore
coverage: window.__coverage__,
// @ts-ignore
commitSha: window.__canyon__.commitSha,
// @ts-ignore
projectID: window.__canyon__.projectID,
// @ts-ignore
instrumentCwd: window.__canyon__.instrumentCwd,
// @ts-ignore
reportID: `${meData?.me.username};${loc.pathname};${window.__canyon__.commitSha.slice(0, 8)}`,
// @ts-ignore
branch: window.__canyon__.branch,
}),
});
} catch (e) {
// console.log(e);
}
}, [loc.pathname]);

const selectedKey = useMemo(() => {
if (loc.pathname === '/') {
Expand Down

0 comments on commit 45ce612

Please sign in to comment.