Finish disabling auto settle
This commit is contained in:
parent
87b3a6f65a
commit
78e3ec9c17
|
@ -22,6 +22,7 @@ import LinkAddress from './LinkAddress';
|
|||
import {InfoCircleOutlined} from '@ant-design/icons';
|
||||
import {useInterval} from "../utils/useInterval";
|
||||
import {useLocalStorageState} from "../utils/utils";
|
||||
import { AUTO_SETTLE_DISABLED_OVERRIDE } from "../utils/preferences";
|
||||
|
||||
const RowBox = styled(Row)`
|
||||
padding-bottom: 20px;
|
||||
|
@ -118,7 +119,7 @@ export default function StandaloneBalancesDisplay() {
|
|||
});
|
||||
}
|
||||
}
|
||||
const AUTO_SETTLE_DISABLED_OVERRIDE = true;
|
||||
|
||||
useInterval(() => {
|
||||
const autoSettle = async () => {
|
||||
if (AUTO_SETTLE_DISABLED_OVERRIDE || !wallet || !market || !openOrdersAccount || !baseCurrencyAccount || !quoteCurrencyAccount || !autoSettleEnabled) {
|
||||
|
|
|
@ -11,6 +11,8 @@ import {settleAllFunds} from './send';
|
|||
import {PreferencesContextValues} from './types';
|
||||
import {Market} from "@project-serum/serum";
|
||||
|
||||
export const AUTO_SETTLE_DISABLED_OVERRIDE = true;
|
||||
|
||||
const PreferencesContext = React.createContext<PreferencesContextValues | null>(
|
||||
null,
|
||||
);
|
||||
|
@ -33,6 +35,9 @@ export function PreferencesProvider({ children }) {
|
|||
|
||||
useInterval(() => {
|
||||
const autoSettle = async () => {
|
||||
if (AUTO_SETTLE_DISABLED_OVERRIDE) {
|
||||
return;
|
||||
}
|
||||
if (!wallet) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue