Skip to content

Commit

Permalink
Release: 0.5.4 (#547)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
8 people authored Aug 25, 2022
1 parent b13b2ca commit 7ab980e
Show file tree
Hide file tree
Showing 333 changed files with 1,672 additions and 1,534 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ module.exports = {
'import/resolver': {
alias: {
map: [
['@ui', './source/ui'],
['@components', './source/components'],
['@modules', './source/Modules'],
['@assets', './source/assets'],
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ public/

## Build directory
extension/
!source/views/Extension
!source/views/Extension/*
!source/views/Extension/**
dist/
.awcache

Expand Down
1 change: 0 additions & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ module.exports = {
];

config.resolve.alias = {
"@ui": path.join(path.resolve(__dirname, "../source/ui")),
"@components": path.join(path.resolve(__dirname, "../source/components")),
"@assets": path.join(path.resolve(__dirname, "../source/assets")),
"@shared": path.join(path.resolve(__dirname, "../source/shared")),
Expand Down
6 changes: 2 additions & 4 deletions jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@ui": ["source/ui"],
"@ui/*": ["source/ui/*"],
"@components": ["source/components"],
"@components/*": ["source/components/*"],
"@assets": ["source/assets"],
Expand All @@ -14,8 +12,8 @@
"@hooks/*": ["source/hooks/*"],
"@redux": ["source/redux"],
"@redux/*": ["source/redux/*"],
"@background": ["source/Background"],
"@background/*": ["source/Background/*"],
"@background": ["source/background"],
"@background/*": ["source/background/*"],
"@modules/*": ["source/Modules/*"]
}
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plug",
"version": "0.5.3",
"version": "0.5.4",
"description": "Your plug into the Internet Computer",
"private": true,
"repository": "https://github.com/Psychedelic/plug",
Expand Down Expand Up @@ -38,7 +38,7 @@
"@metamask/post-message-stream": "^4.0.0",
"@psychedelic/browser-rpc": "2.1.0",
"@psychedelic/dab-js": "1.4.5",
"@psychedelic/plug-controller": "0.19.7",
"@psychedelic/plug-controller": "0.19.8",
"@psychedelic/plug-inpage-provider": "^2.3.0",
"@reduxjs/toolkit": "^1.6.0",
"advanced-css-reset": "^1.2.2",
Expand Down
2 changes: 1 addition & 1 deletion source/Background/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import {
ConnectionModule,
TransactionModule,
InformationModule,
NotificationManager,
} from '@modules';

import NotificationManager from '../lib/NotificationManager';
import {
getKeyringHandler,
HANDLER_TYPES,
Expand Down
3 changes: 2 additions & 1 deletion source/Background/utils.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import PlugController from '@psychedelic/plug-controller';

import { validateCanisterId, validatePrincipalId, validateAccountId } from '@shared/utils/ids';
Expand Down Expand Up @@ -183,7 +184,7 @@ export const handleCallRequest = async ({
if (redirected) callback(null, true);
return true;
} catch (e) {
console.log('Error when executing update transaction', e);
console.warn('Error when executing update transaction', e);
callback(ERRORS.SERVER_ERROR(e), null, [{ portId, callId }]);
if (redirected) callback(null, false);
return false;
Expand Down
14 changes: 10 additions & 4 deletions source/Modules/Controller/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import {
getApp,
removeApp,
} from '../storageManager';
import SIZES from '../../Pages/Notification/components/Transfer/constants';
import SIZES from '../../views/Popup/components/Transfer/constants';

import { ControllerModuleBase } from './controllerBase';

export class ConnectionModule extends ControllerModuleBase {
Expand Down Expand Up @@ -130,6 +131,11 @@ export class ConnectionModule extends ControllerModuleBase {

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

const populatedWhitelist = canistersInfo.reduce(
(accum, canisterInfo) => ({ ...accum, [canisterInfo.id]: canisterInfo }),
{},
);

getApps(this.keyring?.currentWalletId.toString(), (apps = {}) => {
const newApps = {
...apps,
Expand All @@ -143,7 +149,7 @@ export class ConnectionModule extends ControllerModuleBase {
events: [
...apps[domainUrl]?.events || [],
],
whitelist,
whitelist: populatedWhitelist,
host,
},
};
Expand Down Expand Up @@ -208,7 +214,7 @@ export class ConnectionModule extends ControllerModuleBase {
? CONNECTION_STATUS.accepted
: response.status;
const whitelist = response.status === CONNECTION_STATUS.accepted
? response.whitelist
? apps[url]?.whitelist
: [];

const date = new Date().toISOString();
Expand All @@ -219,7 +225,7 @@ export class ConnectionModule extends ControllerModuleBase {
...apps[url],
status: status || CONNECTION_STATUS.rejected,
date,
whitelist,
whitelist: { ...apps[url]?.whitelist, ...whitelist },
events: [
...apps[url]?.events || [],
{
Expand Down
2 changes: 1 addition & 1 deletion source/Modules/Controller/controllerBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import extension from 'extensionizer';

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

export class ControllerModuleBase {
constructor(backgroundController, secureController, keyring) {
Expand Down
5 changes: 3 additions & 2 deletions source/Modules/Controller/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import { XTC_FEE } from '@shared/constants/addresses';
import { getKeyringHandler, HANDLER_TYPES } from '@background/Keyring';
import { blobFromBuffer, blobToUint8Array } from '@dfinity/candid';

import SIZES from '../../Pages/Notification/components/Transfer/constants';
import SIZES from '../../views/Popup/components/Transfer/constants';

import {
getBatchTransactions, getProtectedIds, setBatchTransactions, getApp,
} from '../storageManager';
Expand Down Expand Up @@ -136,7 +137,7 @@ export class TransactionModule extends ControllerModuleBase {
...transfer,
amount: parsedAmount,
canisterId: ICP_CANISTER_ID,
standard: 'icp',
standard: 'ROSETTA',
});

if (response.error) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import extension from 'extensionizer';

class NotificationManager {
export class NotificationManager {
constructor(image) {
this.iconUrl = image;
}
Expand Down
1 change: 1 addition & 0 deletions source/Modules/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export * from './storageManager';
export * from './Controller/connection';
export * from './Controller/transaction';
export * from './Controller/information';
export * from './NotificationManager';
Loading

0 comments on commit 7ab980e

Please sign in to comment.