diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index bde5233d..5d36ec59 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -91,8 +91,6 @@ def route_component(route) inertia_share flash: -> { flash.to_hash } - # methods called in inertia_share must be called off of "self" - # https://github.com/inertiajs/inertia-rails/issues/4#issuecomment-538493236 inertia_share do { user: current_user, diff --git a/app/frontend/components/admin/creator/BillCreatorBill.tsx b/app/frontend/components/admin/creator/BillCreatorBill.tsx index a6441c47..2f91de7f 100644 --- a/app/frontend/components/admin/creator/BillCreatorBill.tsx +++ b/app/frontend/components/admin/creator/BillCreatorBill.tsx @@ -102,7 +102,7 @@ const BillCreatorBill = ({ setCreatorDirty }: IProps) => { const caller = initialValues.id ? form.put : form.post; const route = initialValues.id ? `/bills/${initialValues.id}` : "/bills"; - caller(route, { preserveScroll: true }); + caller(route, { preserveScroll: true, async: true }); }, [form, initialValues.id, swayLocale.id], ); diff --git a/app/frontend/components/admin/creator/BillCreatorLegislatorVotes.tsx b/app/frontend/components/admin/creator/BillCreatorLegislatorVotes.tsx index ff664df8..759c03da 100644 --- a/app/frontend/components/admin/creator/BillCreatorLegislatorVotes.tsx +++ b/app/frontend/components/admin/creator/BillCreatorLegislatorVotes.tsx @@ -123,7 +123,7 @@ const BillCreatorLegislatorVotes = () => { }; }); - post("/legislator_votes", { preserveScroll: true }); + post("/legislator_votes", { preserveScroll: true, async: true }); }, [bill.id, post, transform], ); diff --git a/app/frontend/components/admin/creator/BillCreatorOrganizations.tsx b/app/frontend/components/admin/creator/BillCreatorOrganizations.tsx index 47fa4427..f76515da 100644 --- a/app/frontend/components/admin/creator/BillCreatorOrganizations.tsx +++ b/app/frontend/components/admin/creator/BillCreatorOrganizations.tsx @@ -132,7 +132,7 @@ const BillCreatorOrganizations: React.FC = () => { return; } - post("/organizations", { preserveScroll: true }); + post("/organizations", { preserveScroll: true, async: true }); }, [bill.id, post], ); diff --git a/app/frontend/pages/Registration.tsx b/app/frontend/pages/Registration.tsx index d5a404d1..3e3abc60 100644 --- a/app/frontend/pages/Registration.tsx +++ b/app/frontend/pages/Registration.tsx @@ -69,6 +69,7 @@ const Registration: React.FC = ({ user }) => { toast.dismiss(toastId); setLoading(false); }, + async: true, }); }, [post],