Skip to content

Commit 7ab980e

Browse files
rocky-fleekCancuuumaksym-boytsovtomiirangarita-dev
authored
Release: 0.5.4 (#547)
* it returns to the page to show the error code and desc * show the errors depends the code * it returns the emoji but we need to define and tests the other possible errors * added translation - redux function for match the errors - moved emojiError object * removed comments and clgs * added standard in redux/send * merge conflicts solved * fix: refresh button logic / disabled state and animation * Fixed token standard in handleRequestTransfer (#541) Co-authored-by: rocky-fleek <[email protected]> * Chore/fe structure (#546) * renamed Background folder * Deleted @ui folder and moved it to @components * Removed lib folder * Created scripts folder * Created views folder * fix: dont ovewritte whitelist in case is another one present (#523) * Revert "Chore/fe structure (#546)" (#548) This reverts commit 1a55622. Seems there was a merge error and the `Popup/Views` was deleted * Replaced extension 32x32 icon (#549) Co-authored-by: rocky-fleek <[email protected]> * Revert "Revert "Chore/fe structure (#546)" (#548)" (#550) This reverts commit 1fa4118. * details done * removed string and put into translation * updated manually npm * Chore/fe structure (#551) * renamed Background folder * Deleted @ui folder and moved it to @components * Removed lib folder * Created scripts folder * Created views folder * Specified extension folder on gitignore * added extension folder * Removed extension * Moved send flow files to new location * Fixed error matching * Fixed locales error * updated dependencies versions, but no npm * Fixed amount parsing for new ledger interface. refactored flow to use standard scoped parsing * Removed unnecessary object for icp/rosetta txs * Token selection logic / Tests fixes (#557) * chore: token selection logic / test fixes * chore: logs removed * Fixed transactionId and object proptypes * Auto fix with --fix * Fixed remaining issues * Updated controller to 0.19.8 and bumped plug version to 0.5.4 * Moved whitelist population to requestConnect * Removed whitelist population * fix: DIP20_AMOUNT_MAP * Fix/timeout on get balances (#572) * Fixed error parsing to take into account Error in amount field * Changed fetchAssets to take into account assets loading Co-authored-by: Cancu <[email protected]> Co-authored-by: Max ⚡️ <[email protected]> Co-authored-by: Cancu <[email protected]> Co-authored-by: tomiir <[email protected]> Co-authored-by: angarita-dev <[email protected]> Co-authored-by: Alejo Acevedo <[email protected]> Co-authored-by: Alina Sytnik <[email protected]>
1 parent b13b2ca commit 7ab980e

File tree

333 files changed

+1672
-1534
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

333 files changed

+1672
-1534
lines changed

.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ module.exports = {
4747
'import/resolver': {
4848
alias: {
4949
map: [
50-
['@ui', './source/ui'],
5150
['@components', './source/components'],
5251
['@modules', './source/Modules'],
5352
['@assets', './source/assets'],

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ public/
102102

103103
## Build directory
104104
extension/
105+
!source/views/Extension
106+
!source/views/Extension/*
107+
!source/views/Extension/**
105108
dist/
106109
.awcache
107110

.storybook/main.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ module.exports = {
2929
];
3030

3131
config.resolve.alias = {
32-
"@ui": path.join(path.resolve(__dirname, "../source/ui")),
3332
"@components": path.join(path.resolve(__dirname, "../source/components")),
3433
"@assets": path.join(path.resolve(__dirname, "../source/assets")),
3534
"@shared": path.join(path.resolve(__dirname, "../source/shared")),

jsconfig.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
"compilerOptions": {
33
"baseUrl": "./",
44
"paths": {
5-
"@ui": ["source/ui"],
6-
"@ui/*": ["source/ui/*"],
75
"@components": ["source/components"],
86
"@components/*": ["source/components/*"],
97
"@assets": ["source/assets"],
@@ -14,8 +12,8 @@
1412
"@hooks/*": ["source/hooks/*"],
1513
"@redux": ["source/redux"],
1614
"@redux/*": ["source/redux/*"],
17-
"@background": ["source/Background"],
18-
"@background/*": ["source/Background/*"],
15+
"@background": ["source/background"],
16+
"@background/*": ["source/background/*"],
1917
"@modules/*": ["source/Modules/*"]
2018
}
2119
},

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "plug",
3-
"version": "0.5.3",
3+
"version": "0.5.4",
44
"description": "Your plug into the Internet Computer",
55
"private": true,
66
"repository": "https://github.com/Psychedelic/plug",
@@ -38,7 +38,7 @@
3838
"@metamask/post-message-stream": "^4.0.0",
3939
"@psychedelic/browser-rpc": "2.1.0",
4040
"@psychedelic/dab-js": "1.4.5",
41-
"@psychedelic/plug-controller": "0.19.7",
41+
"@psychedelic/plug-controller": "0.19.8",
4242
"@psychedelic/plug-inpage-provider": "^2.3.0",
4343
"@reduxjs/toolkit": "^1.6.0",
4444
"advanced-css-reset": "^1.2.2",

source/Background/script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import {
66
ConnectionModule,
77
TransactionModule,
88
InformationModule,
9+
NotificationManager,
910
} from '@modules';
1011

11-
import NotificationManager from '../lib/NotificationManager';
1212
import {
1313
getKeyringHandler,
1414
HANDLER_TYPES,

source/Background/utils.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-console */
12
import PlugController from '@psychedelic/plug-controller';
23

34
import { validateCanisterId, validatePrincipalId, validateAccountId } from '@shared/utils/ids';
@@ -183,7 +184,7 @@ export const handleCallRequest = async ({
183184
if (redirected) callback(null, true);
184185
return true;
185186
} catch (e) {
186-
console.log('Error when executing update transaction', e);
187+
console.warn('Error when executing update transaction', e);
187188
callback(ERRORS.SERVER_ERROR(e), null, [{ portId, callId }]);
188189
if (redirected) callback(null, false);
189190
return false;

source/Modules/Controller/connection.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import {
99
getApp,
1010
removeApp,
1111
} from '../storageManager';
12-
import SIZES from '../../Pages/Notification/components/Transfer/constants';
12+
import SIZES from '../../views/Popup/components/Transfer/constants';
13+
1314
import { ControllerModuleBase } from './controllerBase';
1415

1516
export class ConnectionModule extends ControllerModuleBase {
@@ -130,6 +131,11 @@ export class ConnectionModule extends ControllerModuleBase {
130131

131132
const date = new Date().toISOString();
132133

134+
const populatedWhitelist = canistersInfo.reduce(
135+
(accum, canisterInfo) => ({ ...accum, [canisterInfo.id]: canisterInfo }),
136+
{},
137+
);
138+
133139
getApps(this.keyring?.currentWalletId.toString(), (apps = {}) => {
134140
const newApps = {
135141
...apps,
@@ -143,7 +149,7 @@ export class ConnectionModule extends ControllerModuleBase {
143149
events: [
144150
...apps[domainUrl]?.events || [],
145151
],
146-
whitelist,
152+
whitelist: populatedWhitelist,
147153
host,
148154
},
149155
};
@@ -208,7 +214,7 @@ export class ConnectionModule extends ControllerModuleBase {
208214
? CONNECTION_STATUS.accepted
209215
: response.status;
210216
const whitelist = response.status === CONNECTION_STATUS.accepted
211-
? response.whitelist
217+
? apps[url]?.whitelist
212218
: [];
213219

214220
const date = new Date().toISOString();
@@ -219,7 +225,7 @@ export class ConnectionModule extends ControllerModuleBase {
219225
...apps[url],
220226
status: status || CONNECTION_STATUS.rejected,
221227
date,
222-
whitelist,
228+
whitelist: { ...apps[url]?.whitelist, ...whitelist },
223229
events: [
224230
...apps[url]?.events || [],
225231
{

source/Modules/Controller/controllerBase.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import extension from 'extensionizer';
33

44
import { checkPendingTransaction, createPendingTransaction, removePendingTransaction } from '@modules/storageManager';
55
import ERRORS from '@background/errors';
6-
import SIZES from '../../Pages/Notification/components/Transfer/constants';
6+
import SIZES from '../../views/Popup/components/Transfer/constants';
77

88
export class ControllerModuleBase {
99
constructor(backgroundController, secureController, keyring) {

source/Modules/Controller/transaction.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ import { XTC_FEE } from '@shared/constants/addresses';
1818
import { getKeyringHandler, HANDLER_TYPES } from '@background/Keyring';
1919
import { blobFromBuffer, blobToUint8Array } from '@dfinity/candid';
2020

21-
import SIZES from '../../Pages/Notification/components/Transfer/constants';
21+
import SIZES from '../../views/Popup/components/Transfer/constants';
22+
2223
import {
2324
getBatchTransactions, getProtectedIds, setBatchTransactions, getApp,
2425
} from '../storageManager';
@@ -136,7 +137,7 @@ export class TransactionModule extends ControllerModuleBase {
136137
...transfer,
137138
amount: parsedAmount,
138139
canisterId: ICP_CANISTER_ID,
139-
standard: 'icp',
140+
standard: 'ROSETTA',
140141
});
141142

142143
if (response.error) {

0 commit comments

Comments
 (0)