52 lines
2.0 KiB
TypeScript
52 lines
2.0 KiB
TypeScript
// Metro module 13851 (f13852).
|
|
import UserSettingsProtoStore from "../../user_settings/UserSettingsProtoStore";
|
|
import { useStateFromStoresObject } from "../../../_bundle/defaultAreStatesEqual";
|
|
import { getExplicitContentSettingOrDefault, resolveExplicitContentSettingWithDefaults } from "../SensitiveMediaExplicitRedactionSettingsUtils";
|
|
import { getGoreContentSettingOrDefault, resolveGoreSettingWithDefaults } from "../SensitiveMediaGoreRedactionSettingsUtils";
|
|
export function useExplicitContentSettingOrDefault() {
|
|
const stateFromStoresObject = useStateFromStoresObject([UserSettingsProtoStore], () => {
|
|
let r7 = UserSettingsProtoStore.settings.textAndImages?.explicitContentSettings;
|
|
if (r7 == null) {
|
|
r7 = getExplicitContentSettingOrDefault();
|
|
}
|
|
return r7;
|
|
});
|
|
return {
|
|
explicitContentGuilds: resolveExplicitContentSettingWithDefaults({
|
|
setting: stateFromStoresObject?.explicitContentGuilds
|
|
}),
|
|
explicitContentNonFriendDm: resolveExplicitContentSettingWithDefaults({
|
|
setting: stateFromStoresObject?.explicitContentNonFriendDm,
|
|
isDm: true
|
|
}),
|
|
explicitContentFriendDm: resolveExplicitContentSettingWithDefaults({
|
|
setting: stateFromStoresObject?.explicitContentFriendDm,
|
|
isDm: true,
|
|
isFriend: true
|
|
})
|
|
};
|
|
}
|
|
export function useGoreContentSettingOrDefault() {
|
|
const stateFromStoresObject = useStateFromStoresObject([UserSettingsProtoStore], () => {
|
|
let r7 = UserSettingsProtoStore.settings.textAndImages?.goreContentSettings;
|
|
if (r7 == null) {
|
|
r7 = getGoreContentSettingOrDefault();
|
|
}
|
|
return r7;
|
|
});
|
|
return {
|
|
goreContentGuilds: resolveGoreSettingWithDefaults({
|
|
setting: stateFromStoresObject?.goreContentGuilds
|
|
}),
|
|
goreContentNonFriendDm: resolveGoreSettingWithDefaults({
|
|
setting: stateFromStoresObject?.goreContentNonFriendDm,
|
|
isDm: true
|
|
}),
|
|
goreContentFriendDm: resolveGoreSettingWithDefaults({
|
|
setting: stateFromStoresObject?.goreContentFriendDm,
|
|
isDm: true,
|
|
isFriend: true
|
|
})
|
|
};
|
|
}
|