Skip to content

Templates appear in library once created (without refresh)#51

Merged
kdsparks merged 5 commits intomainfrom
50-created-template-appear
Jun 26, 2025
Merged

Templates appear in library once created (without refresh)#51
kdsparks merged 5 commits intomainfrom
50-created-template-appear

Conversation

@kdsparks
Copy link
Collaborator

@kdsparks kdsparks commented Jun 26, 2025

Pull Request Template

Pulled template from here

Templates appear in library once created (without refresh)

Type of Change

  • New feature
  • Bug fix
  • Documentation update
  • Refactoring
  • Hotfix
  • Security patch
  • UI/UX improvement

Description

LibraryWidget.tsx: Changed createTemplate() to be async, await TemplateManager.create(), and return the template.
TemplatesManager.ts: Changed create() to be async because saving a file should be an async operation.
index.ts: Added if(template) block to make sure we could access template.id. Added an console.error message if template creation fails. Changed rank of push button to be 1 so it is listed immediately after Save Code Snippet.

Testing

Tested template creation in the browser.

Impact

TemplatesManager.create() is now async so any function that calls it needs to await it (and also be async).

Additional Information

[Any additional information that reviewers should be aware of.]

Checklist

  • My code adheres to the coding and style guidelines of the project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings

@github-actions
Copy link

Binder 👈 Launch a Binder on branch a2jensen/ASPEN/50-created-template-appear

kdsparks added 3 commits June 26, 2025 12:58
Keeping changes from main for decorations and sort option persistence
Deleted redundant line
Added proper spacing
@kdsparks kdsparks merged commit 4d79c65 into main Jun 26, 2025
2 of 6 checks passed
@kdsparks kdsparks deleted the 50-created-template-appear branch June 26, 2025 21:03
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.

2 participants