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

Streaming: hide streaming options when streaming is not available #97

Merged
merged 2 commits into from
Sep 14, 2022

Conversation

ryantxu
Copy link
Member

@ryantxu ryantxu commented Sep 13, 2022

Also only allows typing numbers. Fixes #91

@@ -265,7 +281,7 @@ export class QueryEditor extends PureComponent<Props, State> {
onIntervalChange = (value?: string) => {
const { onChange, query, onRunQuery } = this.props;
// not sending input less than 5 secs
if (Number(value) < 5) {
if (value?.length && +value < 5) {
Copy link
Member

Choose a reason for hiding this comment

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

is there a benefit to this over Number()?

Copy link
Member Author

Choose a reason for hiding this comment

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

Number() is pretty much equivalent to +, but it is shorter and I like it 🤷

https://i.stack.imgur.com/LLrgj.png

@ryantxu ryantxu merged commit 5d4e6a7 into main Sep 14, 2022
@mukeshsahay mukeshsahay deleted the streaming-ui-cleanup branch January 24, 2023 06:26
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.

[Improvement] Use numeric control for the interval field for streaming
2 participants