Files
discord-decomp/sources/modules/video_backgrounds/LastUsedVideoBackgroundOption.tsx
T
2026-07-27 16:20:00 +03:00

73 lines
4.2 KiB
TypeScript

/* Metro module 8909; source: modules/video_backgrounds/LastUsedVideoBackgroundOption.tsx; dependencies: [31, 1348, 1878, 8906, 3802, 566, 2] */
function _fun69512(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#69512, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9094:6, offset: 0x01c756fd, size: 179 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const userSettingsProtoStore = importDefault(1348) /* metro dependency 1348: UserSettingsProtoStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/video_backgrounds/LastUsedVideoBackgroundOption.tsx');
exports.getLastUsedVideoBackgroundOption = getLastUsedVideoBackgroundOption;
exports.useLastUsedVideoBackgroundOption = useLastUsedVideoBackgroundOption;
}
function getOptionFromSettingsFiltered(a0, a1) { // fn#69513, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9094:126, offset: 0x01c757b0, size: 159 bytes, params: 3, frame: 19
var r1;
var r0;
var value;
const videoBackgroundOptionFromProto = (require(8906) /* metro dependency 8906: VideoBackgroundUtils */).getVideoBackgroundOptionFromProto(a0,
a1.id);
const videoBackgroundUtilsModule = require(8906) /* metro dependency 8906: VideoBackgroundUtils */;
if (videoBackgroundUtilsModule.isCustomBackgroundOption(videoBackgroundOptionFromProto)) {
if ((importDefault(3802) /* metro dependency 3802: PremiumUtils */).canUseCustomBackgrounds(a1)) {
if (typeof videoBackgroundOptionFromProto !== 'number') {
r1 = videoBackgroundOptionFromProto;
} else {
value = videoBackgroundUtilsModule;
value = value.isDefaultBackgroundOption(videoBackgroundOptionFromProto);
r1 = value ? videoBackgroundOptionFromProto : null;
}
r0 = r1;
} else {
r0 = null;
}
} else {
if (typeof videoBackgroundOptionFromProto !== 'number') {
r1 = videoBackgroundOptionFromProto;
} else {
value = require(8906) /* metro dependency 8906: VideoBackgroundUtils */;
value = value.isDefaultBackgroundOption(videoBackgroundOptionFromProto);
r1 = value ? videoBackgroundOptionFromProto : null;
}
r0 = r1;
}
return r0;
}
function getLastUsedVideoBackgroundOption(a0) { // fn#69514, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9094:503, offset: 0x01c7584f, size: 53 bytes, params: 2, frame: 14
return getOptionFromSettingsFiltered(UserSettingsProtoStore.settings.voiceAndVideo?.videoBackgroundFilterDesktop,
a0);
}
function useLastUsedVideoBackgroundOption() { // fn#69515, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9094:703, offset: 0x01c75884, size: 161 bytes, params: 1, frame: 19
const value2 = undefined;
const settings = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserSettingsProtoStore],
function() {
return UserSettingsProtoStore.settings;
});
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return UserStore.getCurrentUser();
});
const voiceAndVideo = settings.voiceAndVideo;
return env0_3.useMemo(_fun69518, [voiceAndVideo == null ? value2 : voiceAndVideo.videoBackgroundFilterDesktop,
currentUser]);
}
function _fun69518() { // fn#69518, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9094:947, offset: 0x01c75934, size: 41 bytes, params: 1, frame: 14
const currentUserBinding = currentUser;
const value2 = null;
return value2 == currentUserBinding ? value2 : getOptionFromSettingsFiltered(videoBackgroundFilterDesktop,
currentUser);
}