decord/source/modules/push_feedback/PushFeedbackStore.tsx

122 lines
3.4 KiB
TypeScript
Raw Normal View History

2026-08-13 07:00:46 +00:00
// Module ID: 10371
// Function ID: 10372
2026-07-29 08:29:29 +00:00
// Name: initialize
2026-08-13 07:00:46 +00:00
// Dependencies: [5870, 589, 709, 2]
2026-07-23 10:11:24 +00:00
2026-08-13 07:00:46 +00:00
// Module 10371 (initialize)
2026-07-23 10:11:24 +00:00
import { NotificationTypes } from "str2";
2026-07-29 08:29:29 +00:00
import { PersistedStore } from "initialize";
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
let c1 = null;
let closure_2 = {};
class PushFeedbackStore extends PersistedStore {
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const prototype = PushFeedbackStore.prototype;
prototype["initialize"] = function initialize(pushFeedback) {
if (null != pushFeedback) {
pushFeedback = pushFeedback.pushFeedback;
if (null != pushFeedback.pushFeedbackMap) {
const pushFeedbackMap = pushFeedback.pushFeedbackMap;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
};
prototype["getState"] = function getState() {
return { pushFeedback: c1, pushFeedbackMap: closure_2 };
};
prototype["isEligible"] = function isEligible() {
return null != c1;
};
prototype["isUserPushMessage"] = function isUserPushMessage(arg0) {
let messageId;
if (_null != null) {
messageId = _null.messageId;
}
return messageId === arg0;
};
prototype["getPushFeedback"] = function getPushFeedback(channel_id, id) {
let messageId;
if (_null != null) {
messageId = _null.messageId;
}
let tmp2 = null;
if (messageId === id) {
tmp2 = null;
if (_null.channelId === channel_id) {
tmp2 = _null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
return tmp2;
};
PushFeedbackStore.displayName = "PushFeedbackStore";
PushFeedbackStore.persistKey = "PushFeedbackPersistedStore";
const pushFeedbackStore = new PushFeedbackStore(require("dispatcher"), {
2026-07-20 16:05:17 +00:00
PUSH_FEEDBACK_RECEIVED_NOTIFICATION: function handleReceivedNotification(arg0) {
let channelId;
let eligibleAt;
let messageId;
let notificationType;
let viewCount;
({ notificationType, messageId, channelId } = arg0);
if (NotificationTypes.TOP_MESSAGE_PUSH === notificationType) {
let flag = true;
} else {
flag = false;
}
if (flag) {
2026-07-23 10:11:24 +00:00
let tmp3 = table[notificationType];
2026-07-29 08:29:29 +00:00
if (tmp3 == null) {
let obj = { messageId: null, channelId: null, pushType: null };
obj[0] = messageId;
obj[1] = channelId;
obj[2] = notificationType;
2026-07-20 16:05:17 +00:00
tmp3 = obj;
}
let userViewInfo = tmp3.userViewInfo;
2026-07-29 08:29:29 +00:00
if (userViewInfo == null) {
2026-07-23 10:11:24 +00:00
userViewInfo = { eligibleAt: 0, viewCount: 0 };
2026-07-20 16:05:17 +00:00
}
({ eligibleAt, viewCount } = userViewInfo);
const _Date = Date;
2026-07-29 08:29:29 +00:00
let timestamp = Date.now();
2026-07-20 16:05:17 +00:00
if (eligibleAt < timestamp) {
eligibleAt = timestamp + 604800000;
let num2 = 1;
} else if (viewCount >= 10) {
if (null != null) {
2026-07-29 08:29:29 +00:00
obj = { messageId: null, channelId: null, pushType: null, userViewInfo: null };
obj[0] = messageId;
obj[1] = channelId;
obj[2] = notificationType;
obj[3] = null;
let c1 = obj;
2026-07-23 10:11:24 +00:00
table[notificationType] = obj;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
c1 = null;
2026-07-20 16:05:17 +00:00
}
} else {
num2 = viewCount + 1;
}
2026-07-29 08:29:29 +00:00
timestamp = { eligibleAt: null, viewCount: null };
timestamp[0] = eligibleAt;
timestamp[1] = num2;
2026-07-20 16:05:17 +00:00
}
},
PUSH_FEEDBACK_CLEANUP: function handleCleanup() {
2026-07-29 08:29:29 +00:00
let c1 = null;
2026-07-20 16:05:17 +00:00
},
CHANNEL_SELECT: function handleChannelSelect(channelId) {
channelId = channelId.channelId;
if (null != channelId) {
2026-07-23 10:11:24 +00:00
if (null != _null) {
if (channelId !== _null.channelId) {
_null = null;
2026-07-20 16:05:17 +00:00
}
}
}
return false;
}
});
2026-07-29 08:29:29 +00:00
const result = require("dispatcher").fileFinishedImporting("modules/push_feedback/PushFeedbackStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default pushFeedbackStore;