Effects will be called one more time automatically in antd design pro

use antd design pro

 <span
    className={Style.opt}
    style={{
      color: canClickColor,
      cursor: canClickCursor,
    }}
    onClick={() =>{this.unAssignSource(record, index)}}
  >
    
  </span>
unAssignSource = (record, index) => {
    const { dispatch } = this.props;
    const modal = confirm({
      title: "",
      content: "",
      onOk: async () => {
        await dispatch({
          type: "assignSource/unAssignSource",
          payload: {
            index,
            value: {
              category_id: record.category_id,
              resource_id: record.id,
            },
          },
        });
        modal.destroy();
      }
    })
  }

Code of effects in model

*unAssignSource({ payload }, { call, put }) {
    console.log("%cUN payload: ", "color: -sharpCC00FF; font-size: 18px;", payload)
    const { index, value } = payload;
    const response = yield call(unAssignSource, value);
    if (response && response.code === 200) {
      yield put({
        type: "unAssignSource",
        payload: index,
      });
      message.success("");
    }
}

Code of reducers

unAssignSource(stats, { payload }) {
  const newData = Array.from(stats.sourceList);
  newData.splice(payload, 1);
  return {
    ...stats,
    sourceList: newData,
  };
}

when I clicked to unbind, the unAssignSource effects was executed twice, and the second printed payload was 0
the second time it was called automatically. For some reason, ask God to solve

.
Jul.07,2022

debug

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b22837-2b619.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b22837-2b619.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?