jamespot-front-business 1.1.92 → 1.1.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs.js CHANGED
@@ -1395,9 +1395,17 @@ const toggleExtraBotActivation = toolkit.createAsyncThunk('extraBot/toggleActiva
1395
1395
  try {
1396
1396
  const enabled = !extraBot.enabled;
1397
1397
  const res = (yield extra.jApi.article.update(Object.assign(Object.assign({}, extraBot), { enabled }), { format: jamespot.Format.VIEW })).result;
1398
- dispatch(Toast.actions.success({
1399
- label: enabled ? 'APP_ExtraBot_Toast_ActivationSuccess' : 'APP_ExtraBot_Toast_DeactivationSuccess',
1400
- }));
1398
+ if (res.enabled !== extraBot.enabled) {
1399
+ dispatch(Toast.actions.success({
1400
+ label: enabled ? 'APP_ExtraBot_Toast_ActivationSuccess' : 'APP_ExtraBot_Toast_DeactivationSuccess',
1401
+ }));
1402
+ dispatch(fetchExtraBotListAll());
1403
+ }
1404
+ else {
1405
+ dispatch(Toast.actions.error({
1406
+ label: 'APP_ExtraBot_Toast_FailedToChangeActivation',
1407
+ }));
1408
+ }
1401
1409
  return res;
1402
1410
  }
1403
1411
  catch (err) {
@@ -1414,8 +1422,9 @@ const saveExtraBot = toolkit.createAsyncThunk('extraBot/save', ({ extraBot }, {
1414
1422
  let user;
1415
1423
  delete data.avatar;
1416
1424
  if (extraBot.uri) {
1417
- res = (yield extra.jApi.article.update(data, { format: jamespot.Format.VIEW }))
1418
- .result;
1425
+ res = (yield extra.jApi.article.update(data, {
1426
+ format: jamespot.Format.VIEW,
1427
+ })).result;
1419
1428
  user = (yield extra.jApi.extraBot.updateBot(res.uri)).result;
1420
1429
  }
1421
1430
  else {