Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
qftgtr committed Sep 5, 2021
1 parent 9d019fb commit 910e01b
Show file tree
Hide file tree
Showing 9 changed files with 946 additions and 88 deletions.
13 changes: 8 additions & 5 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ PROJECT=bsc
PROJECT_NAME="BSC Studio"

REACT_APP_SERVER_URL=https://app.obsidians.io
REACT_APP_GITHUB_CLIENT_ID=0719e502c798dd4bb376
REACT_APP_IPC_SERVER_URL=https://bsc.obsidians.io

LOGIN_PROVIDERS=github
REACT_APP_OAUTH_SERVER_URL=https://app.obsidians.io
REACT_APP_OAUTH_GITHUB_PROVIDER_URL=https://github.com/login/oauth/authorize
REACT_APP_OAUTH_GITHUB_CLIENT_ID=0719e502c798dd4bb376
REACT_APP_OAUTH_GITHUB_REDIRECT_URI=https://app.obsidians.io/api/v1/auth/callback

REACT_APP_AWS_REGION=cn-north-1
REACT_APP_AWS_S3_REGION=cn-northwest-1
REACT_APP_AWS_ROLE_ARN=arn:aws-cn:iam::494443934921:role/Cognito_webIDE_UserIdentity_Pool_Auth_Role
REACT_APP_AWS_ROLE_SESSION_NAME=bsc
REACT_APP_AWS_BUCKET=webideuserdata

REACT_APP_IPC_SERVER_URL=https://bsc.obsidians.io

UPLOAD_SOURCEMAPS=false

UPLOAD_SOURCEMAPS=false
14 changes: 12 additions & 2 deletions config-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const {
override,
addWebpackExternals,
addWebpackAlias,
addWebpackPlugin
addWebpackPlugin,
} = require('customize-cra')
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin')

Expand Down Expand Up @@ -111,5 +111,15 @@ if (process.env.CDN) {
}

module.exports = {
webpack: override(...overrides)
webpack: override(...overrides),
devServer: function (configFunction) {
return function (proxy, allowedHost) {
const config = configFunction(proxy, allowedHost);
config.headers = {
'Cross-Origin-Opener-Policy': 'same-origin',
'Cross-Origin-Embedder-Policy': 'require-corp',
}
return config
}
},
}
4 changes: 2 additions & 2 deletions src.main/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { AutoUpdate } = require('@obsidians/global')
const CompilerManager = require('@obsidians/eth-compiler')
const { InstanceManager } = require('@obsidians/bsc-network')
const ProjectChannel = require('@obsidians/eth-project')
const SdkChannel = require('@obsidians/bsc-sdk')
const { SdkChannel } = require('@obsidians/eth-sdk')
const AuthChannel = require('@obsidians/auth')

let ipcChannel, keypairManager, autoUpdate, compilerManager, instanceManager, projectChannel, sdkChannel, authChannel
Expand All @@ -15,6 +15,6 @@ module.exports = function () {
compilerManager = new CompilerManager()
instanceManager = new InstanceManager()
projectChannel = new ProjectChannel()
sdkChannel = new SdkChannel()
sdkChannel = new SdkChannel(keypairManager)
authChannel = new AuthChannel()
}
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function App () {
<Suspense fallback={<LoadingScreen />}>
<Switch>
<Route path='/callback' render={props => {
Auth.handleCallback(props)
Auth.callback(props)
return <LoadingScreen text='Logging in...' />
}}/>
<Route component={ReduxApp} />
Expand Down
2 changes: 1 addition & 1 deletion src/ReduxApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default class ReduxApp extends Component {
}

async function onReduxLoaded () {
Auth.updateProfile()
Auth.restore()
const version = fileOps.current.getAppVersion()
redux.dispatch('SET_VERSION', { version })
}
8 changes: 4 additions & 4 deletions src/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import keypairManager from '@obsidians/keypair'

import { List } from 'immutable'

import BscSdk, { kp } from '@obsidians/bsc-sdk'
import BscSdk from '@obsidians/bsc-sdk'

keypairManager.kp = kp
keypairManager.kp = BscSdk.kp
networkManager.addSdk(BscSdk, BscSdk.networks)

class HeaderWithRedux extends PureComponent {
Expand All @@ -24,7 +24,7 @@ class HeaderWithRedux extends PureComponent {
headerActions.history = this.props.history
this.setState({ networkList: List(networkManager.networks) }, this.setNetwork)
if (!networkManager.network) {
networkManager.setNetwork(networkManager.networks[0])
networkManager.setNetwork(networkManager.networks[0], { notify: false })
}
this.navGuard = new NavGuard(this.props.history)
}
Expand Down Expand Up @@ -64,7 +64,7 @@ class HeaderWithRedux extends PureComponent {
return (
<Header
profile={profile}
projects={projects.get('local').toJS()}
projects={projects}
selectedProject={selectedProject}
selectedContract={selectedContract}
selectedAccount={selectedAccount}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const Network = lazy(() => import('./Network' /* webpackChunkName: "tabs" */))

export default function (props) {
return (
<React.Fragment>
<>
{props.children}
<Suspense fallback={<LoadingScreen />}>
<CacheSwitch>
Expand Down Expand Up @@ -75,6 +75,6 @@ export default function (props) {
component={BottomBar}
className='border-top-1 d-flex flex-row'
/>
</React.Fragment>
</>
)
}
2 changes: 2 additions & 0 deletions webpack.main.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = merge.smart(baseConfig, {
output: {
path: path.resolve(__dirname, 'dev')
},
resolve: { mainFields: ['main', 'module'] },
module: {
rules: [
{
Expand Down Expand Up @@ -77,6 +78,7 @@ module.exports = merge.smart(baseConfig, {
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
'process.env.BUILD': JSON.stringify(process.env.BUILD),
'process.env.PROJECT': JSON.stringify(process.env.PROJECT || process.env.BUILD),
'process.env.SERVER_URL': JSON.stringify(process.env.REACT_APP_SERVER_URL),
'process.env.DOCKER_IMAGE_NODE': '"obsidians/bsc"',
'process.env.DOCKER_IMAGE_COMPILER': '"obsidians/truffle"',
})
Expand Down
Loading

0 comments on commit 910e01b

Please sign in to comment.