Skip to content

fix display of candle remaining time - #97

Open
mariusvigariu wants to merge 1 commit into
project-nv:mainfrom
mariusvigariu:fix/candle-remaining-time-display
Open

fix display of candle remaining time#97
mariusvigariu wants to merge 1 commit into
project-nv:mainfrom
mariusvigariu:fix/candle-remaining-time-display

Conversation

@mariusvigariu

Copy link
Copy Markdown

candle remaining time is kinda broken, see 1w timeframe for an example .. i propose computing the remaining time based on the last close time from the data set and the current timestamp .. if the dataset is not up to date, no remaining time will be shown even if it's set to true in the settings

it also adds some extra timeframes in the mix

@netlify

netlify Bot commented Oct 27, 2023

Copy link
Copy Markdown

Deploy Preview for shiny-selkie-5e063f ready!

Name Link
🔨 Latest commit 80c4568
🔍 Latest deploy log https://app.netlify.com/sites/shiny-selkie-5e063f/deploys/653b84d6aab34f0008420acc
😎 Deploy Preview https://deploy-preview-97--shiny-selkie-5e063f.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@C451

C451 commented Oct 27, 2023

Copy link
Copy Markdown
Contributor

Tbh, I like a solution that doesn't depend on the data. Makes it more robust. Yeah, the 1W & 1M are wrong rn.
I'll think about it later (btw, will your algo work if data.length === 0 ?)

@mariusvigariu

Copy link
Copy Markdown
Author

I see what you mean and think about remaining time of a candle only makes sense when it is relative to the current one. And as a user I dont wanna see remaining time of an hourly candle from yesterday if the data is not up to date. I think its bad UX

The function is not even called if data is empty

@C451

C451 commented Oct 28, 2023

Copy link
Copy Markdown
Contributor

Ok, let's make indentation consistent (4 spaces) and I'll test this & add.

@mariusvigariu

Copy link
Copy Markdown
Author

Regarding the indentation, I wouldn't say it is consistent. I've seen mixed indentation across the code, three spaces, tabs, etc

I've also seen files with dos and unix format.

I want to bring it up again as I believe it is super important to make this project easier to maintain and improve in the future. Have a look on my eslint branch here

I ran autofix with the recommended settings in the last commit ... clone it then run npx eslint src and see how many issues still require attention, this is just a part of all of them:

image

@C451

C451 commented Oct 30, 2023

Copy link
Copy Markdown
Contributor

I agree, it needs to be done at some point. Right now, I'm busy with different tasks. If you'd like, you can fix the indentation everywhere. That would be a good starting point, and I'd appreciate the effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants