@stackedapp/utils 2.14.0 → 2.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/conditions/handlers.js +24 -0
- package/package.json +1 -1
|
@@ -468,6 +468,30 @@ function evaluateStackedAccount(cond, ctx) {
|
|
|
468
468
|
});
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
|
+
if (cond.hasUsername !== undefined) {
|
|
472
|
+
const hasCustomUsername = ctx.additionalData?.hasCustomDisplayName ?? false;
|
|
473
|
+
const met = cond.hasUsername === hasCustomUsername;
|
|
474
|
+
if (!met)
|
|
475
|
+
isMet = false;
|
|
476
|
+
details.push({
|
|
477
|
+
isMet: met, kind: 'stackedAccount',
|
|
478
|
+
trackerAmount: hasCustomUsername ? 1 : 0, trackerGoal: 1,
|
|
479
|
+
percentCompleted: met ? 100 : 0,
|
|
480
|
+
text: cond.hasUsername ? 'Set a custom username' : 'Must not have a custom username',
|
|
481
|
+
});
|
|
482
|
+
}
|
|
483
|
+
if (cond.hasProfilePic !== undefined) {
|
|
484
|
+
const hasCustomPic = ctx.additionalData?.hasCustomProfileImage ?? false;
|
|
485
|
+
const met = cond.hasProfilePic === hasCustomPic;
|
|
486
|
+
if (!met)
|
|
487
|
+
isMet = false;
|
|
488
|
+
details.push({
|
|
489
|
+
isMet: met, kind: 'stackedAccount',
|
|
490
|
+
trackerAmount: hasCustomPic ? 1 : 0, trackerGoal: 1,
|
|
491
|
+
percentCompleted: met ? 100 : 0,
|
|
492
|
+
text: cond.hasProfilePic ? 'Set a custom profile picture' : 'Must not have a custom profile picture',
|
|
493
|
+
});
|
|
494
|
+
}
|
|
471
495
|
return { isMet, details };
|
|
472
496
|
}
|
|
473
497
|
function evaluateUserSettings(cond, ctx) {
|