89 lines
4.7 KiB
TypeScript
89 lines
4.7 KiB
TypeScript
/* Metro module 13462; source: modules/auth_sessions/AuthSessionsActionCreators.tsx; dependencies: [5, 661, 507, 694, 2] */
|
|
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import Dispatcher from '../../Dispatcher.tsx'; /* Metro dependency 694 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
|
|
function _fun102370(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#102370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13652:6, offset: 0x022394f7, size: 188 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/auth_sessions/AuthSessionsActionCreators.tsx');
|
|
exports.fetchAuthSessions = function() {
|
|
return _fetchAuthSessions.apply(this, arguments);
|
|
};
|
|
exports.clearAuthSessions = clearAuthSessions;
|
|
exports.logOutSessions = function() {
|
|
return _logOutSessions.apply(this, arguments);
|
|
};
|
|
function _fetchAuthSessions() { // fn#102371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13652:126, offset: 0x022395b3, size: 50 bytes, params: 1, frame: 14
|
|
return Module00005(_fun102373).apply(this, arguments);
|
|
function* _fun102373() { // fn#102373, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13652:185, offset: 0x022395f0, size: 194 bytes, params: 1, frame: 17
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
const binding = env2_0;
|
|
const value3 = undefined;
|
|
const HTTP = binding(env2_2[2]).HTTP;
|
|
const get = HTTP.get;
|
|
const AUTH_SESSIONS = env2_4.AUTH_SESSIONS;
|
|
yield Reflect.apply(get, HTTP, [{url: AUTH_SESSIONS, rejectWithError: false}]);
|
|
const value4 = undefined;
|
|
if (true) {
|
|
var r3 = value4 != null && value4.ok;
|
|
r3 = r3 && (value4.body == null ? value3 : value4.body.user_sessions) != null;
|
|
if (r3) {
|
|
env2_1(env2_2[3]).dispatch({type: 'FETCH_AUTH_SESSIONS_SUCCESS', sessions: value4.body.user_sessions});
|
|
}
|
|
}
|
|
return value4;
|
|
}
|
|
|
|
}
|
|
|
|
function _logOutSessions() { // fn#102374, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13652:454, offset: 0x022396b2, size: 50 bytes, params: 1, frame: 14
|
|
return Module00005(_fun102376).apply(this, arguments);
|
|
function* _fun102376(a0) { // fn#102376, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13652:507, offset: 0x022396ef, size: 226 bytes, params: 2, frame: 17
|
|
var r5;
|
|
var HTTP;
|
|
let value = a0;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
const Array = global.Array;
|
|
if (Array.isArray(value)) {
|
|
if (value.length === 0) {
|
|
return undefined;
|
|
}
|
|
r5 = value;
|
|
value = environment.__proto__.__proto__;
|
|
HTTP = env2_0(env2_2[2]).HTTP;
|
|
yield HTTP.post({url: env2_4.AUTH_SESSIONS_LOGOUT, body: {session_id_hashes: r5}, rejectWithError: false});
|
|
} else {
|
|
r5 = [value];
|
|
value = environment.__proto__.__proto__;
|
|
HTTP = env2_0(env2_2[2]).HTTP;
|
|
yield HTTP.post({url: env2_4.AUTH_SESSIONS_LOGOUT, body: {session_id_hashes: r5}, rejectWithError: false});
|
|
}
|
|
const value4 = undefined;
|
|
if (true) {
|
|
if (value4 != null && value4.ok) {
|
|
value = env2_1(env2_2[3]);
|
|
value.dispatch({type: 'LOGOUT_AUTH_SESSIONS_SUCCESS', sessionIdHashes: r5});
|
|
}
|
|
}
|
|
return value4;
|
|
}
|
|
|
|
}
|
|
|
|
function clearAuthSessions() { // fn#102378, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13652:1009, offset: 0x022397d1, size: 58 bytes, params: 1, frame: 13
|
|
(Dispatcher).dispatch({type: 'FETCH_AUTH_SESSIONS_SUCCESS',
|
|
sessions: []});
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun102370, 13462, [5, 661, 507, 694, 2]) /* metro module 13462, dependencies: [5, 661, 507, 694, 2] */;
|