Repository navigation
Expand file tree
/
Copy pathindex.js
More file actions
54 lines (50 loc) · 2.28 KB
/
Copy pathindex.js
File metadata and controls
54 lines (50 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import './src/setupEnv';
import './src/polyfills';
import { AppRegistry, LogBox } from 'react-native';
import { name as appName } from './app.json';
import App from './src/App';
// Sets up dayjs in the app's language for every runtime, also one that never
// renders the app (a bare import, so Metro doesn't inline it).
import './src/helpers/i18n';
import {
installGlobalErrorHandler,
installRejectionTracker,
} from './src/services/crashReporting';
import { setUpNotificationActions } from './src/services/notificationActions';
// Defines the background fetch task. A task has to be defined while the bundle
// first runs: a background launch runs only this file, without mounting the
// app. Metro inlines requires, so the import where the task is registered
// (useMainStartup) would load the module only once the app has mounted.
import {
runInMenuBar,
watchAssignmentChanges,
} from './src/services/background';
import { watchSurfaces } from './src/services/surfaces';
import { watchUpdates } from './src/services/updateNotifications';
import { withLaunchOptions } from './src/services/launchOptions';
import { followMacActivation } from './src/services/windows';
// Keep LogBox off: its "Open debugger to view warnings" toast covers the tab
// bar and opens a React Native DevTools window when tapped. Read warnings in
// the Metro log instead.
LogBox.ignoreAllLogs(true);
installGlobalErrorHandler();
installRejectionTracker();
// Before the app renders: an action button can launch the app in the
// background, where it may never render.
setUpNotificationActions();
// Keeps what learnX shows outside the app (services/surfaces) in step with
// the data, in this runtime whether or not the app renders.
watchSurfaces();
// So what's checked when the app comes back (a permission changed in System
// Settings) is on the Mac too.
followMacActivation();
// Notifies about grades and moved deadlines the app itself fetches while open.
watchAssignmentChanges();
// The Mac: in the menu bar and syncing while learnX runs, with or without a
// window.
runInMenuBar();
// Checks for a new version where learnX updates itself, and says when one is
// out.
watchUpdates();
// Test runs set the app up with launch arguments (services/launchOptions).
AppRegistry.registerComponent(appName, () => withLaunchOptions(App));