Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,16 @@
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="enigma" />
</intent-filter>
</activity>
<service
android:name="com.asterinet.react.bgactions.RNBackgroundActionsTask"
android:foregroundServiceType="dataSync"
tools:replace="android:foregroundServiceType" />
</application>
</manifest>
</manifest>
22 changes: 21 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createDrawerNavigator } from '@react-navigation/drawer';
import type { LinkingOptions } from '@react-navigation/native';
import { NavigationContainer } from '@react-navigation/native';
import type { FunctionComponent } from 'react';
import React, { useEffect, useState } from 'react';
Expand Down Expand Up @@ -31,7 +32,25 @@ import { getColors } from './theme/colors';
import { useResolvedTheme } from './theme/useResolvedTheme';
import { useThemeColors } from './theme/useThemeColors';

const Drawer = createDrawerNavigator();
type RootStackParamList = {
Enigma: undefined;
Break: undefined;
SavedMessages: undefined;
SavedAnalyses: undefined;
About: undefined;
Settings: undefined;
};

const Drawer = createDrawerNavigator<RootStackParamList>();

const linking: LinkingOptions<RootStackParamList> = {
prefixes: ['enigma://'],
config: {
screens: {
Break: 'search',
},
},
};

const bannerStyles = StyleSheet.create({
container: {
Expand Down Expand Up @@ -116,6 +135,7 @@ const App: FunctionComponent = () => {
onStateChange={(state) => {
setCurrentRoute(state?.routes[state.index]?.name ?? null);
}}
linking={linking}
>
<Drawer.Navigator
initialRouteName='Enigma'
Expand Down
12 changes: 11 additions & 1 deletion src/features/codeBreaking/searchRunner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ const runSearchInBackground = (
crib,
...(knownCribPosition !== undefined && { knownCribPosition }),
},
progressBar: {
max: 100,
indeterminate: false,
value: 0,
},
linkingURI: 'enigma://search',
};

const backgroundTask = async (
Expand All @@ -57,11 +63,15 @@ const runSearchInBackground = (
dispatch(progressUpdated(p));
void BackgroundService.updateNotification({
taskDesc: `Searching... ${Math.round(p * 100)}%`,
progressBar: {
value: Math.round(p * 100),
max: 100,
indeterminate: false,
},
});
},
isCancelled,
taskData.knownCribPosition,
true,
);

if (!cancelled) {
Expand Down