Skip to content
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

feat(bonsai-ui): migrate position action cell and triggers dialog, delete some old stuff #1465

Merged
merged 6 commits into from
Jan 27, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix
tyleroooo committed Jan 24, 2025
commit 5d6610055f5233966157211fbfc33f2bca5985ec
1 change: 0 additions & 1 deletion src/state/accountSelectors.ts
Original file line number Diff line number Diff line change
@@ -269,7 +269,6 @@ export const getSubaccountConditionalOrders = () =>
: IndexerOrderSide.BUY;

const conditionalOrders = openOrdersByPositionUniqueId[position.uniqueId];
console.log(position.market, conditionalOrders);

return {
stopLossOrders: conditionalOrders?.filter(

Unchanged files with check annotations Beta

selector: selectParentSubaccountInfo,
getQueryKey: (data) => ['account', 'blockTradingRewards', data],
getQueryFn: (indexerClient, data) => {
if (!isTruthy(data.wallet) || data.subaccount == null) {

Check warning on line 23 in src/abacus-ts/rest/blockTradingRewards.ts

GitHub Actions / lint

Unnecessary conditional, the types have no overlap
return null;
}
return () => indexerClient.account.getHistoricalBlockTradingRewards(data.wallet!);
selector: selectParentSubaccountInfo,
getQueryKey: (data) => ['account', 'fills', data.wallet, data.subaccount],
getQueryFn: (indexerClient, data) => {
if (!isTruthy(data.wallet) || data.subaccount == null) {

Check warning on line 19 in src/abacus-ts/rest/fills.ts

GitHub Actions / lint

Unnecessary conditional, the types have no overlap
return null;
}
return () =>
setClient(undefined);
CompositeClientManager.markDone(clientConfig);
};
}, [selectedNetwork, indexerReady]);

Check warning on line 31 in src/abacus-ts/rest/lib/useIndexer.ts

GitHub Actions / lint

React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array
return { indexerClient: client, key: `${selectedNetwork}-${indexerReady}` };
}
setClient(undefined);
CompositeClientManager.markDone(clientConfig);
};
}, [selectedNetwork, compositeClientReady]);

Check warning on line 56 in src/abacus-ts/rest/lib/useIndexer.ts

GitHub Actions / lint

React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array
return { compositeClient: client, key: `${selectedNetwork}-${compositeClientReady}` };
}
selector: selectParentSubaccountInfo,
getQueryKey: (data) => ['account', 'orders', data.wallet, data.subaccount],
getQueryFn: (indexerClient, data) => {
if (!isTruthy(data.wallet) || data.subaccount == null) {

Check warning on line 21 in src/abacus-ts/rest/orders.ts

GitHub Actions / lint

Unnecessary conditional, the types have no overlap
return null;
}
return () =>
status: orders.status,
data:
orders.data != null
? keyBy(isParentSubaccountOrders(orders.data), (o) => o.id ?? '')

Check warning on line 44 in src/abacus-ts/rest/orders.ts

GitHub Actions / lint

Unnecessary conditional, expected left-hand side of `??` operator to be possibly null or undefined
: orders.data,
error: orders.error,
})
selector: selectParentSubaccountInfo,
getQueryKey: (data) => ['account', 'transfers', data],
getQueryFn: (indexerClient, data) => {
if (!isTruthy(data.wallet) || data.subaccount == null) {

Check warning on line 20 in src/abacus-ts/rest/transfers.ts

GitHub Actions / lint

Unnecessary conditional, the types have no overlap
return null;
}
return () =>
export function setUpParentSubaccount(store: RootStore) {
return createStoreEffect(store, selectParentSubaccount, ({ subaccount, wallet, wsUrl }) => {
if (!isTruthy(wallet) || subaccount == null) {

Check warning on line 211 in src/abacus-ts/websocket/parentSubaccount.ts

GitHub Actions / lint

Unnecessary conditional, the types have no overlap
return undefined;
}
${({ action, buttonStyle }) => action && buttonStyle && buttonActionVariants[action][buttonStyle]}
${({ action, state, buttonStyle }) =>
state &&

Check warning on line 228 in src/components/Button.tsx

GitHub Actions / lint

Unnecessary conditional, value is always truthy
css`
// Ordered from lowest to highest priority (ie. Disabled should overwrite Active and Loading states)
${state[ButtonState.Loading] && buttonStateVariants(action, buttonStyle)[ButtonState.Loading]}
))}
{slotEmpty && searchValue.trim() !== '' && (
<Command.Empty tw="h-full p-1 text-color-text-0">
{slotEmpty ??

Check warning on line 203 in src/components/ComboboxMenu.tsx

GitHub Actions / lint

Unnecessary conditional, expected left-hand side of `??` operator to be possibly null or undefined
stringGetter({
key: STRING_KEYS.NO_RESULTS,
})}