Skip to content

Commit d9ae797

Browse files
authored
Merge pull request #1762 from wavesplatform/dexw-2340-dist-dl
DEXW-2340: add dist download link to warning plate on desktop
2 parents 3fb9a39 + ab27e6e commit d9ae797

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/modules/app/directives/componentWarningPlate/ComponentWarningPlate.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* @param {Storage} storage
1010
* @return {ComponentWarningPlate}
1111
*/
12-
const controller = function ($scope, modalManager, utils, user, storage) {
12+
const controller = function ($scope, modalManager, utils, user, storage, configService) {
1313

1414
class ComponentWarningPlate {
1515

@@ -37,6 +37,7 @@
3737
* @type {string}
3838
*/
3939
newDexLink = WavesApp.network.wavesExchangeLink;
40+
isDesktop = WavesApp.isDesktop();
4041

4142
constructor() {
4243
this._initCanMoveAccounts();
@@ -51,6 +52,8 @@
5152
user.logoutSignal.on(this._initCanMoveAccounts, this);
5253

5354
utils.startTimer({ year: 2019, month: 12, day: 2, hours: 15 }, this._setTime.bind(this), 1000);
55+
56+
this._getDistUrl();
5457
}
5558

5659
showMovingModal() {
@@ -102,14 +105,20 @@
102105
$scope.$apply();
103106
});
104107
}
108+
_getDistUrl() {
109+
configService.configReadyPromise.then(() => {
110+
const urls = configService.get('DESKTOP_URLS');
111+
this.distUrl = new URL(urls[WavesApp.platform]);
112+
});
113+
}
105114

106115
}
107116

108117
return new ComponentWarningPlate();
109118

110119
};
111120

112-
controller.$inject = ['$scope', 'modalManager', 'utils', 'user', 'storage'];
121+
controller.$inject = ['$scope', 'modalManager', 'utils', 'user', 'storage', 'configService'];
113122

114123
angular.module('app').component('wWarningPlate', {
115124
templateUrl: 'modules/app/directives/componentWarningPlate/componentWarningPlate.html',

src/modules/app/directives/componentWarningPlate/componentWarningPlate.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,6 @@
4141
<div class="warning-plate__text"><span w-i18n="warningPlate.dexMoves"></span><a target="_blank" rel="noopener noreferrer" href="{{::$ctrl.newDexLink}}">waves.exchange</a></div>
4242
</div>
4343

44+
<div ng-if="!$ctrl.canMoveAccounts && $ctrl.isDesktop" class="warning-plate__content warning-plate__content_no-user info" w-i18n-ns="app.utils">
45+
<div class="warning-plate__text"><a target="_blank" rel="noopener noreferrer" href="{{::$ctrl.distUrl}}">Download app</a></div>
46+
</div>

0 commit comments

Comments
 (0)