Mastersam07 / pub-manager

An experimental solution to assist with adding a dart/flutter package on pub.dev to favourite
MIT License
3 stars 0 forks source link

Adding to favourites not updating favourite folder #2

Open Mastersam07 opened 1 year ago

Mastersam07 commented 1 year ago

Adding a package to a favorite is meant to update the favorite folder in bookmarks. However, it tends to create a new folder and add the package bookmark to that folder.

Implications: For 10 added packages, that would be 10 folders with the same name housing one package each instead of 1 folder with 10 packages.

Mastersam07 commented 1 year ago

From the background script:

chrome.bookmarks.create({ 'parentId': '1', 'title': 'Flutter/Dart Packages' });

The above is called, and the folder id passed down to add the package to this folder. A fix would be to check if a bookmark folder with that name exists then create a new bookmark in that folder or a more like createIfNotExist solution that creates if the folder doesn't exist or just put if already exist.