..
This commit is contained in:
@@ -62,19 +62,21 @@ export const MenuCategory = ({
|
||||
let userFavorite = useStore.getState().UserStore.userFavorite;
|
||||
if(checked){
|
||||
// 즐겨찾기가 4개 이상일 경우 마지막 항목 제거
|
||||
if(userFavorite.length >= 4){
|
||||
userFavorite = userFavorite.slice(0, 3);
|
||||
if(userFavorite.length >= 10){
|
||||
showAlert('즐겨찾기는 10개까지만 추가 할수 있습니다.');
|
||||
}
|
||||
else{
|
||||
userFavorite = [
|
||||
...userFavorite,
|
||||
{
|
||||
menuId: menuId,
|
||||
menuName: menuName,
|
||||
menuNameEng: menuNameEng,
|
||||
iconFilePath: iconFilePath,
|
||||
programPath: programPath
|
||||
}
|
||||
];
|
||||
}
|
||||
userFavorite = [
|
||||
...userFavorite,
|
||||
{
|
||||
menuId: menuId,
|
||||
menuName: menuName,
|
||||
menuNameEng: menuNameEng,
|
||||
iconFilePath: iconFilePath,
|
||||
programPath: programPath
|
||||
}
|
||||
];
|
||||
}
|
||||
else{
|
||||
// 즐겨찾기가 1개 남았을 때는 해제하지 않음
|
||||
|
||||
Reference in New Issue
Block a user