Skip to content
Snippets Groups Projects
Commit aa37011e authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[fix] Report Abuse on a Cs+ profile : Error "translationId must be a not empty string" - fix #913

parent 2406317d
No related branches found
No related tags found
No related merge requests found
Pipeline #8757 failed
......@@ -504,7 +504,7 @@ function AppController($scope, $rootScope, $state, $ionicSideMenuDelegate, $q, $
var skip = $scope.fullscreen || !UIUtils.screen.isSmall() || !Device.isWeb();
if (skip) return;
return UIUtils.alert.confirm('CONFIRM.FULLSCREEN', null, {
return UIUtils.alert.confirm('CONFIRM.FULLSCREEN', undefined, {
cancelText: 'COMMON.BTN_NO',
okText: 'COMMON.BTN_YES'
})
......
......@@ -70,12 +70,12 @@ angular.module('cesium.utils.services', ['angular-fullscreen-toggle'])
function alertInfo(message, subtitle) {
return $q(function(resolve) {
$translate([message, subtitle, 'INFO.POPUP_TITLE', 'COMMON.BTN_OK'])
$translate([message, 'INFO.POPUP_TITLE', 'COMMON.BTN_OK'].concat(subtitle ? [subtitle] : []))
.then(function (translations) {
$ionicPopup.show({
template: '<p>' + translations[message] + '</p>',
title: translations['INFO.POPUP_TITLE'],
subTitle: translations[subtitle],
subTitle: subtitle && translations[subtitle] || undefined,
buttons: [
{
text: translations['COMMON.BTN_OK'],
......
......@@ -112,6 +112,15 @@ function ESLikesController($scope, $q, $timeout, $translate, $ionicPopup, UIUtil
$scope.initLikes();
if (!$scope.likeData.id) throw new Error("Missing 'likeData.id' in scope. Cannot apply toggle");
// Make sure tobe auth before continue
if (!csWallet.isLogin()) {
return csWallet.auth({minData: true})
.then(function(){
UIUtils.loading.hide();
return $scope.reportAbuse(event, options); // loop
});
}
options = options || {};
options.kind = options.kind && options.kind.toUpperCase() || 'LIKE';
var key = options.kind.toLowerCase() + 's';
......@@ -124,14 +133,19 @@ function ESLikesController($scope, $q, $timeout, $translate, $ionicPopup, UIUtil
return $q.reject();
}
// Select the wallet, if many
if (!options.pubkey) {
return (csWallet.children.count() ? Modals.showSelectWallet({displayBalance: false}) : $q.when(csWallet))
.then(function(wallet) {
if (!wallet) throw 'CANCELLED';
options.pubkey = wallet.data.pubkey;
return $scope.toggleLike(event, options); // Loop
});
if (csWallet.children.count() === 0) {
options.pubkey = csWallet.data.pubkey
}
// Select the wallet, if many
else {
return Modals.showSelectWallet({displayBalance: false})
.then(function (wallet) {
if (!wallet) throw 'CANCELLED';
options.pubkey = wallet.data.pubkey;
return $scope.reportAbuse(event, options); // Loop
});
}
}
var wallet = csWallet.getByPubkey(options.pubkey);
......@@ -225,19 +239,34 @@ function ESLikesController($scope, $q, $timeout, $translate, $ionicPopup, UIUtil
};
$scope.reportAbuse = function(event, options) {
// Make sure tobe auth before continue
if (!csWallet.isLogin()) {
return csWallet.auth({minData: true})
.then(function(){
UIUtils.loading.hide();
return $scope.reportAbuse(event, options); // loop
});
}
if (!$scope.likeData || !$scope.likeData.abuses || $scope.likeData.abuses.wasHitCount) return; // skip
if ($scope.likeData.abuses.wasHitCount) return; // already report
options = options || {};
// Select the wallet, if many
if (!options.pubkey) {
return (csWallet.children.count() ? Modals.showSelectWallet({displayBalance: false}) : $q.when(csWallet))
.then(function(wallet) {
if (!wallet) throw 'CANCELLED';
options.pubkey = wallet.data.pubkey;
return $scope.reportAbuse(event, options); // Loop
});
if (csWallet.children.count() === 0) {
options.pubkey = csWallet.data.pubkey
}
// Select the wallet, if many
else {
return Modals.showSelectWallet({displayBalance: false})
.then(function (wallet) {
if (!wallet) throw 'CANCELLED';
options.pubkey = wallet.data.pubkey;
return $scope.reportAbuse(event, options); // Loop
});
}
}
var wallet = csWallet.getByPubkey(options.pubkey);
......
  • fdrubigny @fdrubigny ·

    Bonjour, 2 personnes différentes m'ont faites savoir qu'elles ont ce message d'erreur en voulant certifier un compte. C'est la première fois que je vois ce message, visiblement tu as travaillé dessus il y a un an mais que doivent faire ces personnes pour pallier à ce problème ?

    Amicalement, Francis

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment