decord/source/modules/window/native/AppEntryKeyContext.tsx

34 lines
978 B
TypeScript
Raw Normal View History

// Module ID: 1480
// Function ID: 1481
// Name: AppEntryKeyContext
2026-07-29 08:29:29 +00:00
// Dependencies: [19, 3, 2]
2026-07-20 16:05:17 +00:00
// Exports: useAppEntryKey
// Module 1480 (AppEntryKeyContext)
import LoggerDefault from "Logger" /* 3 */;
import noop from "module_19" /* 19 */;
2026-07-23 10:11:24 +00:00
let closure_1 = new LoggerDefault("AppEntryKeyContext");
2026-07-29 08:29:29 +00:00
const main = "main";
let context = noop.createContext(undefined);
2026-07-29 08:29:29 +00:00
let c4 = false;
const size = fn(2);
const result = size.fileFinishedImporting("modules/window/native/AppEntryKeyContext.tsx");
2026-07-20 16:05:17 +00:00
export const DEFAULT_APP_ENTRY_KEY = "main";
export const AppEntryKeyContext = context;
export const useAppEntryKey = function useAppEntryKey() {
2026-07-23 10:11:24 +00:00
context = context.useContext(context);
2026-07-20 16:05:17 +00:00
const items = [context];
2026-07-23 10:11:24 +00:00
const effect = context.useEffect(() => {
2026-07-20 16:05:17 +00:00
if (!tmp) {
2026-08-24 06:08:38 +00:00
c4 = true;
logger.warn("AppEntryKey context was not provided; falling back to default entry key \"main\".");
2026-07-20 16:05:17 +00:00
}
}, items);
2026-07-29 08:29:29 +00:00
if (context == null) {
context = main;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return context;
2026-07-20 16:05:17 +00:00
};