-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Newsletter imports: Handle errors correctly (#99162)
* Newsletter imports: Handle errors correctly rebase. * Update props. * Pass tests * Make TS happy. * remove optional param * Show the notice till the user dimisses it. * Error handling and add upgrade link based on site. * Make tests happy. * dispatch all errors correctly. * Make test happy * Update atomic site checks.
- Loading branch information
1 parent
5406049
commit 921d762
Showing
4 changed files
with
92 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Subscriber } from '@automattic/data-stores'; | ||
import { useSelect } from '@wordpress/data'; | ||
|
||
export function useImportError() { | ||
const { importSelector } = useSelect( ( select ) => { | ||
const subscriber = select( Subscriber.store ); | ||
return { | ||
importSelector: subscriber.getImportSubscribersSelector(), | ||
}; | ||
}, [] ); | ||
|
||
return importSelector?.error; | ||
} |