decord/source/stores/native/ShareStore.tsx

96 lines
3.5 KiB
TypeScript
Raw Normal View History

// Module ID: 14450
// Function ID: 14451
// Name: ShareStore
// Dependencies: [502, 1957, 1979, 2011, 4428, 1371, 1074, 1369, 8450, 1250, 1242, 504, 573, 2]
2026-07-20 16:05:17 +00:00
// Module 14450 (ShareStore)
import initializeDefault from "initialize" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 573 */;
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1242 */;
import discord_common_AnalyticsUtils from "discord_common/AnalyticsUtils" /* 1250 */;
import GlobalUtils from "GlobalUtils" /* 1369 */;
import NativeShareManagerModuleDefault from "NativeShareManagerModule" /* 8450 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
import ChannelStore from "ChannelStore" /* 1957 */;
import GuildStore from "GuildStore" /* 1979 */;
import SelectedChannelStore from "SelectedChannelStore" /* 2011 */;
import SelectedGuildStore from "SelectedGuildStore" /* 4428 */;
import UserStore from "UserStore" /* 1371 */;
2026-07-23 10:11:24 +00:00
require = fn;
2026-07-20 16:05:17 +00:00
function handleTokenUpdated(token) {
token = token.token;
return false;
}
const AppStates = fn(1074).AppStates;
2026-08-24 06:08:38 +00:00
const Store = initializeDefault.Store;
2026-07-29 08:29:29 +00:00
class ShareStore extends Store {
}
ShareStore.prototype["initialize"] = function initialize() {
this.waitFor(AuthenticationStore, ChannelStore, GuildStore, SelectedChannelStore, SelectedGuildStore, UserStore);
2026-07-29 08:29:29 +00:00
};
ShareStore.displayName = "ShareStore";
const shareStore = new ShareStore(DispatcherDefault, {
2026-07-20 16:05:17 +00:00
CHANNEL_SELECT: function handleChannelSelect(arg0) {
({ guildId: c3, channelId: c4 } = arg0);
2026-07-20 16:05:17 +00:00
return false;
},
LOGOUT: function handleLogout() {
NativeShareManagerModuleDefault.setSelectedChannel(null, null);
const obj2 = NativeShareManagerModuleDefault;
const result = obj2.setAuthenticationToken(null, AnalyticsUtilsDefault.getSuperPropertiesBase64());
2026-08-24 06:08:38 +00:00
c5 = null;
2026-07-20 16:05:17 +00:00
return false;
},
REGISTER_SUCCESS: handleTokenUpdated,
LOGIN_SUCCESS: handleTokenUpdated,
UPDATE_TOKEN: handleTokenUpdated,
START_SESSION: function handleStartSession() {
const token = AuthenticationStore.getToken();
2026-07-20 16:05:17 +00:00
return false;
},
APP_STATE_UPDATE: function handleAppStateUpdate(state) {
state = state.state;
if (state === AppStates.INACTIVE) {
2026-07-23 10:11:24 +00:00
if (null != c4) {
const guild = GuildStore.getGuild(c3);
2026-07-20 16:05:17 +00:00
let json = null;
if (null != guild) {
const _JSON = JSON;
json = JSON.stringify(guild);
}
const channel = ChannelStore.getChannel(SelectedChannelStore.getChannelId());
2026-07-20 16:05:17 +00:00
let json1 = null;
if (null != channel) {
const obj = {};
2026-07-20 16:05:17 +00:00
const merged = Object.assign(channel.toJS());
let recipients = channel.recipients;
2026-07-29 08:29:29 +00:00
if (recipients == null) {
2026-07-20 16:05:17 +00:00
recipients = [];
}
const mapped = recipients.map(UserStore.getUser);
obj.recipients = mapped.filter(GlobalUtils.isNotNullish);
2026-07-20 16:05:17 +00:00
json1 = JSON.stringify(obj);
}
NativeShareManagerModuleDefault.setSelectedChannel(json1, json);
2026-07-23 10:11:24 +00:00
c3 = null;
c4 = null;
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
if (null != c5) {
const obj2 = { client_app_state: state };
const result = discord_common_AnalyticsUtils.extendSuperProperties(obj2);
const obj6 = NativeShareManagerModuleDefault;
const result1 = obj6.setAuthenticationToken(c5, AnalyticsUtilsDefault.getSuperPropertiesBase64());
2026-07-20 16:05:17 +00:00
if (state === AppStates.INACTIVE) {
2026-07-23 10:11:24 +00:00
c5 = null;
2026-07-20 16:05:17 +00:00
}
}
return false;
}
});
const size = fn(2);
let result = size.fileFinishedImporting("stores/native/ShareStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default shareStore;