Skip to content

Commit

Permalink
Fix: Adjust name in error snackbar
Browse files Browse the repository at this point in the history
  • Loading branch information
heronlancellot committed Oct 14, 2023
1 parent 5d2778d commit 0562f7b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
9 changes: 2 additions & 7 deletions src/hooks/TaskServiceHook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,14 @@ export const useTaskServiceHook = (task: TaskService) => {
switch (status) {
case TaskStatus.Created:
return "Created"
break;
case TaskStatus.Canceled:
return "Canceled"
break;
case TaskStatus.Review:
return "In Review"
break;
case TaskStatus.Progress:
return "In Progress"
break;
case TaskStatus.Completed:
return "Completed"
break;
default:
break;
}
Expand Down Expand Up @@ -206,10 +201,10 @@ export const useTaskServiceHook = (task: TaskService) => {

const handleDeposit = async (roleId: any, amount: any) => {
try {
handleSnackbar('Set Quorum process initiated with success!', 'info')
handleSnackbar('Set Deposit process initiated with success!', 'info')
return await task.deposit(roleId, amount);
} catch (error) {
handleSnackbar('Error Set Quorum!', 'error')
handleSnackbar('Error Set Deposit!', 'error')
}
};

Expand Down
10 changes: 5 additions & 5 deletions src/services/tasks-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export function useTaskService() {
try {
return await tasksManagerContract.getTask(taskId);
} catch (error) {
handleSnackbar('Erro ao buscar tarefa', 'error')
handleSnackbar('Error searching Task', 'error')
}
}

Expand Down Expand Up @@ -168,31 +168,31 @@ export function useTaskService() {
try {
return await tasksManagerContract.setRole(roleId, authorizedAddress, isAuthorized);
} catch (error) {
handleSnackbar('Erro ao setar Role', 'error')
handleSnackbar('Error setting Role', 'error')
}
}

async function setOperator(interfaceId: any, roleId: any, isAuthorized: boolean) {
try {
return await tasksManagerContract.setOperator(interfaceId, roleId, isAuthorized);
} catch (error) {
handleSnackbar('Erro ao setar Operador', 'error')
handleSnackbar('Error setting Operator', 'error')
}
}

async function setMinQuorum(quorum: any) {
try {
return await tasksManagerContract.setMinQuorum(quorum);
} catch (error) {
handleSnackbar('Erro ao setar Quorum', 'error')
handleSnackbar('Error setting Quorum', 'error')
}
}

async function deposit(roleId: any, amount: any) {
try {
return await tasksManagerContract.deposit(roleId, { value: parseUnits(amount) });
} catch (error) {
handleSnackbar('Erro ao setar Quorum', 'error')
handleSnackbar('Error setting deposit', 'error')
}
}

Expand Down

0 comments on commit 0562f7b

Please sign in to comment.