-
Notifications
You must be signed in to change notification settings - Fork 70
chore: only show the "Open in Stackblitz" button when there are no actual templates defined #349
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
Conversation
commit: |
@@ -315,7 +315,7 @@ const main = defineCommand({ | |||
|
|||
const noDefaultTemplate = args.template === false; | |||
|
|||
if (!noDefaultTemplate) { | |||
if (!noDefaultTemplate && templates.length === 0) { |
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.
should it be an &&
? why?
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 think it should be an &&
because we want the default template to be created only when both conditions are true?
if no templates were found and if the user hasn't explicitly disabled templates.
if you think about using ||
, I think it might be incorrect because if noDefaultTemplate
is true, we should not create the default template, even if no templates were found. or if the user uses, as an example, --template ./examples/*
and templates are found, we should not create the default template. unless I'm missing something here...
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.
That makes total sense.
please mention in each of the relevant slack threads that this issue was fixed. same with other issues. and i think there are more issues in slack that need to be tackled. |
With these changes, the button will always be shown when there are no actual templates. The only time the button is hidden is when there are actual templates.