Files
discord-decomp/sources/stores/native/ShareStore.tsx
T
2026-07-27 16:20:00 +03:00

146 lines
6.7 KiB
TypeScript

/* Metro module 12950; source: stores/native/ShareStore.tsx; dependencies: [6, 7, 15, 17, 18, 27, 1226, 1379, 1867, 1934, 3969, 1878, 661, 1360, 480, 683, 566, 694, 2] */
function _fun98646(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#98646, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13140:6, offset: 0x021b15d7, size: 475 bytes, params: 8, frame: 20
const env0_0 = require;
const closure = function(a0) {
env0_5 = a0.token;
return false;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_6 = importDefault(6) /* metro dependency 6 */;
const env0_7 = importDefault(7) /* metro dependency 7 */;
const env0_8 = importDefault(15) /* metro dependency 15 */;
const env0_9 = importDefault(17) /* metro dependency 17 */;
const env0_10 = importDefault(18) /* metro dependency 18 */;
const env0_11 = (require(27) /* metro dependency 27 */).NativeModules;
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
const selectedGuildStore = importDefault(3969) /* metro dependency 3969: SelectedGuildStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const env0_18 = (require(661) /* metro dependency 661: Constants */).AppStates;
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
let value = _fun98651(Store);
value.displayName = 'ShareStore';
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {CHANNEL_SELECT: function(a0) {
env0_3 = a0.guildId;
env0_4 = a0.channelId;
return false;
}, LOGOUT: function() {
var ShareManager = NativeModules.ShareManager;
ShareManager.setSelectedChannel(null, null);
ShareManager = NativeModules.ShareManager;
ShareManager.setAuthenticationToken(null, importDefault(dependencyMap[15]).getSuperPropertiesBase64());
env0_5 = null;
return false;
}, REGISTER_SUCCESS: closure, LOGIN_SUCCESS: closure, UPDATE_TOKEN: closure, START_SESSION: function() {
env0_5 = AuthenticationStore.getToken();
return false;
}, APP_STATE_UPDATE: APP_STATE_UPDATE_98657});
(require(2) /* metro dependency 2 */).fileFinishedImporting('stores/native/ShareStore.tsx');
exports.default = value;
}
function _isNativeReflectConstruct_98647() { // fn#98647, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13140:261, offset: 0x021b17b2, size: 98 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_98647_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun98651(a0) { // fn#98651, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13140:511, offset: 0x021b1828, size: 72 bytes, params: 2, frame: 15
const closure = ShareStore;
env0_10(closure, a0);
return env0_7(closure, [{key: 'initialize', value: function() {
this.waitFor(AuthenticationStore, ChannelStore, GuildStore, SelectedChannelStore, SelectedGuildStore,
UserStore);
}}]);
}
function APP_STATE_UPDATE_98657({state}) { // fn#98657, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13140:1344, offset: 0x021b199a, size: 398 bytes, params: 2, frame: 22
var r6;
var r10;
var r5;
var value2;
var guild;
var JSON;
var stringify;
var value5;
var object2;
var recipients;
var value6;
var ShareManager;
var moduleValue;
var setAuthenticationToken;
var binding;
var defaultImport;
const INACTIVE = AppStates.INACTIVE;
if (state === INACTIVE) {
value2 = null;
if (value2 != env0_4) {
guild = GuildStore.getGuild(env0_3);
r6 = value2 != guild ? global.JSON.stringify(guild) : value2;
value5 = ChannelStore.getChannel(SelectedChannelStore.getChannelId());
if (value2 != value5) {
JSON = global.JSON;
stringify = JSON.stringify;
object2 = {};
copyDataProperties(object2, value5.toJS(), undefined);
recipients = value5.recipients;
r10 = value2 != recipients ? recipients : [];
value6 = r10.map(UserStore.getUser);
object2['recipients'] = value6.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish);
r5 = Reflect.apply(stringify, JSON, [object2]);
} else {
r5 = value2;
}
NativeModules.ShareManager.setSelectedChannel(r5, r6);
}
}
if (env0_5 != null) {
moduleValue = require(480) /* metro dependency 480: AnalyticsUtils */;
moduleValue.extendSuperProperties({client_app_state: state});
ShareManager = NativeModules.ShareManager;
setAuthenticationToken = ShareManager.setAuthenticationToken;
binding = env0_5;
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
Reflect.apply(setAuthenticationToken, ShareManager, [binding, defaultImport.getSuperPropertiesBase64()]);
if (state !== AppStates.INACTIVE) {
}
}
return false;
}
function ShareStore() { // fn#98652, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13140:523, offset: 0x021b1870, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_6(this, ShareStore);
const value3 = env1_9(ShareStore);
return env1_8(this, _isNativeReflectConstruct_98647() ? global.Reflect.construct(value3, arguments,
env1_9(this).constructor) : value3.apply(this, arguments));
}