Skip to content

Changes for issue tc-create#350 #113

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

Merged
merged 7 commits into from
Dec 17, 2021
Merged
Show file tree
Hide file tree
Changes from 6 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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gitea-react-toolkit",
"version": "1.11.1-rc.1",
"version": "2.0.0-rc.1",
"license": "MIT",
"description": "A Gitea API React Toolkit Component Library",
"homepage": "https://gitea-react-toolkit.netlify.com/",
Expand Down
9 changes: 5 additions & 4 deletions src/components/file/useFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ function useFile({
const branch = repository && (repository.branch || repository.default_branch);
const [deleted, setDeleted] = useState();

const _setBlob = useCallback((_blob) => {
if (blob && _blob && onConfirmClose) {
if (onConfirmClose())
{
const _setBlob = useCallback(async (_blob) => {
if (blob && _blob && typeof onConfirmClose == 'function') {
const confirm = await onConfirmClose()

if (confirm) {
setBlob(_blob);
}
} else{
Expand Down