-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: permissions are reset if dapp doesnt require any methods (#1705)
* show different warning if dapp has supported networks on other profile * only show relevant permissions --------- Co-authored-by: Nicole O'Brien <[email protected]>
- Loading branch information
1 parent
480b542
commit 6d65fb0
Showing
8 changed files
with
152 additions
and
72 deletions.
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
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
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
14 changes: 14 additions & 0 deletions
14
packages/shared/src/lib/auxiliary/wallet-connect/utils/getPermissionForMethod.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { METHODS_FOR_PERMISSION } from '../constants' | ||
import { DappPermission } from '../enums' | ||
|
||
export function getPermissionForMethod(method: string): DappPermission | undefined { | ||
for (const permission of Object.values(DappPermission)) { | ||
const supportedMethods = METHODS_FOR_PERMISSION[permission] ?? [] | ||
|
||
if (supportedMethods.includes(method)) { | ||
return permission | ||
} | ||
} | ||
|
||
return undefined | ||
} |
1 change: 1 addition & 0 deletions
1
packages/shared/src/lib/auxiliary/wallet-connect/utils/index.ts
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