Skip to content

Commit

Permalink
Reset notice on each action
Browse files Browse the repository at this point in the history
  • Loading branch information
mikachan committed Jan 25, 2024
1 parent 2bf44c2 commit e7fb1e8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ function FontLibraryProvider( { children } ) {
}, [ modalTabOpen ] );

const handleSetLibraryFontSelected = ( font ) => {
setNotice( null );

// If font is null, reset the selected font
if ( ! font ) {
setLibraryFontSelected( null );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ function FontCollection( { slug } ) {
};

const handleInstall = async () => {
setNotice( null );

const fontFamily = fontsToInstall[ 0 ];

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ function InstalledFonts() {
};

const handleConfirmUninstall = async () => {
setNotice( null );

try {
await uninstallFontFamily( libraryFontSelected );
setNotice( {
Expand Down

0 comments on commit e7fb1e8

Please sign in to comment.