@@ -15,12 +15,10 @@ import {
15
15
import FilesTable from '../../../components/FilesTable/FilesTable'
16
16
import { allowNull , apiV2CompatibleStrings , convertToBase64 } from '../../../resources/utilityFunctions'
17
17
18
- const ViewFiles = ( { backgroundColor, initialFiles , handleClose, onSubmit } ) => {
18
+ const ViewFiles = ( { backgroundColor, files , handleClose, onSubmit } ) => {
19
19
const fileRef = useRef ( null )
20
- const [ files , setFiles ] = useState ( initialFiles )
21
20
const [ tempFiles , setTempFiles ] = useState ( [ ] )
22
21
const [ showSuccessAlert , setShowSuccessAlert ] = useState ( false )
23
- //let newlyAddedFiles = []
24
22
const documentTabs = [
25
23
{
26
24
eventKey : 'files' ,
@@ -34,10 +32,6 @@ const ViewFiles = ({ backgroundColor, initialFiles, handleClose, onSubmit }) =>
34
32
} ,
35
33
]
36
34
37
- // TODO(summercook):
38
- // - comment back in the following 3 methods once posting messages/attachments is working
39
- // may need to use the handleSendingMessagesOrFiles to post
40
-
41
35
const handleAddFile = async ( event ) => {
42
36
event . preventDefault ( )
43
37
try {
@@ -113,7 +107,7 @@ const ViewFiles = ({ backgroundColor, initialFiles, handleClose, onSubmit }) =>
113
107
< Tabs defaultActiveKey = 'files' id = 'document-tabs' justify fill >
114
108
{ documentTabs && documentTabs . map ( ( tab ) => {
115
109
const { eventKey, title, status } = tab
116
- const filteredFiles = initialFiles . filter ( ( f ) => ( status === f . status ) || ( status === 'Other File' && f . status === null ) )
110
+ const filteredFiles = files . filter ( ( f ) => ( status === f . status ) || ( status === 'Other File' && f . status === null ) )
117
111
return (
118
112
< Tab
119
113
eventKey = { eventKey }
@@ -137,7 +131,7 @@ const ViewFiles = ({ backgroundColor, initialFiles, handleClose, onSubmit }) =>
137
131
138
132
ViewFiles . propTypes = {
139
133
backgroundColor : PropTypes . string ,
140
- initialFiles : PropTypes . arrayOf (
134
+ files : PropTypes . arrayOf (
141
135
PropTypes . shape ( {
142
136
contentLength : PropTypes . string . isRequired ,
143
137
contentType : PropTypes . string . isRequired ,
0 commit comments