decord/source/modules/push_feedback/PushFeedbackStore.tsx
github-actions 777dc50a28 chore: update source for alpha 346.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4790.js (118.4 MB)
2026-09-10 19:12:31 +00:00

111 lines
3.4 KiB
TypeScript

// Module ID: 11500
// Function ID: 11501
// Name: PushFeedbackStore
// Dependencies: [6646, 504, 573, 2]
// Module 11500 (PushFeedbackStore)
import initializeDefault from "initialize" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 573 */;
import PushNotificationConstants from "PushNotificationConstants" /* 6646 */;
import size from "module_2" /* 2 */;
const NotificationTypes = PushNotificationConstants.NotificationTypes;
let c1 = null;
let pushFeedbackMap = {};
const PersistedStore = initializeDefault.PersistedStore;
class PushFeedbackStore extends PersistedStore {
}
const prototype = PushFeedbackStore.prototype;
prototype["initialize"] = function initialize(pushFeedback) {
if (null != pushFeedback) {
pushFeedback = pushFeedback.pushFeedback;
if (null != pushFeedback.pushFeedbackMap) {
pushFeedbackMap = pushFeedback.pushFeedbackMap;
}
}
};
prototype["getState"] = function getState() {
return { pushFeedback, pushFeedbackMap };
};
prototype["isEligible"] = function isEligible() {
return null != c1;
};
prototype["isUserPushMessage"] = function isUserPushMessage(arg0) {
let messageId;
if (pushFeedback != null) {
messageId = pushFeedback.messageId;
}
return messageId === arg0;
};
prototype["getPushFeedback"] = function getPushFeedback(channel_id, id) {
let messageId;
if (pushFeedback != null) {
messageId = pushFeedback.messageId;
}
let tmp2 = null;
if (messageId === id) {
tmp2 = null;
if (pushFeedback.channelId === channel_id) {
tmp2 = pushFeedback;
}
}
return tmp2;
};
PushFeedbackStore.displayName = "PushFeedbackStore";
PushFeedbackStore.persistKey = "PushFeedbackPersistedStore";
const pushFeedbackStore = new PushFeedbackStore(DispatcherDefault, {
PUSH_FEEDBACK_RECEIVED_NOTIFICATION: function handleReceivedNotification(arg0) {
({ notificationType, messageId, channelId } = arg0);
if (NotificationTypes.TOP_MESSAGE_PUSH === notificationType) {
let flag = true;
} else {
flag = false;
}
if (flag) {
let tmp3 = pushFeedbackMap[notificationType];
if (tmp3 == null) {
const obj = { messageId, channelId, pushType: notificationType };
tmp3 = obj;
}
let userViewInfo = tmp3.userViewInfo;
if (userViewInfo == null) {
userViewInfo = { eligibleAt: 0, viewCount: 0 };
}
({ eligibleAt, viewCount } = userViewInfo);
const _Date = Date;
let timestamp = Date.now();
if (eligibleAt < timestamp) {
eligibleAt = timestamp + 604800000;
let num2 = 1;
} else if (viewCount >= 10) {
if (null != null) {
const obj2 = { messageId, channelId, pushType: notificationType, userViewInfo: null };
c1 = obj2;
pushFeedbackMap[notificationType] = obj2;
} else {
c1 = null;
}
} else {
num2 = viewCount + 1;
}
timestamp = { eligibleAt, viewCount: num2 };
}
},
PUSH_FEEDBACK_CLEANUP: function handleCleanup() {
c1 = null;
},
CHANNEL_SELECT: function handleChannelSelect(channelId) {
channelId = channelId.channelId;
if (null != channelId) {
if (null != pushFeedback) {
if (channelId !== pushFeedback.channelId) {
pushFeedback = null;
}
}
}
return false;
}
});
const result = size.fileFinishedImporting("modules/push_feedback/PushFeedbackStore.tsx");
export default pushFeedbackStore;