-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated total amount when change the different currency #35880
Merged
Merged
Changes from 8 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
72dee1d
Add policy avatar
dukenv0307 1e3e91e
fix lint
dukenv0307 d52739b
Merge branch 'main' into fix/35209
dukenv0307 a6ffc90
update total amount when offline and change currency
dukenv0307 b2ce3f0
fix lint
dukenv0307 89abd02
Revert "Add policy avatar"
dukenv0307 312ddbc
Revert "fix lint"
dukenv0307 c8a3c4c
remove useless code
dukenv0307 7c5889e
create a new function to update the total of money request report
dukenv0307 296fb19
create a function to compute diff amount
dukenv0307 0626907
fix ts error
dukenv0307 271bd23
fix prettier
dukenv0307 7d586ef
merge main
dukenv0307 8796fae
edit comment and refactor new function
dukenv0307 2a48143
fix incorrect amount for the case create or delete a request with for…
dukenv0307 9f075c4
revert hard code
dukenv0307 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you refactor this not to use
let
? Maybe we could extract a local or non-local helper function.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cubuspl42 I updated to create a local function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry, I wasn't clear enough. My suggestion was quite technical. I asked specifically whether we could refactor the code not to use the
let
, i.e. whether the code could be expressed without introducing a mutable variable.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it . I will re-update soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, we defined
diff
like:const diff = ...
.I'm suggesting to keep it like this. The easiest way to keep the
const
is to introduce a helper function for calculating the difference. It can even be local and take no arguments; it's up to you.I think it's best to introduce as few mutable variables to the code as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that is the current ideal I will re-update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By "local" I actually meant local in the most-inner surrounding scope. It could also be understood as module-local, as opposed to exported from a module; I didn't mean that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getUpdateMoneyRequestParams
function is very complex so I think we should create an outside function.