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

client: fix client forever loading when connecting to off server #1647

Merged
merged 1 commit into from
Jun 7, 2022
Merged
Changes from all commits
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
4 changes: 3 additions & 1 deletion client/webserver/site/src/js/markets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2228,7 +2228,9 @@ class MarketList {
/* exists will be true if the specified market exists. */
exists (host: string, baseID: number, quoteID: number) {
const xc = this.xcSection(host)
if (!xc) return false
// If connecting to an offline server the client is not able to get xc.marketRows.
// Therefore we must check for it.
if (!xc || !xc.marketRows) return false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could maybe use a comment as to why this is necessary so it doesn't get broken again in the future.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review Joe, I added the comment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JoeGruffins did you say you got an error on the wallets page too (as well as the markets page)? It looks like @martonp fixed that in 30e29d7#diff-1fb1a75f430311eb5c798880a2edbce5c4f529a823bd265bf255b3f4ba0cd8d9

for (const mkt of xc.marketRows) {
if (mkt.baseID === baseID && mkt.quoteID === quoteID) return true
}
Expand Down