Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4825.js (118.4 MB)
95 lines
3.5 KiB
TypeScript
95 lines
3.5 KiB
TypeScript
// Module ID: 14519
|
|
// Function ID: 14520
|
|
// Name: ShareStore
|
|
// Dependencies: [502, 1958, 1980, 2012, 4461, 1372, 1074, 1370, 8511, 1249, 1241, 504, 573, 2]
|
|
|
|
// Module 14519 (ShareStore)
|
|
import initializeDefault from "initialize" /* 504 */;
|
|
import DispatcherDefault from "Dispatcher" /* 573 */;
|
|
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1241 */;
|
|
import discord_common_AnalyticsUtils from "discord_common/AnalyticsUtils" /* 1249 */;
|
|
import GlobalUtils from "GlobalUtils" /* 1370 */;
|
|
import NativeShareManagerModuleDefault from "NativeShareManagerModule" /* 8511 */;
|
|
import AuthenticationStore from "AuthenticationStore" /* 502 */;
|
|
import ChannelStore from "ChannelStore" /* 1958 */;
|
|
import GuildStore from "GuildStore" /* 1980 */;
|
|
import SelectedChannelStore from "SelectedChannelStore" /* 2012 */;
|
|
import SelectedGuildStore from "SelectedGuildStore" /* 4461 */;
|
|
import UserStore from "UserStore" /* 1372 */;
|
|
|
|
require = fn;
|
|
function handleTokenUpdated(token) {
|
|
token = token.token;
|
|
return false;
|
|
}
|
|
const AppStates = fn(1074).AppStates;
|
|
const Store = initializeDefault.Store;
|
|
class ShareStore extends Store {
|
|
}
|
|
ShareStore.prototype["initialize"] = function initialize() {
|
|
this.waitFor(AuthenticationStore, ChannelStore, GuildStore, SelectedChannelStore, SelectedGuildStore, UserStore);
|
|
};
|
|
ShareStore.displayName = "ShareStore";
|
|
const shareStore = new ShareStore(DispatcherDefault, {
|
|
CHANNEL_SELECT: function handleChannelSelect(arg0) {
|
|
({ guildId: c3, channelId: c4 } = arg0);
|
|
return false;
|
|
},
|
|
LOGOUT: function handleLogout() {
|
|
NativeShareManagerModuleDefault.setSelectedChannel(null, null);
|
|
const obj2 = NativeShareManagerModuleDefault;
|
|
const result = obj2.setAuthenticationToken(null, AnalyticsUtilsDefault.getSuperPropertiesBase64());
|
|
c5 = null;
|
|
return false;
|
|
},
|
|
REGISTER_SUCCESS: handleTokenUpdated,
|
|
LOGIN_SUCCESS: handleTokenUpdated,
|
|
UPDATE_TOKEN: handleTokenUpdated,
|
|
START_SESSION: function handleStartSession() {
|
|
const token = AuthenticationStore.getToken();
|
|
return false;
|
|
},
|
|
APP_STATE_UPDATE: function handleAppStateUpdate(state) {
|
|
state = state.state;
|
|
if (state === AppStates.INACTIVE) {
|
|
if (null != c4) {
|
|
const guild = GuildStore.getGuild(c3);
|
|
let json = null;
|
|
if (null != guild) {
|
|
const _JSON = JSON;
|
|
json = JSON.stringify(guild);
|
|
}
|
|
const channel = ChannelStore.getChannel(SelectedChannelStore.getChannelId());
|
|
let json1 = null;
|
|
if (null != channel) {
|
|
const obj = {};
|
|
const merged = Object.assign(channel.toJS());
|
|
let recipients = channel.recipients;
|
|
if (recipients == null) {
|
|
recipients = [];
|
|
}
|
|
const mapped = recipients.map(UserStore.getUser);
|
|
obj.recipients = mapped.filter(GlobalUtils.isNotNullish);
|
|
json1 = JSON.stringify(obj);
|
|
}
|
|
NativeShareManagerModuleDefault.setSelectedChannel(json1, json);
|
|
c3 = null;
|
|
c4 = null;
|
|
}
|
|
}
|
|
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());
|
|
if (state === AppStates.INACTIVE) {
|
|
c5 = null;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
});
|
|
const size = fn(2);
|
|
let result = size.fileFinishedImporting("stores/native/ShareStore.tsx");
|
|
|
|
export default shareStore;
|