decord/alpha/source/modules/video_backgrounds/LastUsedVideoBackgroundOption.tsx

72 lines
2.6 KiB
TypeScript
Raw Normal View History

// Module ID: 9921
// Function ID: 9922
// Name: LastUsedVideoBackgroundOption
// Dependencies: [19, 1220, 1372, 9918, 4414, 504, 2]
2026-07-20 16:05:17 +00:00
// Exports: getLastUsedVideoBackgroundOption, useLastUsedVideoBackgroundOption
// Module 9921 (LastUsedVideoBackgroundOption)
import PremiumUtilsDefault from "PremiumUtils" /* 4414 */;
import VideoBackgroundUtils from "VideoBackgroundUtils" /* 9918 */;
import noop from "module_19" /* 19 */;
import UserSettingsProtoStore from "UserSettingsProtoStore" /* 1220 */;
import UserStore from "UserStore" /* 1372 */;
2026-07-23 10:11:24 +00:00
require = fn;
const size = fn(2);
const result = size.fileFinishedImporting("modules/video_backgrounds/LastUsedVideoBackgroundOption.tsx");
2026-07-29 08:29:29 +00:00
export const getLastUsedVideoBackgroundOption = function getLastUsedVideoBackgroundOption(currentUser) {
const voiceAndVideo = UserSettingsProtoStore.settings.voiceAndVideo;
2026-07-29 08:29:29 +00:00
let prop;
if (voiceAndVideo != null) {
prop = voiceAndVideo.videoBackgroundFilterDesktop;
}
const videoBackgroundOptionFromProto = VideoBackgroundUtils.getVideoBackgroundOptionFromProto(prop, currentUser.id);
2026-07-20 16:05:17 +00:00
if (!obj2.isCustomBackgroundOption(videoBackgroundOptionFromProto)) {
2026-08-04 21:03:28 +00:00
if (typeof videoBackgroundOptionFromProto !== "number") {
2026-07-20 16:05:17 +00:00
let tmp7 = videoBackgroundOptionFromProto;
} else {
tmp7 = null;
const tmp2Result = VideoBackgroundUtils;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp6 = tmp7;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
tmp6 = null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp6;
2026-07-20 16:05:17 +00:00
};
export const useLastUsedVideoBackgroundOption = function useLastUsedVideoBackgroundOption() {
const items = [UserSettingsProtoStore];
const stateFromStores = stateFromStores1(504).useStateFromStores(items, () => settings.settings);
let obj = stateFromStores1(504);
const items1 = [UserStore];
stateFromStores1 = stateFromStores1(504).useStateFromStores(items1, () => currentUser.getCurrentUser());
2026-07-20 16:05:17 +00:00
const voiceAndVideo = stateFromStores.voiceAndVideo;
2026-07-29 08:29:29 +00:00
let prop;
if (voiceAndVideo != null) {
2026-07-20 16:05:17 +00:00
prop = voiceAndVideo.videoBackgroundFilterDesktop;
}
const items2 = [prop, stateFromStores1];
return noop.useMemo(() => {
2026-07-29 08:29:29 +00:00
let tmp2 = null;
2026-07-20 16:05:17 +00:00
if (null != stateFromStores1) {
const videoBackgroundOptionFromProto = VideoBackgroundUtils.getVideoBackgroundOptionFromProto(prop, tmp.id);
const tmp4 = require;
2026-07-29 08:29:29 +00:00
if (!obj2.isCustomBackgroundOption(videoBackgroundOptionFromProto)) {
2026-08-04 21:03:28 +00:00
if (typeof videoBackgroundOptionFromProto !== "number") {
2026-07-29 08:29:29 +00:00
let tmp9 = videoBackgroundOptionFromProto;
} else {
tmp9 = null;
const tmp4Result = tmp4(9918);
2026-07-29 08:29:29 +00:00
}
let tmp8 = tmp9;
} else {
tmp8 = null;
}
tmp2 = tmp8;
obj2 = VideoBackgroundUtils;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp2;
2026-07-20 16:05:17 +00:00
}, items2);
};