52 lines
1.5 KiB
TypeScript
52 lines
1.5 KiB
TypeScript
// Metro module 15858 (f15859).
|
|
import SnowflakeUtils from "../../utils/SnowflakeUtils";
|
|
import Module589 from "../../_bundle/Module589";
|
|
import Dispatcher from "../../Dispatcher";
|
|
let c11349_2 = new Set();
|
|
let autoEnroll = false;
|
|
c11349_2 = new Set();
|
|
autoEnroll = false;
|
|
class UnenrolledActivityQuestStore extends Module589.PersistedStore {
|
|
static displayName = "UnenrolledActivityQuestStore";
|
|
static persistKey = "UnenrolledActivityQuestStore";
|
|
initialize(a0) {
|
|
const r7 = Set;
|
|
let r10 = a0?.dismissedQuestIds;
|
|
if (r10 == null) {
|
|
r10 = [];
|
|
}
|
|
c11349_2 = new r7(r10);
|
|
let r14 = a0?.autoEnroll;
|
|
if (r14 == null) {
|
|
r14 = false;
|
|
}
|
|
autoEnroll = r14;
|
|
}
|
|
getState() {
|
|
return {
|
|
dismissedQuestIds: [...c11349_2],
|
|
autoEnroll
|
|
};
|
|
}
|
|
isDismissed(a0) {
|
|
return a0 != null && c11349_2.has(a0);
|
|
}
|
|
getDismissedQuestIds() {
|
|
return c11349_2;
|
|
}
|
|
}
|
|
const unenrolledActivityQuestStore = new UnenrolledActivityQuestStore(Dispatcher, {
|
|
UNENROLLED_ACTIVITY_QUEST_DISMISS: function handleDismissUnenrolledActivityQuest(a0) {
|
|
if (c11349_2.size >= 20) {
|
|
c11349_2 = new Set(Array.from(c11349_2).sort(SnowflakeUtils.compare).slice(Math.floor(10)).map((item) => item.toString()));
|
|
}
|
|
c11349_2.add(a0.questId);
|
|
return true;
|
|
},
|
|
UNENROLLED_ACTIVITY_QUEST_AUTO_ENROLL: function handleSetAutoEnroll(a0) {
|
|
autoEnroll = a0.autoEnroll;
|
|
return true;
|
|
}
|
|
});
|
|
export default unenrolledActivityQuestStore;
|