Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use async call in authenticatedAction #331

Merged
merged 1 commit into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ export const RefreshButton = ({ wallet }: { wallet: App.Data.Wallet.WalletData |
const { isMdAndAbove } = useBreakpoint();

const refresh = (): void => {
void authenticatedAction((): void => {
void authenticatedAction(async () => {
setDisabled(true);

void window.axios.post(route("refresh-collections"));
await window.axios.post(route("refresh-collections"));

showToast({
type: "pending",
Expand Down
4 changes: 2 additions & 2 deletions resources/js/Pages/Collections/View.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ const CollectionsView = ({
};

const handleRefreshActivity = (): void => {
void authenticatedAction((): void => {
void authenticatedAction(async () => {
setIsLoadingActivity(true);
requestActivityUpdate(collection.address);

Expand All @@ -275,7 +275,7 @@ const CollectionsView = ({
isExpanded: true,
});

void axios.post(
await axios.post(
route("collection.refresh-activity", {
collection: collection.slug,
}),
Expand Down
Loading