import { put as e, takeLatest as o } from "redux-saga/effects"
import {
setAccountRecoverySuccess as r,
setAccountRecoveryError as t,
submitAccountRecovery as c,
} from "../identity.reducer"
import { getCoreBackend as a } from "../../../backend"
import { apiCall as i } from "../../../api/core"
import { taskErrorSaga as m } from "../../error"
export function* submitAccountRecoverSaga({ payload: o }) {
try {
const t = a()
;(yield i(t.restoreIdentity, o, { create: !1 }), yield e(r()))
} catch (o) {
;(yield e(t({ message: o.message })), yield m("submitAccountRecoverSaga", o, { logOnly: !0 }))
}
}
export function* accountRecoverSaga() {
yield o(c, submitAccountRecoverSaga)
}