-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removed whitelist codebase #357
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ import { lmrDecimals } from '../../utils/coinValue'; | |
import { formatBtcPerTh, calculateSuggestedPrice } from './utils'; | ||
import ArchiveModal from './modals/ArchiveModal/ArchiveModal'; | ||
import { IconArchive } from '@tabler/icons'; | ||
import SellerWhitelistModal from './modals/SellerWhitelistModal/SellerWhitelistModal'; | ||
import AdjustProfitModal from './modals/AdjustProfitModal/AdjustProfitModal'; | ||
|
||
const Container = styled.div` | ||
|
@@ -88,7 +87,6 @@ function SellerHub({ | |
}) { | ||
const [isModalActive, setIsModalActive] = useState(false); | ||
const [isArchiveModalActive, setIsArchiveModalActive] = useState(false); | ||
const [showSellerWhitelistForm, setShowSellerWhitelistForm] = useState(false); | ||
const [showAdjustForm, setShowAdjustForm] = useState(false); | ||
const [isEditModalActive, setIsEditModalActive] = useState(false); | ||
const [editContractData, setEditContractData] = useState({}); | ||
|
@@ -430,10 +428,6 @@ function SellerHub({ | |
}) | ||
.catch(error => { | ||
setIsModalActive(false); | ||
if (error.message == 'seller is not whitelisted') { | ||
setShowSellerWhitelistForm(true); | ||
return; | ||
} | ||
context.toast('error', error.message || error); | ||
}) | ||
.finally(() => { | ||
Comment on lines
428
to
433
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Error Handling ImprovementThe error handling in the Recommendation:
|
||
|
@@ -579,14 +573,6 @@ function SellerHub({ | |
showSuccess={false} | ||
/> | ||
|
||
<SellerWhitelistModal | ||
isActive={showSellerWhitelistForm} | ||
formUrl={formUrl} | ||
close={() => { | ||
setShowSellerWhitelistForm(false); | ||
}} | ||
/> | ||
|
||
<AdjustProfitModal | ||
isActive={showAdjustForm} | ||
contracts={[...underProfitContracts]} | ||
Comment on lines
573
to
578
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. State Management in ModalsThe Recommendation:
|
||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,7 +86,6 @@ const withContractsState = WrappedComponent => { | |
ethCoinPrice: selectors.getRateEth(state), | ||
btcCoinPrice: selectors.getRateBtc(state), | ||
selectedCurrency: selectors.getSellerSelectedCurrency(state), | ||
formUrl: selectors.getSellerWhitelistForm(state), | ||
autoAdjustPriceInterval: selectors.getAutoAdjustPriceInterval(state), | ||
autoAdjustContractPriceTimeout: selectors.getAutoAdjustContractPriceTimeout( | ||
state | ||
Comment on lines
86
to
91
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Performance and Maintainability IssueThe selectors used in Recommendation:
Comment on lines
86
to
91
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consistency and Error Handling IssueThe current implementation does not handle potential undefined or erroneous returns from selectors such as Recommendation: |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,3 @@ export const getSellerSelectedCurrency = state => state.config.sellerCurrency; | |
|
||
export const getSellerDefaultCurrency = state => | ||
state.config.chain.defaultSellerCurrency; | ||
Comment on lines
35
to
37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Error Handling ImprovementCurrently, the selectors Recommendation: export const getSellerSelectedCurrency = state => state.config ? state.config.sellerCurrency : undefined;
export const getSellerDefaultCurrency = state => state.config && state.config.chain ? state.config.chain.defaultSellerCurrency : undefined; This change will help prevent potential runtime errors and make the selectors more robust. |
||
|
||
export const getSellerWhitelistForm = state => | ||
state.config.chain.sellerWhitelistUrl; |
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.
The use of
BYPASS_AUTH
to potentially bypass authentication mechanisms poses a significant security risk. This feature should be handled with extreme caution, especially in production environments. It's recommended to: