Skip to content

Commit

Permalink
Fix types on TS
Browse files Browse the repository at this point in the history
  • Loading branch information
pvyParts committed Jul 11, 2024
1 parent cb9451b commit 9f14b8d
Show file tree
Hide file tree
Showing 33 changed files with 482 additions and 458 deletions.
49 changes: 49 additions & 0 deletions corptools/static/corptools/bs5/assets/@libs-BNmPRTWc.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

45 changes: 0 additions & 45 deletions corptools/static/corptools/bs5/assets/@libs-BwDEfZOQ.js

This file was deleted.

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

162 changes: 0 additions & 162 deletions corptools/static/corptools/bs5/assets/index-7zvkdnP0.js

This file was deleted.

This file was deleted.

164 changes: 164 additions & 0 deletions corptools/static/corptools/bs5/assets/index-CEhfgJZu.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions corptools/static/corptools/bs5/manifest.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"_@libs-BwDEfZOQ.js": {
"file": "assets/@libs-BwDEfZOQ.js"
"_@libs-BNmPRTWc.js": {
"file": "assets/@libs-BNmPRTWc.js"
},
"_@react-router-Bvkr4sF6.js": {
"file": "assets/@react-router-Bvkr4sF6.js",
"_@react-router-CmxWc-6V.js": {
"file": "assets/@react-router-CmxWc-6V.js",
"imports": [
"_@libs-BwDEfZOQ.js"
"_@libs-BNmPRTWc.js"
]
},
"index.html": {
"file": "assets/index-7zvkdnP0.js",
"file": "assets/index-CEhfgJZu.js",
"src": "index.html",
"isEntry": true,
"imports": [
"_@libs-BwDEfZOQ.js",
"_@react-router-Bvkr4sF6.js"
"_@libs-BNmPRTWc.js",
"_@react-router-CmxWc-6V.js"
],
"css": [
"static/corptools/bs5/statics/css/index-DGje4lAW.css"
Expand Down
16 changes: 8 additions & 8 deletions frontend/frontend/build/static/.vite/manifest.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"_@libs-BwDEfZOQ.js": {
"file": "assets/@libs-BwDEfZOQ.js"
"_@libs-BNmPRTWc.js": {
"file": "assets/@libs-BNmPRTWc.js"
},
"_@react-router-Bvkr4sF6.js": {
"file": "assets/@react-router-Bvkr4sF6.js",
"_@react-router-CmxWc-6V.js": {
"file": "assets/@react-router-CmxWc-6V.js",
"imports": [
"_@libs-BwDEfZOQ.js"
"_@libs-BNmPRTWc.js"
]
},
"index.html": {
"file": "assets/index-7zvkdnP0.js",
"file": "assets/index-CEhfgJZu.js",
"src": "index.html",
"isEntry": true,
"imports": [
"_@libs-BwDEfZOQ.js",
"_@react-router-Bvkr4sF6.js"
"_@libs-BNmPRTWc.js",
"_@react-router-CmxWc-6V.js"
],
"css": [
"static/corptools/bs5/statics/css/index-DGje4lAW.css"
Expand Down
49 changes: 49 additions & 0 deletions frontend/frontend/build/static/assets/@libs-BNmPRTWc.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

45 changes: 0 additions & 45 deletions frontend/frontend/build/static/assets/@libs-BwDEfZOQ.js

This file was deleted.

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

162 changes: 0 additions & 162 deletions frontend/frontend/build/static/assets/index-7zvkdnP0.js

This file was deleted.

This file was deleted.

164 changes: 164 additions & 0 deletions frontend/frontend/build/static/assets/index-CEhfgJZu.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions frontend/frontend/build/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@
padding-top: 3.5em !important;
}
</style>
<script type="module" crossorigin src="/assets/index-7zvkdnP0.js"></script>
<link rel="modulepreload" crossorigin href="/assets/@libs-BwDEfZOQ.js">
<link rel="modulepreload" crossorigin href="/assets/@react-router-Bvkr4sF6.js">
<script type="module" crossorigin src="/assets/index-CEhfgJZu.js"></script>
<link rel="modulepreload" crossorigin href="/assets/@libs-BNmPRTWc.js">
<link rel="modulepreload" crossorigin href="/assets/@react-router-CmxWc-6V.js">
<link rel="stylesheet" crossorigin href="/static/corptools/bs5/statics/css/index-DGje4lAW.css">
</head>

Expand Down
10 changes: 7 additions & 3 deletions frontend/frontend/src/Components/Character/CharacterHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ const CharHeader = () => {
borderRadius: `25%`,
};

const { data } = useQuery(["status", characterID], () => loadCharacterStatus(characterID), {
refetchOnWindowFocus: false,
});
const { data } = useQuery(
["status", characterID],
() => loadCharacterStatus(characterID ? Number(characterID) : 0),
{
refetchOnWindowFocus: false,
}
);

// const isk = data?.characters.reduce((p: number, c: any) => {
// try {
Expand Down
4 changes: 2 additions & 2 deletions frontend/frontend/src/Components/Corporation/Structures.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { TimeTill } from "../Helpers/TimeTill";
import BaseTable from "../Tables/BaseTable/BaseTable";
import { NameObjectArrayFilterFn } from "../Tables/BaseTable/BaseTableFilter";
import { createColumnHelper } from "@tanstack/react-table";
import { Badge, Figure } from "react-bootstrap";
import ReactTimeAgo from "react-time-ago";
import { Badge } from "react-bootstrap";

type Corporation = {
corporation_id: number;
corporation_name: string;
alliance_name: string;
};
Expand Down
6 changes: 5 additions & 1 deletion frontend/frontend/src/Components/Helpers/TimeTill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ export declare interface TimeTillProps {
https://stackoverflow.com/questions/1353684/detecting-an-invalid-date-date-instance-in-javascript
*/
function isValidDate(d: Date | number) {
return d instanceof Date && !isNaN(d);
let numberCheck = d instanceof Number;
if (numberCheck) {
numberCheck = !isNaN(d as number);
}
return d instanceof Date && numberCheck;
}

export function TimeTill({ date }: TimeTillProps) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/frontend/src/Components/RefreshAccountButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const RefreshCharButton = () => {
const { refetch, isFetching } = useQuery(
"my_key",
() => {
return postAccountRefresh(characterID);
return postAccountRefresh(characterID ? Number(characterID) : 0);
},
{
refetchOnWindowFocus: false,
Expand Down
10 changes: 7 additions & 3 deletions frontend/frontend/src/Pages/Char/CharacterPubData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ import { useParams } from "react-router-dom";
const CharacterPubData = () => {
const { characterID } = useParams();

const { data, isFetching } = useQuery(["pubdata", characterID], () => loadPubData(characterID), {
refetchOnWindowFocus: false,
});
const { data, isFetching } = useQuery(
["pubdata", characterID],
() => loadPubData(characterID ? Number(characterID) : 0),
{
refetchOnWindowFocus: false,
}
);

console.log(data);

Expand Down
2 changes: 1 addition & 1 deletion frontend/frontend/src/Pages/Char/CharacterStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const CharacterStatus = () => {
const [table, setTable] = useState(false);
const { data, isFetching } = useQuery({
queryKey: ["status", characterID],
queryFn: () => loadCharacterStatus(characterID),
queryFn: () => loadCharacterStatus(characterID ? Number(characterID) : 0),
refetchOnWindowFocus: false,
initialData: { characters: [], main: undefined, headers: [] },
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/frontend/src/Pages/Glance/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const CharacterGlancesAccount = () => {

const { data, isLoading } = useQuery({
queryKey: ["glances", "account", characterID],
queryFn: () => loadCharacterStatus(characterID),
queryFn: () => loadCharacterStatus(characterID ? Number(characterID) : 0),
refetchOnWindowFocus: false,
});

Expand Down
2 changes: 1 addition & 1 deletion frontend/frontend/src/Pages/Glance/Activities.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export const CharacterGlancesActivities = () => {

const { data } = useQuery({
queryKey: ["glances", "activities", characterID],
queryFn: () => loadGlanceActivityData(characterID),
queryFn: () => loadGlanceActivityData(characterID ? Number(characterID) : 0),
refetchOnWindowFocus: false,
});

Expand Down
2 changes: 1 addition & 1 deletion frontend/frontend/src/Pages/Glance/Assets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export const CharacterGlancesAssets = () => {

const { data, isLoading } = useQuery({
queryKey: ["glances", "assets", characterID],
queryFn: () => loadGlanceAssetData(characterID),
queryFn: () => loadGlanceAssetData(characterID ? Number(characterID) : 0),
refetchOnWindowFocus: false,
});
console.log(data, isLoading);
Expand Down
2 changes: 1 addition & 1 deletion frontend/frontend/src/Pages/Glance/Factions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const CharacterGlancesFactions = () => {

const { data } = useQuery({
queryKey: ["glances", "faction", characterID],
queryFn: () => loadGlanceFactionData(characterID),
queryFn: () => loadGlanceFactionData(characterID ? Number(characterID) : 0),
refetchOnWindowFocus: false,
});
return <Factions {...{ data }} />;
Expand Down

0 comments on commit 9f14b8d

Please sign in to comment.