-
Notifications
You must be signed in to change notification settings - Fork 161
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
Fix coordinator selector maker page #1157
Fix coordinator selector maker page #1157
Conversation
@@ -545,7 +545,7 @@ const CoordinatorDialog = ({ open = false, onClose, network, shortAlias }: Props | |||
|
|||
<Divider /> | |||
|
|||
{coordinator?.info?.swap_enabled === false ? ( | |||
{!coordinator?.info?.swap_enabled ? ( |
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.
lintern auto-fix
@@ -20,7 +20,7 @@ import { AppContext, type UseAppStoreType } from '../../contexts/AppContext'; | |||
|
|||
import CheckBoxOutlineBlankIcon from '@mui/icons-material/CheckBoxOutlineBlank'; | |||
import SwapCalls from '@mui/icons-material/SwapCalls'; | |||
import { FederationContext, UseFederationStoreType } from '../../contexts/FederationContext'; | |||
import { FederationContext, type UseFederationStoreType } from '../../contexts/FederationContext'; |
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.
lintern auto-fix
<div style={{ display: Object.keys(limits) === 0 ? '' : 'none' }}> | ||
<LinearProgress /> | ||
</div> | ||
</Collapse> |
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.
I removed the linear progress in favor of the circular progress in coordinator's avatar
@@ -40,7 +40,6 @@ import type Coordinator from '../../models'; | |||
import { statusBadgeColor, pn, amountToString, computeSats } from '../../utils'; | |||
import TakeButton from './TakeButton'; | |||
import { F2fMapDialog } from '../Dialogs'; | |||
import { GarageContext, type UseGarageStoreType } from '../../contexts/GarageContext'; |
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.
lintern auto-fix
@@ -43,7 +43,7 @@ export const updateExchangeInfo = (federation: Federation): ExchangeInfo => { | |||
premiums[index] = coordinator.info.last_day_nonkyc_btc_premium; | |||
volumes[index] = coordinator.info.last_day_volume; | |||
highestVersion = getHigherVer(highestVersion, coordinator.info.version); | |||
active_robots_today = Math.max(active_robots_today, coordinator.info['active_robots_today']); | |||
active_robots_today = Math.max(active_robots_today, coordinator.info.active_robots_today); |
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.
lintern auto-fix
@@ -126,7 +126,7 @@ class Garage { | |||
) => { | |||
if (!token || !shortAlias) return; | |||
|
|||
let slot = this.getSlot(token); | |||
const slot = this.getSlot(token); |
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.
lintern auto-fix
const hostChecks = | ||
baseFilter.coordinator != 'any' ? filterByHost(order, baseFilter.coordinator) : true; | ||
baseFilter.coordinator !== 'any' ? filterByHost(order, baseFilter.coordinator) : true; |
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.
lintern auto-fix
}); | ||
newFed.registerHook('onCoordinatorUpdate', () => { | ||
setFederationUpdatedAt(new Date().toISOString()); | ||
setCoordinatorUpdatedAt(new Date().toISOString()); |
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.
@Reckless-Satoshi UpdatedAt
s were being triggered the other way around 😓 Fortunately federationUpdatedAt
where not much used, that meas that in the worst case scenario components now will refresh more frequently. Anyways I would say to do a good check of everything for this PR.
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.
it's likely that with this change some minor bugs on the list will be fixed
@@ -103,7 +102,7 @@ const MakerForm = ({ | |||
|
|||
useEffect(() => { | |||
updateCoordinatorInfo(); | |||
}, [maker.coordinator]); | |||
}, [maker.coordinator, coordinatorUpdatedAt]); |
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.
With this change Order current rate:
should appear again bellow the create button
Hey @KoalaSat , just tested the Maker page and ran a couple orders. It all seems to work as expected! Thank you very much for this effort.
In case the requests to We are merging it as is 🚀 Please accept a reward of 150K Sats from the devfund. Submit an invoice from a proxy node ID with a long expiration time. Thank you! |
@Reckless-Satoshi thanks!
|
It will appear loading indefinitely. Do you suggest to control error codes? |
Will only that coordinator load indefinitely, or all of them? Maybe not a bad idea to control error codes and hide the coordinator that is Offline. We could simply use the same variable we are already using in the FederationTable to display that it is offline. |
Saw this one too late. Can you repost? Can your wallet create invoices for more than 24h? |
Yes it can 👍
|
Only that coordinator in particular. The loading disappears for every coordinator independently the moment info and limits are available. I'll think about controlling errors code because it has some implications and edge cases to be considered |
d0b806f495ff2fc0b3fdf636429c1b5c1711f64e5e0f163717e2c4e538ea70be |
* Refactor contexts and models (#921) * Add SVG icons for map pins * Add federation basis and new coordinator form (#793) * Add new coordinator entry issue form * Add Federation basis * Fix eslint errors from F2F and fix languages * Redo eslint @typescript-eslint/strict-boolean-expressions * Robot Page working * Contexts Working * Garage Working * CurrentOrder working * Federation model working --------- Co-authored-by: Reckless_Satoshi <reckless.satoshi@protonmail.com> Co-authored-by: Reckless_Satoshi <90936742+Reckless-Satoshi@users.noreply.github.com> * Fix version, release_note and small typo * Fix (some) lint issues * Fix old merge conflict on federation.md * Add cordinator: Temple of Sats * Federation view fixes (#923) * Fix lint issues * More fixes * Fix PRO * Remove template coordinator * Add coordinator: Satstralia * Add Simplex contact method to coordinator dialog * Add new X icons, replace Twitter * Add satstralia PGP keys * Add PGP keys to /static * Fix robot recovery (#945) * Fix Robot recovery * Change testralia onion * Fix order page * Fix last order * Not expose current notification order * Fix * Change getRobot by getSlot (#955) * Fix order workflow (#957) * Order workflow working * Refactoring * Add coordinator notice * Fix and update About * Update Dispute prompts for multi-coordinator * Adapt garage to coordinators * Fix mobile app (#969) * Update temple of sats, new prettier format * Fix statusToDelay, linting and others * Add robo-identity-wasm * Small fixes * Small fixes * Avatar hashid in Garage (#983) * Fix and disable strict boolean lintern * Fix un-silence all mainnet coordinators * Fix add extra JS bundles and .wasm to uploaded artifacts * Fix navbar and book duplication (#1031) * Add coordinator: TheBigLake * Feat hide LocalDev coordinator conditionally * Robohash gereator queue (#1035) Robohash generator queue * Fix coordinator table avatars flip * Fix coordinator avatar on maker form * Fix update coordinators urls on network change * Fix depth chart and coordinator table (#1039) Fix depth chart and Coordinator table * Add coordinator warning * Fix show coordinator warning only once * Remove generating avatar animation * Fix order tab navigation * Fix order flow (#1040) Fix Order flow * Add extra row to coordinator table * Fix order autoupdate and chat (#1047) * Fix Order autoupdate and chat * Remove console.log * fix: Remove .js files from linting (#1049) Co-authored-by: count-null <70529195+count-null@users.noreply.github.com> * Perf hide animated backgrounds * Fix onboarding offers/create navigation * Fix undefined currencyCode * Fix chat avatars and numeric displays * Fix successful prompt avatars, rate text and txid * Small fixes and lint fixes * Fix coordinator avatars orientation * Fix unsafeAlert and grab safe urls from federation.json * Fix click order on order map * Fix cancel button, add debug console log fetchOrder * Add setAcknowledgeWarning to initialAppContext * Add simple web hosted federated client * Update federated frontend url * Fix Contexts * Fix do not share chat logs on disputes by default * fix infinite re-render loop * Re-set fetchOrder on page change, empty book on not_found * Add coordinator endpoint to stats for nerds * Fix navigation * Small fixes * Fix too-many fetchRobots and coordinator endpoints print * Fix currentOrder fetch * Fix duplicated version on stats for nerds * Minor lint fixes * Fix coordinator hosted web app * Fix amount string on order details * Fix unsafe_alert locale string * Add devfund donation to coordinator summary accordion * Fix book table in the v0.6.0 version (#1083) * Get favorites from context * Rerender objects on favorite mode change * Format sats amount in millionths * Revert to v0.6.0 deps and notes * Fix devfund fraction validation * Fix garage deletion (#1085) * Fix compute exchange active robots by max * Fix book loading (#1086) * Fix book loading * Fix Robot page * Code Review * Book coordinator filter (#1087) * Fix book loading * Fix Robot page * Code Review * Book coordinator filter * Fix matches in MakerPage * Fix book filter avatar sizes and bookUpdate on refresh * Fix host filter overflow on small displays * Delete Rebellion * Fix decimal fees and exchange stats * Fix telegram link (#1099) * Fix rewards claim * Fix hide collab cancel request after fiat sent * Add federation coordinator est. date and hard limits * Add programatic order size limit to new coordinators * Add size limits and onchain swap status to coordinator prof * Update templeofsats tg handle * Update dispute prompt contacts * update temple of sats * Add coordinator: BitcoinVeneto * fix change veneto coordinator badges * update bitcoinveneto contact methods * Fix coordinator selector maker page (#1157) * Fix coordinator selector on Maker page * Refactor onUpdate naming * Fix loading robots (#1166) * Fix loading Robot orders * remove logs * feat: move looking for orders loading bar --------- Co-authored-by: KoalaSat <yv1vtrul@duck.com> * Add loading robot profile (#1176) * Add loading robot profile * Typo * Fix undefined prices error (#1173) * Makes filtering by multiple payment methods in desktop possible (#1172) * Make the payments autocomplete header text independant on isFilter prop * makes filtering by MULTIPLE PAYMENT METHODS possible without great impact in the current experience on DESKTOP only --------- Co-authored-by: Reckless_Satoshi <90936742+Reckless-Satoshi@users.noreply.github.com> * Fix order navbar (#1178) * Fix renew order refresh (#1179) * Fix federation summary (#1180) * Fix federation summary * Fix federation summary * Make it dynamic * Make it dynamic * Fix depth chart borked and premium precision * Update coordinator BitcoinVeneto * Add established date to coordinator dialog --------- Co-authored-by: KoalaSat <yv1vtrul@duck.com> Co-authored-by: nullcount <70529195+nullcount@users.noreply.github.com> Co-authored-by: count-null <70529195+count-null@users.noreply.github.com> Co-authored-by: aftermath <131321480+aftermath2@users.noreply.github.com> Co-authored-by: Renato Peres <56004079+Renato1478@users.noreply.github.com>
What does this PR do?
Related to #1069 Item 1
From the issue:
This PR fixes the loading of coordinator in maker selector by displaying all enabled coordinator at first and displaying a visual circular progress while
info
andlimits
are loaded from the coordinator. Thecreate order
button will stay disabled while this information is not loaded.Checklist before merging
pip install pre-commit
, thenpre-commit install
. Pre-commit installs git hooks that automatically check the codebase. If pre-commit fails when you commit your changes, please fix the problems it points out.