@@ -15,8 +15,6 @@ import { WorkspaceLocation } from '../workspace/WorkspaceTypes';
15
15
import FileSystemViewContextMenu from './FileSystemViewContextMenu' ;
16
16
import FileSystemViewFileName from './FileSystemViewFileName' ;
17
17
import FileSystemViewIndentationPadding from './FileSystemViewIndentationPadding' ;
18
- import { OverallState } from '../application/ApplicationTypes' ;
19
- import { actions } from '../utils/ActionsHelper' ;
20
18
21
19
type Props = {
22
20
workspaceLocation : WorkspaceLocation ;
@@ -62,12 +60,10 @@ const FileSystemViewFileNode: React.FC<Props> = ({
62
60
63
61
const [ isEditing , setIsEditing ] = React . useState ( false ) ;
64
62
const dispatch = useDispatch ( ) ;
65
- const store = useStore < OverallState > ( ) ;
66
63
67
64
const fullPath = path . join ( basePath , fileName ) ;
68
65
69
66
const handleOpenFile = ( ) => {
70
- fileSystem . readFile ( fullPath , 'utf-8' , async ( err , fileContents ) => {
71
67
fileSystem . readFile ( fullPath , 'utf-8' , async ( err , fileContents ) => {
72
68
if ( err ) {
73
69
console . error ( err ) ;
@@ -76,19 +72,6 @@ const FileSystemViewFileNode: React.FC<Props> = ({
76
72
throw new Error ( 'File contents are undefined.' ) ;
77
73
}
78
74
dispatch ( addEditorTab ( workspaceLocation , fullPath , fileContents ) ) ;
79
- const idx = store . getState ( ) . workspaces [ 'playground' ] . activeEditorTabIndex || 0 ;
80
- const repoName = store . getState ( ) . playground . repoName || '' ;
81
- const editorFilePath = store . getState ( ) . workspaces [ 'playground' ] . editorTabs [ idx ] . filePath || '' ;
82
- console . log ( repoName ) ;
83
- console . log ( editorFilePath ) ;
84
- store . dispatch ( actions . updateEditorGithubSaveInfo (
85
- 'playground' ,
86
- idx ,
87
- repoName ,
88
- editorFilePath ,
89
- new Date ( )
90
- ) ) ;
91
- console . log ( store . getState ( ) . workspaces [ 'playground' ] . editorTabs ) ;
92
75
} ) ;
93
76
} ;
94
77
0 commit comments