mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
feat(hourglass): Confirm before buy
This commit is contained in:
@@ -272,6 +272,12 @@ habitrpg.controller("InventoryCtrl",
|
||||
else return Console.log('Time Traveler item type must be in ["pets","mounts","mystery"]');
|
||||
};
|
||||
|
||||
$scope.clickTimeTravelItem = function(type,key) {
|
||||
if (user.purchased.plan.consecutive.trinkets < 1) return user.ops.hourglassPurchase({params:{type:type,key:key}});
|
||||
if (!window.confirm(window.env.t('hourglassBuyItemConfirm'))) return;
|
||||
user.ops.hourglassPurchase({params:{type:type,key:key}});
|
||||
};
|
||||
|
||||
function _updateDropAnimalCount(items) {
|
||||
$scope.petCount = Shared.count.beastMasterProgress(items.pets);
|
||||
$scope.mountCount = Shared.count.mountMasterProgress(items.mounts);
|
||||
|
||||
Reference in New Issue
Block a user