68 lines
5.0 KiB
TypeScript
68 lines
5.0 KiB
TypeScript
/* Metro module 8398; source: modules/user_profile/hooks/usePendingAvatarSettings.tsx; dependencies: [31, 7624, 8399, 632, 8400, 8402, 7613, 2] */
|
|
import UserProfileSettingsStore from '../UserProfileSettingsStore.tsx'; /* Metro dependency 7624 */
|
|
import UseTrackCollectiblesItemTryOut from '../../collectibles/hooks/useTrackCollectiblesItemTryOut.tsx'; /* Metro dependency 8399 */
|
|
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 UseStateFromStoresModule from '../../../external/discord_common/js/packages/flux/useStateFromStores.tsx'; /* Metro dependency 632 */
|
|
import * as UserProfileSettingsActionCreatorsModule from '../UserProfileSettingsActionCreators.tsx'; /* Metro dependency 8400 */
|
|
|
|
function _fun66737(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#66737, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8583:6, offset: 0x01c07a95, size: 139 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/usePendingAvatarSettings.tsx');
|
|
exports.default = usePendingAvatarSettings;
|
|
function usePendingAvatarSettings({isTryItOut, analyticsLocations, guildId}) { // fn#66738, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8583:227, offset: 0x01c07b20, size: 266 bytes, params: 2, frame: 21
|
|
const value2 = (UseTrackCollectiblesItemTryOut)(analyticsLocations);
|
|
const {pendingAvatar, pendingAvatarDecoration,
|
|
pendingErrors} = (UseStateFromStoresModule).useStateFromStoresObject([UserProfileSettingsStore],
|
|
_fun66739);
|
|
const value4 = useCallback(_fun66740, [guildId]);
|
|
const value5 = useCallback(_fun66741, [value2, guildId]);
|
|
object = {pendingAvatar: pendingAvatar, pendingAvatarDecoration: pendingAvatarDecoration,
|
|
pendingErrors: pendingErrors};
|
|
object.setPendingAvatar = isTryItOut ? (require(7613) /* metro dependency 7613: UserProfileActionCreators */).setTryItOutAvatar : value4;
|
|
object.setPendingAvatarDecoration = isTryItOut ? (require(7613) /* metro dependency 7613: UserProfileActionCreators */).setTryItOutAvatarDecoration : value5;
|
|
return object;
|
|
function _fun66739() { // fn#66739, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8583:365, offset: 0x01c07c2a, size: 144 bytes, params: 1, frame: 14
|
|
var tryItOutChanges;
|
|
const isTryItOutBinding = isTryItOut;
|
|
const userProfileSettingsStoreBinding = UserProfileSettingsStore;
|
|
if (isTryItOutBinding) {
|
|
tryItOutChanges = userProfileSettingsStoreBinding.getTryItOutChanges();
|
|
return {pendingAvatar: tryItOutChanges.tryItOutAvatar,
|
|
pendingAvatarDecoration: tryItOutChanges.tryItOutAvatarDecoration,
|
|
pendingErrors: userProfileSettingsStoreBinding.getErrors(guildId).avatarDecoration};
|
|
}
|
|
const getPendingChanges = userProfileSettingsStoreBinding.getPendingChanges;
|
|
const guildIdBinding = guildId;
|
|
const value = Reflect.apply(getPendingChanges, userProfileSettingsStoreBinding, [guildIdBinding]);
|
|
const getErrors = userProfileSettingsStoreBinding.getErrors;
|
|
return {pendingAvatar: value.pendingAvatar, pendingAvatarDecoration: value.pendingAvatarDecoration,
|
|
pendingErrors: Reflect.apply(getErrors, userProfileSettingsStoreBinding, [guildIdBinding]).avatarDecoration};
|
|
}
|
|
|
|
function _fun66740(a0) { // fn#66740, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8583:776, offset: 0x01c07cba, size: 99 bytes, params: 2, frame: 16
|
|
let value = environment.__proto__;
|
|
(UserProfileSettingsActionCreatorsModule).setPendingChanges({guildId: guildId,
|
|
avatar: a0});
|
|
value = require(8402) /* metro dependency 8402: ProfileCustomizationUtils */;
|
|
value.announcePendingAvatarChange(a0 == null ? 'remove' : 'set');
|
|
}
|
|
|
|
function _fun66741(a0) { // fn#66741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8583:900, offset: 0x01c07d1d, size: 74 bytes, params: 2, frame: 15
|
|
const value = environment.__proto__;
|
|
(UserProfileSettingsActionCreatorsModule).setPendingChanges({guildId: guildId,
|
|
avatarDecoration: a0});
|
|
if (a0 != null) {
|
|
env0_2(a0);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun66737, 8398, [31, 7624, 8399, 632, 8400, 8402, 7613,
|
|
2]) /* metro module 8398, dependencies: [31, 7624, 8399, 632, 8400, 8402, 7613, 2] */;
|