Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Commit

Permalink
fix: add cosmetics disclaimer
Browse files Browse the repository at this point in the history
  • Loading branch information
lennartkloock committed Oct 28, 2024
1 parent 4b2d23c commit 2aa4130
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/views/user/UserSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ import UserEntitlementModal from "./UserEntitlementModal.vue";
import UserCosmeticsUpdateModal from "./UserSettingsCosmeticsUpdateModal.vue";
import UserProfileSettings from "./UserSettingsProfile.vue";
import { useStore } from "../../store/main";
import ModalError from "../../components/modal/ModalError.vue";
import AnnotatedBadge from "../store/AnnotatedBadge.vue";
export interface FormType {
Expand Down Expand Up @@ -193,6 +194,18 @@ onCosmetics(async (res) => {
.filter((x) => x) as BadgeDef[];
cosmetics.paints = data?.paints ?? [];
if (cosmetics.badges.length === 0) {
useModal().open("ErrorModal", {
component: ModalError,
events: {},
props: {
error: "No Cosmetics",
detail: "Subscriber-only cosmetics, such as paints and badges, are only visible while you have an active subscription. These items aren't lost if your subscription expires — they'll simply become visible again when you resubscribe.",
code: 0,
},
});
}
form.selected_badge = res.data.user.cosmetics.filter((x) => x.kind === "BADGE").find((x) => x.selected)?.id ?? "";
form.selected_paint = res.data.user.cosmetics.filter((x) => x.kind === "PAINT").find((x) => x.selected)?.id ?? "";
});
Expand Down

0 comments on commit 2aa4130

Please sign in to comment.