258 lines
9.5 KiB
TypeScript
258 lines
9.5 KiB
TypeScript
/* Metro module 10328; source: modules/user_profile/hooks/useNote.tsx; dependencies: [5, 31, 10329, 661, 566, 694, 507, 2] */
|
|
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import NoteStore from '../notes/NoteStore.tsx'; /* Metro dependency 10329 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
|
|
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});
|
|
(FileImportTrackerModule).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 Module00005(_fun80077).apply(this, arguments);
|
|
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 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 {
|
|
object = {'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 {
|
|
object.url = value5;
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
value6 = Reflect.apply(get, HTTP, [object]);
|
|
} 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 {
|
|
object = {};
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
object.type = 'USER_NOTE_UPDATE';
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
object.id = a0;
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
note = body.note;
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
object.note = note;
|
|
} catch (error) {
|
|
break exceptionLanding46;
|
|
}
|
|
try {
|
|
Reflect.apply(dispatch, value10, [object]);
|
|
} 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 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 = (FluxModule).useStateFromStores([NoteStore], _fun80079);
|
|
ReactModule.useEffect(_fun80080, [note, a0]);
|
|
return note ?? ({'loading': true, 'note': null});
|
|
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);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun80074, 10328, [5, 31, 10329, 661, 566, 694, 507,
|
|
2]) /* metro module 10328, dependencies: [5, 31, 10329, 661, 566, 694, 507, 2] */;
|