Files
discord-decomp/sources/modules/launchpad/native/LaunchPadPullTabCache.tsx
T
2026-07-28 01:06:53 +03:00

88 lines
5.6 KiB
TypeScript

/* Metro module 15315; source: modules/launchpad/native/LaunchPadPullTabCache.tsx; dependencies: [11324, 587, 477, 4671, 1478, 2] */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as PlatformUtilsModule from '../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
import * as StorageModule from '../../../external/discord_common/js/packages/storage/Storage.tsx'; /* Metro dependency 587 */
import * as LaunchPadConstantsModule from './LaunchPadConstants.tsx'; /* Metro dependency 11324 */
function _fun117075(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117075, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15512:6, offset: 0x024a2907, size: 228 bytes, params: 8, frame: 21
const env0_0 = require;
const getLaunchPadPullTabPositionCached2 = getLaunchPadPullTabPositionCached;
const setLaunchPadPullTabPositionCached2 = setLaunchPadPullTabPositionCached;
const setLaunchPadPullTabExclusionRect2 = setLaunchPadPullTabExclusionRect;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/launchpad/native/LaunchPadPullTabCache.tsx');
exports.getLaunchPadPullTabPositionCached = getLaunchPadPullTabPositionCached2;
exports.setLaunchPadPullTabPositionCached = setLaunchPadPullTabPositionCached2;
exports.persistLaunchPadPullTabPosition = persistLaunchPadPullTabPosition;
exports.clearLaunchPadPullTabExclusionRect = clearLaunchPadPullTabExclusionRect;
exports.setLaunchPadPullTabExclusionRect = setLaunchPadPullTabExclusionRect2;
function getLaunchPadPullTabPositionCached() { // fn#117076, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15512:264, offset: 0x024a29eb, size: 57 bytes, params: 1, frame: 12
const Storage = (StorageModule).Storage;
return Storage.get(env0_6) ?? LAUNCH_PAD_PULL_TAB_INITIAL_POSITION;
}
function setLaunchPadPullTabPositionCached(a0) { // fn#117077, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15512:359, offset: 0x024a2a24, size: 51 bytes, params: 2, frame: 14
const Storage = (StorageModule).Storage;
Storage.set(env0_6, a0);
}
function setLaunchPadPullTabExclusionRect() { // fn#117078, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15512:430, offset: 0x024a2a57, size: 303 bytes, params: 1, frame: 19
var r2;
var moduleValue2;
var getWindowDimensions;
var width;
var value3;
var moduleValue3;
var value4;
var binding;
const value = a0;
const value2 = undefined;
const r4 = value !== value2 ? value : getLaunchPadPullTabPositionCached();
if (PlatformUtilsModule.isAndroid()) {
moduleValue2 = require(1478) /* metro dependency 1478: useWindowDimensionsNative */;
getWindowDimensions = moduleValue2.getWindowDimensions;
width = Reflect.apply(getWindowDimensions, moduleValue2, []).width;
value3 = width - LAUNCH_PAD_PULL_TAB_WIDTH;
moduleValue3 = require(1478) /* metro dependency 1478: useWindowDimensionsNative */;
getWindowDimensions = moduleValue3.getWindowDimensions;
width = Reflect.apply(getWindowDimensions, moduleValue3, []).width;
value4 = r4 + LAUNCH_PAD_PULL_TAB_HEIGHT;
binding = env0_8;
r2 = (binding == null ? value2 : binding.left) === value3 && (env0_8 == null ? value2 : env0_8.right) === width;
r2 = r2 && (env0_8 == null ? value2 : env0_8.top) === r4;
r2 = r2 && (env0_8 == null ? value2 : env0_8.bottom) === value4;
if (!r2) {
(importDefault(4671) /* metro dependency 4671: NativeDeviceSettingsModule */).setSystemGestureExclusionRects([{left: value3,
right: width, top: r4, bottom: value4}]);
}
}
return value2;
}
function persistLaunchPadPullTabPosition(a0) { // fn#117079, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15512:1112, offset: 0x024a2b86, size: 62 bytes, params: 2, frame: 15
const env0_0 = a0;
global.clearTimeout(env0_7);
env0_7 = global.setTimeout(_fun117080, 300);
function _fun117080() { // fn#117080, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15512:1186, offset: 0x024a2bc4, size: 32 bytes, params: 1, frame: 12
const setLaunchPadPullTabPositionCachedBinding = setLaunchPadPullTabPositionCached;
const binding = env0_0;
setLaunchPadPullTabPositionCachedBinding(binding);
setLaunchPadPullTabExclusionRect(binding);
}
}
function clearLaunchPadPullTabExclusionRect() { // fn#117081, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15512:1309, offset: 0x024a2be4, size: 92 bytes, params: 1, frame: 13
if ((require(477) /* metro dependency 477: PlatformUtils */).isAndroid() && env0_8 != null) {
(importDefault(4671) /* metro dependency 4671: NativeDeviceSettingsModule */).setSystemGestureExclusionRects([]);
}
}
}
global.__d(_fun117075, 15315, [11324, 587, 477, 4671, 1478,
2]) /* metro module 15315, dependencies: [11324, 587, 477, 4671, 1478, 2] */;