254 lines
7.3 KiB
TypeScript
254 lines
7.3 KiB
TypeScript
/* Metro module 10328; source: modules/user_profile/hooks/useNote.tsx; dependencies: [5, 31, 10329, 661, 566, 694, 507, 2] */
|
|
function _fun80074(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80074, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10514:6, offset: 0x01e6c04b, size: 186 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(5) /* metro dependency 5 */;
|
|
const env0_4 = importAll(31) /* metro dependency 31 */;
|
|
const noteStore = importDefault(10329) /* metro dependency 10329: NoteStore */;
|
|
const env0_6 = (require(661) /* metro dependency 661: Constants */).Endpoints;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/user_profile/hooks/useNote.tsx');
|
|
exports.default = useNote;
|
|
}
|
|
|
|
function _fetchNote() { // fn#80075, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10514:148, offset: 0x01e6c105, size: 50 bytes, params: 1, frame: 14
|
|
return env0_3(_fun80077).apply(this, arguments);
|
|
}
|
|
|
|
function useNote(a0) { // fn#80078, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10514:653, offset: 0x01e6c282, size: 124 bytes, params: 2, frame: 16
|
|
const env0_0 = a0;
|
|
const note = (require(566) /* metro dependency 566: flux */).useStateFromStores([NoteStore], _fun80079);
|
|
env0_4.useEffect(_fun80080, [note, a0]);
|
|
return note ?? ({'loading': true, 'note': null});
|
|
}
|
|
|
|
function* _fun80077(a0) { // fn#80077, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10514:191, offset: 0x01e6c142, size: 320 bytes, params: 2, frame: 20
|
|
var object2;
|
|
var binding2;
|
|
var property;
|
|
var value4;
|
|
var HTTP;
|
|
var get;
|
|
var NOTE;
|
|
var value5;
|
|
var value6;
|
|
var value7;
|
|
var value8;
|
|
var body;
|
|
var note_user_id;
|
|
var value9;
|
|
var binding3;
|
|
var value10;
|
|
var note;
|
|
var Error;
|
|
var prototype;
|
|
var error;
|
|
var value12;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
let binding = env2_1;
|
|
const value3 = binding(env2_2[5]);
|
|
let dispatch = value3.dispatch;
|
|
Reflect.apply(dispatch, value3, [{type: 'USER_NOTE_LOAD_START', userId: a0}]);
|
|
reducibleJoin3: while (true) {
|
|
reduciblePort47: while (true) {
|
|
exceptionLanding46: while (true) {
|
|
try {
|
|
binding = env2_0;
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
break reducibleJoin3;
|
|
}
|
|
binding = env2_1;
|
|
value = binding(env2_2[5]);
|
|
dispatch = value.dispatch;
|
|
Reflect.apply(dispatch, value, [{type: 'USER_NOTE_UPDATE', id: a0}]);
|
|
break reduciblePort47;
|
|
}
|
|
return undefined;
|
|
}
|
|
try {
|
|
binding2 = env2_2;
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
property = binding2[6];
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
value4 = binding(property);
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
HTTP = value4.HTTP;
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
get = HTTP.get;
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
object2 = {'url': null, 'oldFormErrors': true, 'rejectWithError': true};
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
binding = env2_6;
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
NOTE = binding.NOTE;
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
value5 = Reflect.apply(NOTE, binding, [a0]);
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
object2.url = value5;
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
value6 = Reflect.apply(get, HTTP, [object2]);
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
yield value6;
|
|
try {
|
|
value7 = undefined;
|
|
value8 = false;
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
if (value8) {
|
|
return value7;
|
|
}
|
|
try {
|
|
body = value7.body;
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
note_user_id = body.note_user_id;
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
value9 = note_user_id !== a0;
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
if (!value9) {
|
|
try {
|
|
binding = env2_1;
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
binding3 = env2_2;
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
property = binding3[5];
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
value10 = binding(property);
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
dispatch = value10.dispatch;
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
object2 = {};
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
object2.type = 'USER_NOTE_UPDATE';
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
object2.id = a0;
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
note = body.note;
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
object2.note = note;
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
Reflect.apply(dispatch, value10, [object2]);
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
return undefined;
|
|
}
|
|
try {
|
|
Error = global.Error;
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
prototype = Error.prototype;
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
error = new Error('Invalid response from server');
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
value12 = error instanceof Object ? error : undefined;
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
throw value12;
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
}
|
|
|
|
function _fun80079() { // fn#80079, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10514:711, offset: 0x01e6c2fe, size: 27 bytes, params: 1, frame: 11
|
|
return NoteStore.getNote(env0_0);
|
|
}
|
|
|
|
function _fun80080() { // fn#80080, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10514:750, offset: 0x01e6c319, size: 37 bytes, params: 1, frame: 11
|
|
if (note == null) {
|
|
(function() {
|
|
return _fetchNote.apply(this, arguments);
|
|
})(env0_0);
|
|
}
|
|
}
|
|
|