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 feat/deskto-settings-view
Browse files Browse the repository at this point in the history
* develop: (141 commits)
  New Crowdin translations [ci skip] (#769)
  Mobile: Fix minor bugs (#771)
  Assign account index to accounts in state (#715)
  Mobile: Fix failing tests (#770)
  Desktop: Add two-factor authorisation to Password modal (#764)
  Localization improvements (#718)
  Mobile: Fix keyboard avoidance globally (#767)
  Mobile: Handle error if permissions are denied on SeedVault import (#719)
  New Crowdin translations [ci skip] (#667)
  Desktop: Delete yarn.lock (#768)
  Update Seed write down view `Done` locale to `Back` (#765)
  Mobile: Minor refactor
  Update src/mobile/android/gradlew.bat
  Mobile: Minor code cleanup
  Fix unresolved conflict
  Localise string
  Update src/mobile/src/ui/views/wallet/DeleteAccount.js
  Update src/mobile/src/ui/components/TransferConfirmationModal.js
  Preserve order of themes via indexes in ThemeCustomisation component (#763)
  [Security] Bump lodash from 4.17.4 to 4.17.10 (#723)
  ...

# Conflicts:
#	src/desktop/src/ui/views/account/Addresses.js
#	src/desktop/src/ui/views/settings/Advanced.js
#	src/desktop/src/ui/views/settings/account/Seed.js
  • Loading branch information
Rihards Gravis committed Dec 12, 2018
2 parents d0ba0da + dfb2631 commit c638b57
Show file tree
Hide file tree
Showing 252 changed files with 14,225 additions and 10,584 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.7.0",
"eslint-plugin-react-native": "^3.2.1",
"husky": "^1.1.3",
"husky": "^1.2.0",
"lint-staged": "^4.2.3",
"node-cmd": "^3.0.0",
"os": "^0.1.1",
"prettier": "^1.11.0",
"shared-modules": "./src/shared/"
},
"dependencies": {
"snyk": "^1.96.0"
"snyk": "^1.116.2"
},
"snyk": true
}
35 changes: 2 additions & 33 deletions src/desktop/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import path from 'path';
import URL from 'url';
import fs from 'fs';

import initMenu from './native/Menu.js';
import { initMenu, contextMenu } from './native/Menu.js';

/**
* Expose Garbage Collector flag for manual trigger after seed usage
Expand Down Expand Up @@ -210,40 +210,9 @@ function createWindow() {
* Add right click context menu for input elements
*/
windows.main.webContents.on('context-menu', (e, props) => {
const InputMenu = electron.Menu.buildFromTemplate([
{
label: 'Undo',
role: 'undo',
},
{
label: 'Redo',
role: 'redo',
},
{
type: 'separator',
},
{
label: 'Cut',
role: 'cut',
},
{
label: 'Copy',
role: 'copy',
},
{
label: 'Paste',
role: 'paste',
},
{
type: 'separator',
},
{
label: 'Select all',
role: 'selectall',
},
]);
const { isEditable } = props;
if (isEditable) {
const InputMenu = contextMenu();
InputMenu.popup(windows.main);
}
});
Expand Down
41 changes: 39 additions & 2 deletions src/desktop/native/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ autoUpdater.on('download-progress', (progressObj) => {
* @param {function} getWindow - Get Window instance helper
* @returns {undefined}
*/
const initMenu = (app, getWindowFunc) => {
export const initMenu = (app, getWindowFunc) => {
let mainMenu = null;
getWindow = getWindowFunc;

Expand Down Expand Up @@ -404,4 +404,41 @@ const initMenu = (app, getWindowFunc) => {
});
};

export default initMenu;
/**
* Creates context menu
* @returns {Menu} Context menu
*/
export const contextMenu = () => {
return Menu.buildFromTemplate([
{
label: language.undo,
role: 'undo',
},
{
label: language.redo,
role: 'redo',
},
{
type: 'separator',
},
{
label: language.cut,
role: 'cut',
},
{
label: language.copy,
role: 'copy',
},
{
label: language.paste,
role: 'paste',
},
{
type: 'separator',
},
{
label: language.selectAll,
role: 'selectall',
},
]);
};
2 changes: 1 addition & 1 deletion src/desktop/native/preload/Electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ let onboardingSeed = null;
let onboardingGenerated = false;

// Use a different keychain entry for development versions
const KEYTAR_SERVICE = process.env.NODE_ENV === 'development' ? 'Trinity wallet (dev)' : 'Trinity wallet';
const KEYTAR_SERVICE = remote.app.isPackaged ? 'Trinity wallet' : 'Trinity wallet (dev)';

/**
* Global Electron helper for native support
Expand Down
Loading

0 comments on commit c638b57

Please sign in to comment.