decord/source/modules/spoiler_channels/ChannelSpoilerAgreeStore.tsx
2026-08-12 06:57:52 +00:00

80 lines
2.2 KiB
TypeScript

// Module ID: 5986
// Function ID: 5987
// Name: initialize
// Dependencies: [1218, 589, 709, 2]
// Module 5986 (initialize)
import fetchFingerprint from "fetchFingerprint";
import { DeviceSettingsStore } from "initialize";
let closure_1 = { users: {} };
class ChannelSpoilerAgreeStore extends DeviceSettingsStore {
}
const prototype = ChannelSpoilerAgreeStore.prototype;
prototype["initialize"] = function initialize(users) {
this.waitFor(fetchFingerprint);
if (null != users) {
if (null != users.users) {
const obj = { users: null };
obj[0] = users.users;
}
let closure_1 = { users: {} };
}
};
prototype["didAgree"] = function didAgree(arg0) {
if (null == arg0) {
return false;
} else {
const id = store.getId();
let tmp3 = null != id;
if (tmp3) {
let flag;
if (closure_1.users[id] != null) {
flag = tmp5.channels[arg0];
}
if (!flag) {
flag = false;
}
tmp3 = flag;
}
return tmp3;
}
};
prototype["getState"] = function getState() {
return closure_1;
};
prototype["getUserAgnosticState"] = function getUserAgnosticState() {
return closure_1;
};
ChannelSpoilerAgreeStore.displayName = "ChannelSpoilerAgreeStore";
ChannelSpoilerAgreeStore.persistKey = "ChannelSpoilerAgreeStore";
const channelSpoilerAgreeStore = new ChannelSpoilerAgreeStore(require("dispatcher"), {
CHANNEL_SPOILER_AGREE: function handleChannelSpoilerAgree(channelId) {
const id = store.getId();
if (null == id) {
return false;
} else {
if (null == closure_1.users[id]) {
const obj = { channels: null };
obj[0] = {};
closure_1.users[id] = obj;
}
closure_1.users[id].channels[channelId.channelId] = true;
}
},
CHANNEL_SPOILER_AGREE_CLEAR: function handleChannelSpoilerAgreeClear(arg0) {
const id = store.getId();
let tmp4 = null != id;
if (tmp4) {
if (null != closure_1.users[id]) {
const channels = closure_1.users[id].channels;
delete tmp[tmp2];
}
tmp4 = tmp6;
}
return tmp4;
}
});
const result = require("dispatcher").fileFinishedImporting("modules/spoiler_channels/ChannelSpoilerAgreeStore.tsx");
export default channelSpoilerAgreeStore;