@@ -2,11 +2,13 @@ import React, { useState, useEffect } from 'react';
2
2
import { Link , useParams } from 'react-router-dom' ;
3
3
import { toast } from 'react-toastify' ;
4
4
import BatchAPI from 'renderer/api/BatchAPI' ;
5
+ import ConfigAPI from 'renderer/api/ConfigAPI' ;
5
6
6
7
let VideoList = ( ) => {
7
8
const { game } = useParams ( ) ;
8
9
const [ videos , setVideos ] = useState ( [ ] ) ;
9
10
const [ batchCount , setBatchCount ] = useState ( 0 ) ;
11
+ const [ config , setConfig ] = useState ( { } ) ;
10
12
11
13
useEffect ( ( ) => {
12
14
loadVideos ( ) ;
@@ -15,8 +17,10 @@ let VideoList = () => {
15
17
const loadVideos = async ( ) => {
16
18
const videos = await window . api . send ( 'getVideos' , game ) ;
17
19
const hasBatch = await BatchAPI . hasBatch ( ) ;
20
+ const config = await ConfigAPI . getConfig ( ) ;
18
21
setVideos ( videos ) ;
19
22
setBatchCount ( hasBatch ) ;
23
+ setConfig ( config ) ;
20
24
} ;
21
25
22
26
const deleteFile = async ( id , game , isActive ) => {
@@ -32,13 +36,17 @@ let VideoList = () => {
32
36
< Link to = { `/create/${ game } ` } >
33
37
< button > New Clip</ button >
34
38
</ Link >
35
- < Link to = { `/batch/${ game } ` } >
36
- < button > New Batch</ button >
37
- </ Link >
38
- { batchCount > 0 ? (
39
- < Link to = { `/create/${ game } ?batch=true` } >
40
- < button > Continue Batch ({ batchCount } )</ button >
41
- </ Link >
39
+ { config . editor === 'advanced' ? (
40
+ < >
41
+ < Link to = { `/batch/${ game } ` } >
42
+ < button > New Batch</ button >
43
+ </ Link >
44
+ { batchCount > 0 ? (
45
+ < Link to = { `/create/${ game } ?batch=true` } >
46
+ < button > Continue Batch ({ batchCount } )</ button >
47
+ </ Link >
48
+ ) : null }
49
+ </ >
42
50
) : null }
43
51
< h3 > Clips</ h3 >
44
52
{ videos . filter ( ( video ) => video . _id . startsWith ( '_' ) ) . length > 0 ? (
0 commit comments