Commit 71fbf28e authored by ioedeveloper's avatar ioedeveloper

Update fix

parent 65d17222
...@@ -25,7 +25,6 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -25,7 +25,6 @@ export const FileExplorer = (props: FileExplorerProps) => {
focusPath: null, focusPath: null,
files: [], files: [],
fileManager: null, fileManager: null,
accessToken: null,
ctrlKey: false, ctrlKey: false,
newFileName: '', newFileName: '',
actions: [], actions: [],
...@@ -73,8 +72,6 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -73,8 +72,6 @@ export const FileExplorer = (props: FileExplorerProps) => {
useEffect(() => { useEffect(() => {
(async () => { (async () => {
const fileManager = registry.get('filemanager').api const fileManager = registry.get('filemanager').api
const config = registry.get('config').api
const accessToken = config.get('settings/gist-access-token')
const files = await fetchDirectoryContent(name) const files = await fetchDirectoryContent(name)
const actions = [{ const actions = [{
id: 'newFile', id: 'newFile',
...@@ -121,7 +118,7 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -121,7 +118,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
}] }]
setState(prevState => { setState(prevState => {
return { ...prevState, fileManager, accessToken, files, actions } return { ...prevState, fileManager, files, actions }
}) })
})() })()
}, []) }, [])
...@@ -605,7 +602,10 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -605,7 +602,10 @@ export const FileExplorer = (props: FileExplorerProps) => {
}, null) }, null)
} else { } else {
// check for token // check for token
if (!state.accessToken) { const config = registry.get('config').api
const accessToken = config.get('settings/gist-access-token')
if (!accessToken) {
modal('Authorize Token', 'Remix requires an access token (which includes gists creation permission). Please go to the settings tab to create one.', { modal('Authorize Token', 'Remix requires an access token (which includes gists creation permission). Please go to the settings tab to create one.', {
label: 'Close', label: 'Close',
fn: async () => {} fn: async () => {}
...@@ -613,7 +613,7 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -613,7 +613,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
} else { } else {
const description = 'Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. \n Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=' + const description = 'Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. \n Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=' +
queryParams.get().version + '&optimize=' + queryParams.get().optimize + '&runs=' + queryParams.get().runs + '&gist=' queryParams.get().version + '&optimize=' + queryParams.get().optimize + '&runs=' + queryParams.get().runs + '&gist='
const gists = new Gists({ token: state.accessToken }) const gists = new Gists({ token: accessToken })
if (id) { if (id) {
const originalFileList = await getOriginalFiles(id) const originalFileList = await getOriginalFiles(id)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment