refactor(web): 优化创建应用模态框代码

- 将 let isMounted = true; 修改为 const isMounted = true;,提高代码可读性
- 移除无用的 debugger 语句,清理代码
- 添加注释以提高代码可维护性
main
Tuzki 3 months ago
parent 83caed4c26
commit 8c525d333b
  1. 6
      web/pages/construct/app/components/create-app-modal/index.tsx

@ -115,7 +115,7 @@ const CreateAppModal: React.FC<{
}
let objectUrl: string | null = null;
let isMounted = true;
const isMounted = true;
if (open && appInfo?.icon) {
(async () => {
@ -171,7 +171,7 @@ const CreateAppModal: React.FC<{
const [error, data] = res;
if (!error) {
if (type === 'edit') {
debugger;
// debugger;
const [, res] = await apiInterceptors(getAppList({}));
const curApp = res?.app_list?.find(item => item.app_code === appInfo?.app_code);
localStorage.setItem('new_app_info', JSON.stringify({ ...curApp, isEdit: true }));
@ -328,7 +328,7 @@ const CreateAppModal: React.FC<{
open={open}
onOk={async () => {
form.validateFields().then(async (values: any) => {
debugger;
// debugger;
await createApp({
app_name: values?.app_name,
app_describe: values?.app_describe,

Loading…
Cancel
Save