-
+
diff --git a/src/modules/utils/services/Storage.js b/src/modules/utils/services/Storage.js
index 3bfab08cb2..2c5eb7f26d 100644
--- a/src/modules/utils/services/Storage.js
+++ b/src/modules/utils/services/Storage.js
@@ -27,7 +27,8 @@
return saveUsersWithUniqueName(storage)
.then(data => addNewGateway(data, WavesApp.defaultAssets.BNT));
},
- '1.4.0': storage => migrateCommonSettings(storage)
+ '1.4.0': storage => migrateCommonSettings(storage),
+ '1.4.6': storage => fixMigrateCommonSettings(storage)
};
function newTerms(storage) {
@@ -93,6 +94,84 @@
});
}
+ function fixSettings(user) {
+ const newDefaultSettings = defaultSettings.create();
+ const pinnedList = newDefaultSettings.get('pinnedAssetIdList');
+
+ if (!user || typeof user.settings !== 'object') {
+ return {};
+ }
+
+ const settings = { ...user.settings };
+
+ if (settings.pinnedAssetIdList && settings.pinnedAssetIdList.length) {
+ const list = [ ...settings.pinnedAssetIdList ];
+
+ for (let assetIndex = list.length; assetIndex--; ) {
+ if (list[assetIndex] == null) {
+ list[assetIndex] = pinnedList[assetIndex];
+ }
+ }
+
+ settings.pinnedAssetIdList = list;
+ }
+
+ if (settings.dex && settings.dex.watchlist && settings.dex.watchlist.favourite) {
+ const dexSettings = { ... settings.dex };
+ dexSettings.watchlist = { ...dexSettings.watchlist };
+
+ if (!Array.isArray(dexSettings.watchlist.favourite)) {
+ dexSettings.watchlist.favourite = [];
+ }
+
+ const favourite = dexSettings.watchlist.favourite
+ .map(pair => {
+ if (!pair || pair.length === 0) {
+ return null;
+ }
+
+ if (!pair[0] || !pair[1]) {
+ return null;
+ }
+
+ return pair;
+ })
+ .filter(Boolean);
+
+ dexSettings.watchlist.favourite = favourite;
+ settings.dex = dexSettings;
+ }
+
+ return settings;
+ }
+
+ function fixMigrateCommonSettings(storage) {
+ return Promise.all([storage.load('userList'), storage.load('multiAccountUsers')]).then(([userList, multiAccountUsers]) => {
+ try {
+ if (userList && userList.length) {
+ userList = userList.map(user => ({ ...user, settings: fixSettings(user) }));
+ }
+
+ if (multiAccountUsers && typeof multiAccountUsers === 'object') {
+ const users = Object.entries(multiAccountUsers);
+ multiAccountUsers = users.reduce((acc, [key, user]) => {
+ user = { ...user, settings: fixSettings(user) };
+ acc[key] = user;
+ return acc;
+ }, Object.create(null));
+ }
+ } catch (e) {
+
+ }
+
+ return Promise.all([
+ storage.save('multiAccountUsers', multiAccountUsers),
+ storage.save('userList', userList)
+ ]);
+
+ });
+ }
+
function migrateCommonSettings(storage) {
return storage.load('userList').then(userList => {
const commonSettings = defaultSettings.create();
diff --git a/src/modules/utils/services/gateways/CoinomatService.js b/src/modules/utils/services/gateways/CoinomatService.js
index 994ed98c7b..30c850b49f 100644
--- a/src/modules/utils/services/gateways/CoinomatService.js
+++ b/src/modules/utils/services/gateways/CoinomatService.js
@@ -91,7 +91,7 @@
getSupportMap(asset) {
if (GATEWAYS[asset.id]) {
return {
- deposit: true,
+ deposit: asset.id !== WavesApp.defaultAssets.BTC,
withdraw: true,
errorAddressMessage: true
};
diff --git a/src/modules/utils/services/gateways/WavesGatewayService.js b/src/modules/utils/services/gateways/WavesGatewayService.js
index b57bd07a6d..cfdf22d2d4 100644
--- a/src/modules/utils/services/gateways/WavesGatewayService.js
+++ b/src/modules/utils/services/gateways/WavesGatewayService.js
@@ -5,7 +5,8 @@
[WavesApp.defaultAssets.VST]: { waves: 'WVST', gateway: 'VST' },
[WavesApp.defaultAssets.ERGO]: { waves: 'WERGO', gateway: 'ERGO' },
[WavesApp.defaultAssets.BNT]: { waves: 'WBNT', gateway: 'BNT' },
- [WavesApp.defaultAssets.ETH]: { waves: 'ETH', gateway: 'ETH' }
+ [WavesApp.defaultAssets.ETH]: { waves: 'ETH', gateway: 'ETH' },
+ [WavesApp.defaultAssets.BTC]: { waves: 'WBTC', gateway: 'BTC' }
};
const PATH = `${WavesApp.network.wavesGateway}/api/v1`;
@@ -30,7 +31,7 @@
if (GATEWAYS[asset.id]) {
return {
deposit: true,
- withdraw: true,
+ withdraw: asset.id !== WavesApp.defaultAssets.BTC,
errorAddressMessage: true,
wrongAddressMessage: true
};
diff --git a/src/modules/utils/services/whatsNew.js b/src/modules/utils/services/whatsNew.js
index e40e4e3b7d..2d8e3aec02 100644
--- a/src/modules/utils/services/whatsNew.js
+++ b/src/modules/utils/services/whatsNew.js
@@ -82,6 +82,8 @@
}
function handleLogin() {
+ notification.destroyAll();
+
const notShownUpdates = user.getSetting('whatsNewList')
.filter(version => {
if (migration.gt(version, WavesApp.version)) {
diff --git a/src/modules/wallet/modules/assets/directives/asset/Asset.js b/src/modules/wallet/modules/assets/directives/asset/Asset.js
index 9c69425a63..c203fb941a 100644
--- a/src/modules/wallet/modules/assets/directives/asset/Asset.js
+++ b/src/modules/wallet/modules/assets/directives/asset/Asset.js
@@ -25,7 +25,9 @@
this.isVerified = isVerified;
this.isGateway = isGateway;
this.isTokenomica = isTokenomica;
- createPoll(this, this._getTokenRating, this._setTokenRating, 60 * 1000);
+ if (!this.isGateway) {
+ createPoll(this, this._getTokenRating, this._setTokenRating, 60 * 1000);
+ }
}
isUnpinned() {
@@ -39,7 +41,7 @@
}
_setTokenRating(assetList) {
- if (!assetList || !assetList[0]) {
+ if (!assetList || assetList.length === 0) {
return null;
}
diff --git a/src/modules/wallet/modules/portfolio/directives/portfolioRow/PortfolioRow.js b/src/modules/wallet/modules/portfolio/directives/portfolioRow/PortfolioRow.js
index cb8a754afa..f6b3563089 100644
--- a/src/modules/wallet/modules/portfolio/directives/portfolioRow/PortfolioRow.js
+++ b/src/modules/wallet/modules/portfolio/directives/portfolioRow/PortfolioRow.js
@@ -190,7 +190,7 @@
} = utils.getDataFromOracles(this.balance.asset.id);
this.isVST = this.balance.asset.id === WavesApp.defaultAssets.VST;
-
+ this.isGateway = isGateway;
this.isVerifiedOrGateway = isVerified || isGateway;
const html = template({
@@ -361,7 +361,9 @@
);
}).catch(() => null);
- if (typeof balance.rating === 'number') {
+ const hasRate = balance.rating !== null;
+
+ if (hasRate && !this.isGateway && balance.asset.id !== WavesApp.defaultAssets.WAVES) {
new RatingStarsFactory({
$container: this.$node.find(`.${SELECTORS.STARS_CONTAINER}`),
rating: balance.rating,
diff --git a/ts-scripts/utils.ts b/ts-scripts/utils.ts
index 9015e92f15..e163189ff7 100644
--- a/ts-scripts/utils.ts
+++ b/ts-scripts/utils.ts
@@ -476,6 +476,26 @@ export async function getInitScript(
}
};
+
+ config.platform = function() {
+ const userAgent = navigator.userAgent;
+ const platform = navigator.platform;
+ const macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'];
+ const windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'];
+ const iosPlatforms = ['iPhone', 'iPad', 'iPod'];
+
+ switch (true) {
+ case (macosPlatforms.indexOf(platform) !== -1): return 'mac';
+ case (iosPlatforms.indexOf(platform) !== -1): return 'ios';
+ case (windowsPlatforms.indexOf(platform) !== -1): return 'win';
+ case (/Android/.test(userAgent)): return 'android';
+ case (/Linux/.test(platform)): return 'linux';
+ default: return 'linux';
+ }
+ };
+
+ config.electronVersion = config.isDesktop() ? navigator.userAgent.replace(/.*?waves-(client|dex)\/(\d+\.\d+\.\d+).*/g, '$2') : '';
+
config.remappedAssetNames = {};
config.remappedAssetNames[config.network.assets.EUR] = 'Euro';
config.remappedAssetNames[config.network.assets.USD] = 'US Dollar';