Skip to content

Commit

Permalink
Merge pull request #541 from logion-network/feature/direct-protection
Browse files Browse the repository at this point in the history
Review-less protection
  • Loading branch information
gdethier authored Feb 2, 2024
2 parents dfc1e6f + d22f431 commit 017ec47
Show file tree
Hide file tree
Showing 27 changed files with 72 additions and 804 deletions.
17 changes: 0 additions & 17 deletions src/legal-officer/ContextualizedWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { useCommonContext } from '../common/CommonContext';

import {
HOME_PATH,
PROTECTION_REQUESTS_PATH,
RECOVERY_REQUESTS_PATH,
SETTINGS_PATH,
WALLET_PATH,
Expand Down Expand Up @@ -145,22 +144,6 @@ export default function ContextualizedWallet() {
<Dashboard
menuTop={ menuTop }
menuMiddle={[
{
id: "protection",
text: "Protection Management",
to: PROTECTION_REQUESTS_PATH,
exact: true,
icon: {
icon: {
id: 'shield',
hasVariants: true,
},
height: 'auto',
width: '60px',
},
onClick: refreshAll,
disabled: currentLegalOfficerUnavailable,
},
{
id: "vault",
text: "Vault-out Requests",
Expand Down
3 changes: 0 additions & 3 deletions src/legal-officer/LegalOfficerPaths.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ import {

export const HOME_PATH = LEGAL_OFFICER_PATH;

export const PROTECTION_REQUESTS_RELATIVE_PATH = '/protection';
export const PROTECTION_REQUESTS_PATH = LEGAL_OFFICER_PATH + PROTECTION_REQUESTS_RELATIVE_PATH;

export const RECOVERY_REQUESTS_RELATIVE_PATH = '/recovery';
export const RECOVERY_REQUESTS_PATH = LEGAL_OFFICER_PATH + RECOVERY_REQUESTS_RELATIVE_PATH;

Expand Down
3 changes: 0 additions & 3 deletions src/legal-officer/LegalOfficerRouter.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Routes, Route, Navigate } from 'react-router-dom';

import {
PROTECTION_REQUESTS_RELATIVE_PATH,
RECOVERY_REQUESTS_RELATIVE_PATH,
SETTINGS_RELATIVE_PATH,
RECOVERY_DETAILS_RELATIVE_PATH,
Expand All @@ -26,7 +25,6 @@ import {
} from './LegalOfficerPaths';

import Home from './Home';
import ProtectionRequests from './ProtectionRequests';
import RecoveryRequests from './RecoveryRequests';
import Settings from '../settings/Settings';
import RecoveryDetails from "./RecoveryDetails";
Expand Down Expand Up @@ -88,7 +86,6 @@ export default function LegalOfficerRouter() {

return (
<Routes>
<Route path={ PROTECTION_REQUESTS_RELATIVE_PATH } element={ <ProtectionRequests /> } />
<Route path={ VAULT_OUT_REQUESTS_RELATIVE_PATH } element={ <VaultOutRequests /> } />
<Route path={ RECOVERY_REQUESTS_RELATIVE_PATH } element={ <RecoveryRequests /> } />
<Route path={ RECOVERY_DETAILS_RELATIVE_PATH } element={ <RecoveryDetails /> } />
Expand Down
129 changes: 0 additions & 129 deletions src/legal-officer/PendingProtectionRequests.test.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions src/legal-officer/ProtectionRequests.css

This file was deleted.

10 changes: 0 additions & 10 deletions src/legal-officer/ProtectionRequests.test.tsx

This file was deleted.

53 changes: 0 additions & 53 deletions src/legal-officer/ProtectionRequests.tsx

This file was deleted.

19 changes: 0 additions & 19 deletions src/legal-officer/ProtectionRequestsHistory.test.tsx

This file was deleted.

66 changes: 0 additions & 66 deletions src/legal-officer/ProtectionRequestsHistory.tsx

This file was deleted.

12 changes: 8 additions & 4 deletions src/legal-officer/RecoveryDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ export default function RecoveryDetails() {
const currentAddress = accounts!.current!.accountId.address;
const lost = recoveryInfo!.accountToRecover!.requesterAddress;
const rescuer = recoveryInfo!.recoveryAccount.requesterAddress;
await acceptProtectionRequest(axiosFactory!(currentAddress)!, {
requestId: requestId!,
});

if (await alreadyVouched(lost, rescuer, currentAddress)) {
await acceptProtectionRequest(axiosFactory!(currentAddress)!, {
requestId: requestId!,
});
refreshRequests!(false);
navigate(RECOVERY_REQUESTS_PATH);
} else {
Expand All @@ -77,7 +78,10 @@ export default function RecoveryDetails() {
signerId: currentAddress,
submittable,
callback,
})
});
await acceptProtectionRequest(axiosFactory!(currentAddress)!, {
requestId: requestId!,
});
};
try {
await submitCall(call);
Expand Down
Loading

0 comments on commit 017ec47

Please sign in to comment.