Skip to content

Commit

Permalink
Make HMR notifications slightly nicer
Browse files Browse the repository at this point in the history
  • Loading branch information
Spappz committed Jan 30, 2025
1 parent 5f98cbd commit fcc04b8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"load": {
"notify": {
"AnimCoreUpdated": "<code>AnimCore</code> updated!",
"componentUpdated": "<code>{component}</code> updated!",
"animationSetsUpdated": "Animation sets updated!"
},
"error": {
Expand Down
2 changes: 1 addition & 1 deletion src/storage/AnimCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ if (import.meta.hot) {
if (newModule && newModule.AnimCore) {
AnimCore = newModule.AnimCore;
newModule.AnimCore.init();
info('pf2e-graphics.load.notify.AnimCoreUpdated');
info('pf2e-graphics.load.notify.componentUpdated', { component: 'AnimCore' });
}
});
}
4 changes: 3 additions & 1 deletion src/view/ChatMessage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ const preDelete = Hooks.on('preDeleteChatMessage', (message) => {

if (import.meta.hot) {
// Prevents reloads
import.meta.hot.accept();
import.meta.hot.accept((newModule) => {
if (newModule) info('pf2e-graphics.load.notify.componentUpdated', { component: 'view/ChatMessage' });

Check failure on line 86 in src/view/ChatMessage/index.ts

View workflow job for this annotation

GitHub Actions / Vite build

Cannot find name 'info'.
});
// Disposes the previous hook
import.meta.hot.dispose(() => {
Hooks.off('preDeleteChatMessage', preDelete);
Expand Down

0 comments on commit fcc04b8

Please sign in to comment.