This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

+83
View File
@@ -0,0 +1,83 @@
// Metro module 16764 (f16765).
import { useState, useEffect } from "react";
import { BackHandler, NativeModules } from "react-native";
import "../../../stores/AnalyticsTrackingStore";
import "../../../stores/native/ShareStore";
import AuthenticationStore from "../../../stores/AuthenticationStore";
import { AnalyticEvents } from "../../../Constants";
import { MultiAccountSwitchLocation } from "../../multi_account/Constants";
import { useStateFromStores } from "../../../_bundle/Module589";
import AuthenticationActionCreators from "../../../actions/AuthenticationActionCreators";
import { isAndroid } from "../../../utils/PlatformUtils";
import AccessibilityManager from "../../a11y/native/AccessibilityManager";
import { switchAccount } from "../../multi_account/MultiAccountActionCreators";
import { trackAppUIViewed } from "../../tti_analytics/native/TTIAnalyticsUtils";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
import useMountEffect from "../../../hooks/useMountEffect";
import AppContainer from "../../../components_native/AppContainer";
import ShareScreen from "./ShareScreen";
import { isMetaQuest } from "../../device/MetaQuestUtils.android";
import Module8197 from "../../../_bundle/Module8197";
import { SceneLoadingIndicator } from "../../../design/components/Navigator/native/SceneLoadingIndicator.native";
import { ActionSheetContainer } from "../../../components_native/MainShared";
import ToastContainer from "../../toast/native/ToastContainer";
import { AlertModalContainer } from "../../../design/components/AlertModal/native/AlertModal.native";
const appEntryKey = "share";
export default function AppShare(props) {
let c23404_0 = props;
const targetUserId = props.targetUserId;
let [state2, setState] = useState(false);
const state = state2;
const [state3, setState2] = useState(targetUserId == null || AuthenticationStore.getId() === targetUserId);
useEffect(() => {
if (!state) {
AccessibilityManager.init();
setState(true);
}
}, [state]);
useEffect(() => {
if (targetUserId != null && AuthenticationStore.getId() !== targetUserId) {
setTimeout(() => {
switchAccount(targetUserId, false, MultiAccountSwitchLocation.SHARE_EXTENSION).then(() => {
setState2(true);
});
}, 18);
}
}, [targetUserId]);
if (state) {
state2 = state3;
}
const stateFromStores = useStateFromStores([AuthenticationStore], () => AuthenticationStore.isAuthenticated());
useEffect(() => {
if (stateFromStores) {
AuthenticationActionCreators.startSession(AuthenticationStore.getToken());
if (isAndroid()) {
NativeModules.NativePermissionManager.requestNotificationAuthorization();
}
}
}, [stateFromStores]);
useEffect(() => {
const EXTERNAL_SHARE_OPENED = AnalyticEvents.EXTERNAL_SHARE_OPENED;
AnalyticsUtils.track(EXTERNAL_SHARE_OPENED, {
has_content: c23404_0.text != null && c23404_0.text.length > 0,
has_attachment: c23404_0.attachments.length > 0
});
}, [props.attachments.length, props.text]);
useMountEffect(() => {
trackAppUIViewed("share", {
share_num_attachments: c23404_0.attachments.length,
share_attachment_mimetypes: c23404_0.attachments.map(({ mimeType }) => {
if (mimeType == null) {
mimeType = "unknown";
}
return mimeType;
})
});
});
return <AppContainer appEntryKey={appEntryKey}>
{state2 ? <ShareScreen appEntryKey={appEntryKey} sharedContent={props} onClose={isMetaQuest() ? Module8197.close : BackHandler.exitApp} /> : <SceneLoadingIndicator />}
<ActionSheetContainer appEntryKey={appEntryKey} />
<ToastContainer />
<AlertModalContainer />
</AppContainer>;
};