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

Fix no file in directory bug #35

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NguyenNguyen205
Copy link

*Fixes Issue #28 *

Changed Files:
App.svelte

What has changed:

  • Add new h2 tag element to display message if no files were found
  • Update the update method to check if there are any files in the directory

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you for opening your first pull request! Wait until we get to it and see if you can merge.

Copy link
Owner

@Villy-P Villy-P left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! We need to fix one more thing, and then we can merge. This project uses Svelte for reactivity, but you're using normal JS for changing the state of the elements. We can do this much easier with Svelte!

If you create a global variable and set it equal to extensionsSort.size > 0, you can use a cool Svelte trick to show and hide the data:

{#if !areFiles} <-- Place your variable here
	<h2>No files were found in the directory {cwd}</h2> 
{:else}
	<!-- Place all other elements here: we only want to have the h2 in our display if there are no other files -->
{/if}

Svelte will automatically update the DOM to reflect the changes.
If you have any questions, please feel free to ask!

@Villy-P Villy-P linked an issue Nov 8, 2024 that may be closed by this pull request
@Villy-P Villy-P self-assigned this Nov 8, 2024
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.

Fix Graph if there are no files
2 participants