Skip to content

Commit

Permalink
fix: too many nested calls break call trace depth path. (#950)
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Viénot <simon.vienot@icloud.com>
  • Loading branch information
svienot committed Mar 28, 2024
1 parent b0f0337 commit f7ea7d0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/contract/ContractActionsLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import axios, {AxiosResponse} from "axios";
import {computed, ref, Ref, watch} from "vue";
import {EntityLoader} from "@/utils/loader/EntityLoader";

const MAX_DEPTH_LEVEL = 20

export interface ContractActionWithPath {
action: ContractAction,
depthPath: string
Expand Down Expand Up @@ -101,8 +103,12 @@ export class ContractActionsLoader extends EntityLoader<ContractActionsResponse>
depthVector.push(1)
}

for (let i = 0; i < depthVector.length; i++) {
result += (i === 0) ? depthVector[i] : "_" + depthVector[i]
for (let i = 0; i < depthVector.length && i < MAX_DEPTH_LEVEL; i++) {
if (i < MAX_DEPTH_LEVEL - 1) {
result += (i === 0) ? depthVector[i] : "_" + depthVector[i]
} else {
result +='(…)'
}
}

return result
Expand Down

0 comments on commit f7ea7d0

Please sign in to comment.