-
Notifications
You must be signed in to change notification settings - Fork 362
Created auxiliary functioon to check if a module is enabled #2570
Created auxiliary functioon to check if a module is enabled #2570
Conversation
CLA Assistant Lite All Contributors have signed the CLA. |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
src/routes/safe/components/Settings/SpendingLimit/NewLimitModal/Review.tsx
Outdated
Show resolved
Hide resolved
Tried the issue of not being able to create a new allowance for an user once the module was previously enabled. Looks good to me |
src/routes/safe/components/Settings/SpendingLimit/NewLimitModal/Review.tsx
Outdated
Show resolved
Hide resolved
src/logic/safe/utils/modules.ts
Outdated
@@ -64,3 +65,7 @@ export const enableModuleTx = ({ | |||
notifiedTransaction: TX_NOTIFICATION_TYPES.SETTINGS_CHANGE_TX, | |||
} | |||
} | |||
|
|||
export const isModuleEnabled = (modules: string[] | undefined | null, moduleAddress: string): boolean => { |
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.
why the type here for modules
is so broad? I believe this function works correctly only if string[]
is passed
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.
🎉
What it solves
Resolves #2549
How this PR fixes it
We check for the module to be available in stead of checking that there is any spending limit
How to test it
It shouldn't create the transaction to enable the spending limit module