Authored by 张丽霞

Fix 当前浏览记录下只有一个商品时侧滑删除后 tag切换crash,review by Redding

... ... @@ -190,6 +190,7 @@ export function deleteOneHistory(skn, index) {
return new BrowseService(app.host).deleteHistory(skn, uid, sourcePage)
.then(json => {
let {productList, selectedProductList} = browse;
let selectedProduct = selectedProductList.toJS()[index];
selectedProductList = selectedProductList.delete(index);
let lists = productList.toArray();
let indexInAll = productList.findIndex((item, i) => {
... ... @@ -198,7 +199,12 @@ export function deleteOneHistory(skn, index) {
if (indexInAll != -1) {
productList = productList.delete(indexInAll);
}
if (selectedProductList.size == 0 || selectedProductList.length == 0) {
dispatch(deleteSelectedProducts([selectedProduct]));
}else {
dispatch(historyDeleteSuccess({productList, selectedProductList}));
}
let show = productList.size > 0;
ReactNative.NativeModules.YH_RecorderHelper.setRightClearButtonVisiblity(show);
})
... ...