Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Fixes for parity-extension #6990

Merged
merged 5 commits into from
Nov 9, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"Parity"
],
"scripts": {
"build": "npm run build:lib && npm run build:app",
"build": "npm run build:lib && npm run build:app && npm run build:embed",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only issue here is line 27 - fails on Windows.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solved by using cross-env

"build:app": "webpack --progress --config webpack/app",
"build:lib": "webpack --progress --config webpack/libraries",
"build:embed": "EMBED=1 node webpack/embed",
Expand Down
11 changes: 8 additions & 3 deletions js/src/embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { patchApi } from '@parity/shared/util/tx';

import SecureApi from './secureApi';

import './ShellExtend';
import '@parity/shared/environment';
import '@parity/shared/assets/fonts/Roboto/font.css';
import '@parity/shared/assets/fonts/RobotoMono/font.css';
Expand Down Expand Up @@ -70,8 +71,6 @@ class FrameSecureApi extends SecureApi {
connect () {
// Do nothing - this API does not need connecting
this.emit('connecting');
// Fetch settings
this._fetchSettings();
// Fire connected event with some delay.
setTimeout(() => {
this.emit('connected');
Expand Down Expand Up @@ -99,7 +98,7 @@ transport.uiUrl = uiUrl.replace('http://', '').replace('https://', '');
const api = new FrameSecureApi(transport);

patchApi(api);
ContractInstances.create(api);
ContractInstances.get(api);

const store = initStore(api, null, true);

Expand All @@ -125,3 +124,9 @@ ReactDOM.render(
</AppContainer>,
container
);

// testing, signer plugins
import '@parity/plugin-signer-account';
import '@parity/plugin-signer-default';
import '@parity/plugin-signer-hardware';
import '@parity/plugin-signer-qr';
4 changes: 2 additions & 2 deletions js/webpack/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const isProd = ENV === 'production';
const isEmbed = EMBED === '1' || EMBED === 'true';

const entry = isEmbed
? { embed: './embed.js' }
? { embed: ['babel-polyfill', './embed.js'] }
: { bundle: ['babel-polyfill', './index.parity.js'] };

module.exports = {
Expand Down Expand Up @@ -238,7 +238,7 @@ module.exports = {
new HtmlWebpackPlugin({
title: 'Parity Bar',
filename: 'embed.html',
template: './index.ejs',
template: './index.parity.ejs',
favicon: FAVICON,
chunks: ['embed']
})
Expand Down