Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

Commit

Permalink
Merge branch 'develop' into window-7
Browse files Browse the repository at this point in the history
* develop: (34 commits)
  Bump dart-sass from 1.20.3 to 1.21.0 in /src/desktop (#1725)
  Bump electron from 3.1.10 to 3.1.11 in /src/desktop (#1720)
  Bump url-loader from 1.1.2 to 2.0.0 in /src/desktop (#1714)
  Bump file-loader from 3.0.1 to 4.0.0 in /src/desktop (#1715)
  Bump i18next from 17.0.1 to 17.0.2 in /src/desktop (#1722)
  Bump @jest-runner/electron from 2.0.0 to 2.0.1 in /src/desktop (#1713)
  New Crowdin translations (#1680)
  Bump husky from 2.3.0 to 2.4.0 (#1717)
  Bump snyk from 1.171.1 to 1.173.1 (#1716)
  Update action logic on full account info fetch error (#1688)
  Bump electron-builder from 20.41.0 to 20.43.0 in /src/desktop (#1708)
  Bump react-router-dom from 5.0.0 to 5.0.1 in /src/desktop (#1710)
  Bump webpack from 4.32.2 to 4.33.0 in /src/desktop (#1709)
  Bump i18next from 16.0.0 to 17.0.1 in /src/desktop (#1711)
  Desktop: Update wallet language on initial load (#1704)
  Desktop: Auto update functionality updates (#1705)
  Fix location reload on wallet reset (#1687)
  Bump i18next from 15.1.3 to 16.0.0 in /src/desktop (#1696)
  Bump @ledgerhq/hw-transport-node-hid from 4.60.3 to 4.61.1 in /src/desktop (#1702)
  Bump enzyme from 3.9.0 to 3.10.0 in /src/desktop (#1697)
  ...

# Conflicts:
#	src/desktop/src/index.js
#	src/desktop/src/ui/Index.js
#	src/desktop/src/ui/views/onboarding/SeedIntro.js
#	src/desktop/src/ui/views/onboarding/seedStore/Ledger.js
#	src/desktop/src/ui/views/settings/Advanced.js
  • Loading branch information
rihardsgravis committed Jun 7, 2019
2 parents d3f2474 + 45551bd commit 6f8a4e2
Show file tree
Hide file tree
Showing 104 changed files with 1,183 additions and 1,061 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.13.0",
"eslint-plugin-react-native": "^3.7.0",
"husky": "^2.3.0",
"husky": "^2.4.0",
"lint-staged": "^8.1.7",
"prettier": "^1.17.1"
},
"dependencies": {
"snyk": "^1.170.0"
"snyk": "^1.173.1"
},
"resolutions": {
"request": ">=2.88.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ exports[`Seed input component Render the component 1`] = `
Foo
</small>
</fieldset>
<Connect(WithMergedOptions(Dropzone))
<Connect(withI18nextTranslation(Dropzone))
onDrop={[Function]}
onTextDrop={[Function]}
/>
Expand Down
14 changes: 14 additions & 0 deletions src/desktop/__tests__/ui/global/alerts.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ const props = {

global.Electron = {
getOS: () => {},
onEvent: function(_event, e) {
this.updateEvent = e;
},
removeEvent: () => {},
updateEvent: null,
};

describe('Alerts component', () => {
Expand Down Expand Up @@ -61,4 +66,13 @@ describe('Alerts component', () => {
expect(wrapper.find('.update')).toHaveLength(1);
expect(wrapper.find('strong').text()).toEqual('global:shouldUpdate');
});

test('Hide update banner if update in progress', () => {
const mockProps = Object.assign({}, props, { forceUpdate: true, shouldUpdate: true });
const wrapper = shallow(<Alerts {...mockProps} />);

Electron.updateEvent({ percent: 99 });

expect(wrapper.find('.update')).toHaveLength(0);
});
});
10 changes: 6 additions & 4 deletions src/desktop/native/libs/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ let language = {
no: 'No',
updates: {
errorRetrievingUpdateData: 'Error retrieving update data',
errorRetrievingUpdateDataExplanation:
'Could not retrieve update. Please check your internet connection and try again.',
noUpdatesAvailable: 'No updates available',
noUpdatesAvailableExplanation: 'You have the latest version of Trinity!',
newVersionAvailable: 'New version available',
Expand All @@ -63,14 +65,14 @@ autoUpdater.autoDownload = false;
/**
* On update error event callback
*/
autoUpdater.on('error', (error) => {
autoUpdater.on('error', () => {
const mainWindow = getWindow('main');
if (mainWindow) {
mainWindow.webContents.send('update.progress', false);
}
dialog.showErrorBox(
language.updates.errorRetrievingUpdateData,
error === null ? 'unknown' : (error.stack || error).toString(),
language.updates.errorRetrievingUpdateDataExplanation,
);
});

Expand Down Expand Up @@ -118,12 +120,12 @@ autoUpdater.on('update-downloaded', () => {
message: language.updates.installUpdateExplanation,
},
() => {
setImmediate(() => {
setTimeout(() => {
const mainWindow = getWindow('main');
mainWindow.removeAllListeners('close');
app.removeAllListeners('window-all-closed');
autoUpdater.quitAndInstall();
});
}, 0);
},
);
});
Expand Down
9 changes: 9 additions & 0 deletions src/desktop/native/preload/Electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,14 @@ const Electron = {
}
},

/**
* Reload Wallet window to initial location
* @returns {undefined}
*/
reload: () => {
remote.getCurrentWindow().webContents.goToIndex(0);
},

/**
* Focus main wallet window
* @param {string} view - optional view to navigate to
Expand Down Expand Up @@ -582,6 +590,7 @@ const Electron = {
no: t('no'),
updates: {
errorRetrievingUpdateData: t('updates:errorRetrievingUpdateData'),
errorRetrievingUpdateDataExplanation: t('updates:errorRetrievingUpdateDataExplanation'),
noUpdatesAvailable: t('updates:noUpdatesAvailable'),
noUpdatesAvailableExplanation: t('updates:noUpdatesAvailableExplanation'),
newVersionAvailable: t('updates:newVersionAvailable'),
Expand Down
Loading

0 comments on commit 6f8a4e2

Please sign in to comment.