Skip to content

Commit

Permalink
Merge branch 'hotfix/2.22.1' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Lakeyzer committed Mar 1, 2024
2 parents 54fc5d9 + 1e08fab commit c50e722
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.22.0",
"version": "2.22.1",
"name": "harmless_key",
"description": "A Dungeons and Dragons Combat Tracker",
"productName": "Harmless Key",
Expand Down
11 changes: 7 additions & 4 deletions src/store/modules/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const user_actions = {
let tier_id = patron_tierlist[i];
// SMART AWAIT ASYNC CONSTRUCTION #bless Key
await tiers_ref.child(tier_id).once("value", (tier_snapshot) => {
let tier_order = tier_snapshot.val().order;
let tier_order = tier_snapshot.val()?.order || 0;
if (tier_order > highest_order) {
highest_order = tier_order;
highest_tier = tier_id;
Expand All @@ -179,15 +179,18 @@ const user_actions = {
//Get tier info
let patron_tier = db.ref(`tiers/${highest_tier}`);
patron_tier.on("value", (tier_snapshot) => {
const tier = tier_snapshot.val();
const tier_order = tier?.order || 0;
const tier_name = tier?.name || "basic";
//Save Patron info under UserInfo
user_info.patron = {
last_charge_status: patron_data.last_charge_status,
pledge_end,
tier: tier_snapshot.val().name,
tier: tier_name,
};

if (tier_snapshot.val().order >= voucher_order && pledge_end >= server_time) {
commit("SET_TIER", tier_snapshot.val());
if (tier_order >= voucher_order && pledge_end >= server_time) {
commit("SET_TIER", tier);
} else {
commit("SET_TIER", voucher_snap.val());
}
Expand Down

0 comments on commit c50e722

Please sign in to comment.