Skip to content

Commit

Permalink
feat: #468
Browse files Browse the repository at this point in the history
  • Loading branch information
Oaciqihz committed Nov 16, 2024
1 parent e4ce76f commit 36cac00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/hooks/usePublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const usePublish = (props) => {
const { verify } = useVerifyToken();
const navigateTo = useNavigate();
const { t } = useTranslation(["publish", "translation"]);
const dataBase = "publish";

const [isLoading, setIsLoading] = useState(false);
const [isOk, setIsOk] = useState(false);
Expand Down Expand Up @@ -63,18 +64,18 @@ export const usePublish = (props) => {
if (!changeId && res.status === 0) {
// 创建
cancel();
clearDataBase(dataBase)
createLoading = false;
setCreateLoading(createLoading);
message.success(t("message.success.create"));
localStorage.removeItem("decert.store");
navigateTo(`/quests/${createTokenId}`)
}else if (res.data.uri === ("ipfs://"+jsonHash)){
// 修改
cancel();
clearDataBase(dataBase)
createLoading = false;
setCreateLoading(createLoading);
message.success(t("translation:message.success.save"));
localStorage.removeItem("decert.store");
navigateTo(`/quests/${changeId}`);
}
})
Expand Down
1 change: 1 addition & 0 deletions src/views/Publish/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export default function Publish(params) {
recommend: publishObj.recommend,
category: publishObj.category
}).then(res => {
clearDataBase(dataBase)
res?.message && message.success(res?.message);
!res && setLoading(false);
return res
Expand Down

0 comments on commit 36cac00

Please sign in to comment.