Skip to content

Commit 68def8f

Browse files
authored
Merge pull request #31 from BuildFire/refactor-app-link
fix(link): replace cpDomain with appPwaHost
2 parents 8c5e346 + ece5680 commit 68def8f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

widget/index.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
</div>
4646
<script>
4747
var sharePluginApp = angular.module('sharePlugin', []);
48-
var shareUrl = 'http://[appHost]/api/promoProxy/[appId]/';
4948
sharePluginApp.controller('sharePluginCtrl', ['$scope', '$sce', function ($scope, $sce) {
5049
var view = null;
5150

@@ -68,8 +67,12 @@
6867
console.log(err);
6968
}
7069
else {
71-
$scope.shareUrl = shareUrl.replace('[appHost]', context.cpDomain).replace('[appId]', context.appId);
72-
// Generate QR Code using qrcodejs library
70+
if(context.appPwaHost && context.appName) {
71+
$scope.shareUrl = `${context.appPwaHost}/promo/${encodeURIComponent(context.appName)}`;
72+
}
73+
else {
74+
$scope.shareUrl = `${context.wlAppHost}/api/promoProxy/${context.appId}`;
75+
}
7376
const qrcode = new QRCode("qrcodeContainer", {
7477
text: $scope.shareUrl,
7578
width: 170,

0 commit comments

Comments
 (0)