Tech debt 1265: Enable strictNullChecks TS compiler option#1301
Tech debt 1265: Enable strictNullChecks TS compiler option#1301mmv08 merged 41 commits intodevelopmentfrom
Conversation
|
CLA Assistant Lite All Contributors have signed the CLA. |
ESLint Summary View Full Report
[warning] @typescript-eslint/explicit-module-boundary-types
[warning] @typescript-eslint/no-non-null-assertion
Report generated by eslint-plus-action |
ESLint Summary View Full Report
[failure] @typescript-eslint/no-unused-vars
[warning] @typescript-eslint/explicit-module-boundary-types
Report generated by eslint-plus-action |
|
Travis automatic deployment: |
|
Travis automatic deployment: |
src/routes/safe/components/Balances/SendModal/screens/SendFunds/index.tsx
Show resolved
Hide resolved
| const nonce = useSelector(safeNonceSelector) | ||
| const modules = useSelector(safeModulesSelector) | ||
| const moduleData = getModuleData(modules) ?? null | ||
| const moduleData = modules ? getModuleData(modules) ?? null : null |
There was a problem hiding this comment.
So getModuleData can return undefined?
Do we want to control this inside the function?
There was a problem hiding this comment.
what do you mean? the return type is correct
There was a problem hiding this comment.
I was just wondering if we should make the function to directly return null when result is undefined. Is not a big deal because it's only used here.
I feel that the logic to call the function gets a bit more complex to read just to ensure the result is null
There was a problem hiding this comment.
As I said I didn’t dive deep into the logic, my goal was to enable the option and make project compile without changing the logic/returned values
There was a problem hiding this comment.
As this method is only used here yet I would add the logic inside. Afterwards could be more complicated. But I leave the decision in your hands.
|
Travis automatic deployment: |
src/routes/safe/components/Transactions/TxsTable/ExpandedTx/OwnersColumn/index.tsx
Outdated
Show resolved
Hide resolved
src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/utils.ts
Show resolved
Hide resolved
| const nonce = useSelector(safeNonceSelector) | ||
| const modules = useSelector(safeModulesSelector) | ||
| const moduleData = getModuleData(modules) ?? null | ||
| const moduleData = modules ? getModuleData(modules) ?? null : null |
There was a problem hiding this comment.
I was just wondering if we should make the function to directly return null when result is undefined. Is not a big deal because it's only used here.
I feel that the logic to call the function gets a bit more complex to read just to ensure the result is null
|
Travis automatic deployment: |
|
Travis automatic deployment: |
1 similar comment
|
Travis automatic deployment: |
|
Big work adding types here! |
| dispatch(fetchCurrencyRate(safeAddress, selectedCurrency)) | ||
| break | ||
| } | ||
| case SET_CURRENCY_RATE: |
There was a problem hiding this comment.
Hi @mikheevm, want to ask you why did you removed this. Because while I was working on this ticket I found that this was part of the problem. Also, now the storage of the selected currency is broken, for example, if you choose EUR as your preferred currency and reload the page, you will see USD again
There was a problem hiding this comment.
Hey, as I communicated before we don't need to store the balances locally as the rates frequently change and it's fine to fetch this again on app startup. I didn't expect that SET_CURRENCY_RATE action is capable of storing currently selected currency, I thought SET_CURRENCY_CURRENCY action was responsible for that because that's literally the action name. Sorry for this.
There was a problem hiding this comment.
No problem! thanks for the clarification :)
This PR: