Skip to content

Commit

Permalink
Add loading state in Export > Send To (#264)
Browse files Browse the repository at this point in the history
* add loading prop, setLoading in handleSendTo

* 1.30.2
  • Loading branch information
mdroidian authored May 28, 2024
1 parent 3922008 commit 5e4c561
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "query-builder",
"version": "1.30.1",
"version": "1.30.2",
"description": "Introduces new user interfaces for building queries in Roam",
"main": "./build/main.js",
"author": {
Expand Down
3 changes: 3 additions & 0 deletions src/components/Export.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ const ExportDialog: ExportDialogComponent = ({

const handleSendTo = async () => {
try {
setLoading(true);
let toastContent: React.ReactNode;
let uid = selectedPageUid;
const title = selectedPageTitle;
Expand Down Expand Up @@ -467,6 +468,7 @@ const ExportDialog: ExportDialogComponent = ({
},
}).catch(() => {});
} finally {
setLoading(false);
onClose();
}
};
Expand Down Expand Up @@ -795,6 +797,7 @@ const ExportDialog: ExportDialogComponent = ({
onClick={handleSendTo}
style={{ minWidth: 64 }}
disabled={isSendToGraph ? !livePages.length : false}
loading={loading}
/>
</div>
</div>
Expand Down

0 comments on commit 5e4c561

Please sign in to comment.