Icon-Shelf / icon-shelf

SVG icon manager for developers.
https://icon-shelf.github.io
MIT License
284 stars 27 forks source link

Addition assignment causing unnecessary subdirectory creation for sub-collections #147

Closed hparente1313 closed 1 year ago

hparente1313 commented 1 year ago

The use of the addition assignment operator in line 37 of "OptionsOverlay.tsx" was causing the folderSrc variable to be appended with ${folderSrc}/collection-${uuidv4()} and redeclared as such. This was causing the creation of a large, unnecessary, and hard to follow tree of directories upon the creation of each sub-collection, as the path would duplicate the root path, and then add it onto the pre-existing path in order to create the directory for the sub-collection. A single operator, caused an obscene amount of folders to be created on the creation of each subdirectory.

This is an example of the directory tree that was being created, with the 'Collections' folder I had created as a place to store my collections.

  Icon Shelf
  └── Collections
      └── home
          └── user
              └── Documents
                  └── Software
                      └── Icon Shelf
                          └── Collections
                              └── collection-4f86a
                                  └── home
                                      └── user
                                          └── Documents
                                              └── Software
                                                  └── Icon Shelf
                                                      └── Collections
                                                          └── home
                                                              └── user
                                                                  └── Documents
                                                                      └── Software
                                                                          └── Icon Shelf
                                                                              └── Collections
                                                                                  └── collection-4f86a
                                                                                      ├── collection-f5f50
                                                                                      ├── collection-df402
                                                                                      ├── collection-da465
                                                                                      ├── collection-d29dd
                                                                                      ├── collection-d153c
                                                                                      ├── collection-bb126
                                                                                      ├── collection-b6e50
                                                                                      ├── collection-b6b55
                                                                                      ├── collection-b6972
                                                                                      ├── collection-b513d
                                                                                      ├── collection-afdd3
                                                                                      ├── collection-aed2a
                                                                                      ├── collection-a9772
                                                                                      ├── collection-a769d
                                                                                      ├── collection-a3cf7
                                                                                      ├── collection-9ca5d
                                                                                      ├── collection-97d84
                                                                                      ├── collection-8a643
                                                                                      ├── collection-89ba9
                                                                                      ├── collection-87721
                                                                                      ├── collection-811c9
                                                                                      ├── collection-75b20
                                                                                      ├── collection-6cefa
                                                                                      ├── collection-64c75
                                                                                      ├── collection-52742
                                                                                      ├── collection-4f932
                                                                                      ├── collection-4f374
                                                                                      ├── collection-4a138
                                                                                      ├── collection-469ab
                                                                                      ├── collection-45589
                                                                                      ├── collection-3d041
                                                                                      ├── collection-39c0f
                                                                                      ├── collection-38eb5
                                                                                      ├── collection-34c22
                                                                                      ├── collection-31090
                                                                                      ├── collection-2313b
                                                                                      ├── collection-0fc79
                                                                                      └── collection-00607

The proper directory tree, with two levels, 1 parent, and many children, should have been:

  Icon Shelf
  └── Collections
      └── collection-4f86a
          ├── collection-f5f50
          ├── collection-df402
          ├── collection-da465
          ├── collection-d29dd
          ├── collection-d153c
          ├── collection-bb126
          ├── collection-b6e50
          ├── collection-b6b55
          ├── collection-b6972
          ├── collection-b513d
          ├── collection-afdd3
          ├── collection-aed2a
          ├── collection-a9772
          ├── collection-a769d
          ├── collection-a3cf7
          ├── collection-9ca5d
          ├── collection-97d84
          ├── collection-8a643
          ├── collection-89ba9
          ├── collection-87721
          ├── collection-811c9
          ├── collection-75b20
          ├── collection-6cefa
          ├── collection-64c75
          ├── collection-52742
          ├── collection-4f932
          ├── collection-4f374
          ├── collection-4a138
          ├── collection-469ab
          ├── collection-45589
          ├── collection-3d041
          ├── collection-39c0f
          ├── collection-38eb5
          ├── collection-34c22
          ├── collection-31090
          ├── collection-2313b
          ├── collection-0fc79
          └── collection-00607
hparente1313 commented 1 year ago

I have updated the branch to correct the deletion of the package-lock.json file, I apologize for that, did not mean to make that change.