Feat: 手机端和非个人文件页禁止拖拽

This commit is contained in:
HFO4 2019-11-30 19:57:36 +08:00
parent 3b3bf5b0c1
commit 457809008d
2 changed files with 9 additions and 2 deletions

View File

@ -11,7 +11,7 @@ import {
openMusicDialog,
toggleSnackbar
} from "../../actions/index";
import Folder from "./Folder";
import statusHelper from "../../untils/page"
import FileIcon from "./FileIcon";
import SmallIcon from "./SmallIcon";
import TableItem from "./TableRow";
@ -22,6 +22,9 @@ import { makeStyles } from "@material-ui/core";
import { useDrag } from "react-dnd";
import { getEmptyImage } from 'react-dnd-html5-backend'
import DropWarpper from "./DnD/DropWarpper"
import {
useLocation
} from "react-router-dom";
const useStyles = makeStyles(theme => ({
container: {
@ -41,6 +44,7 @@ export default function ObjectIcon(props) {
const viewMethod = useSelector(
state => state.viewUpdate.explorerViewMethod
);
let location = useLocation();
const dispatch = useDispatch();
const ContextMenu = useCallback(
@ -208,6 +212,9 @@ export default function ObjectIcon(props) {
console.log(item.object,dropResult.folder);
}
},
canDrag: () =>{
return !statusHelper.isMobile() && statusHelper.isHomePage(location.pathname);
},
collect: monitor => ({
isDragging: monitor.isDragging()
})

View File

@ -107,7 +107,7 @@ function LoginForm (){
if (loginCaptcha){
refreshCaptcha()
}
},[])
const login = e=>{