forked from eatvio/eatvio_app
feat(app): refactoring of sentry using, feat(become_consultant): fixed possible infinite loading, feat(push_notifications): fixed push navigation from paid plan push
This commit is contained in:
@@ -155,6 +155,10 @@ class _MyRecipeWidgetState extends State<MyRecipeWidget> {
|
||||
final fullRecipe = await context.read<MyRecipesCubit>().getRecipeById(widget.recipe.slug);
|
||||
if (context.mounted) {
|
||||
Navigator.pop(context); // close dialog
|
||||
if (fullRecipe == null) {
|
||||
showErrorToast('Не удалось загрузить рецепт');
|
||||
return;
|
||||
}
|
||||
final result = await context.push(RecipeCreateScreen.path, extra: fullRecipe);
|
||||
if (!context.mounted) return;
|
||||
if (result == MyRecipesCubit.drafted) {
|
||||
@@ -226,11 +230,16 @@ class _MyRecipeWidgetState extends State<MyRecipeWidget> {
|
||||
builder: (context) => const Center(child: CircularProgressIndicator()),
|
||||
);
|
||||
final fullRecipe = await context.read<MyRecipesCubit>().getRecipeById(widget.recipe.slug);
|
||||
if (!context.mounted) return;
|
||||
Navigator.pop(context);
|
||||
if (fullRecipe == null) {
|
||||
showErrorToast('Не удалось загрузить рецепт');
|
||||
return;
|
||||
}
|
||||
final createCubit = sl<CreateRecipeCubit>();
|
||||
await createCubit.recipeToEntity(fullRecipe);
|
||||
|
||||
if (context.mounted) {
|
||||
Navigator.pop(context);
|
||||
if (createCubit.validateAll()) {
|
||||
final success = await createCubit.publishRecipe(true, widget.recipe.slug);
|
||||
if (success && context.mounted) {
|
||||
|
||||
Reference in New Issue
Block a user