Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
0xturboblitz committed Feb 4, 2025
1 parent be7307a commit cc3d661
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 30 deletions.
14 changes: 5 additions & 9 deletions app/App.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import 'react-native-get-random-values';
import '@ethersproject/shims';
import { Buffer } from 'buffer';
import { NativeModules, Platform } from 'react-native';

global.Buffer = Buffer;

import React, { useEffect } from 'react';
import * as amplitude from '@amplitude/analytics-react-native';
import { AMPLITUDE_KEY, SEGMENT_KEY } from '@env';
import { SEGMENT_KEY } from '@env';
import { useToastController } from '@tamagui/toast';
import { YStack } from 'tamagui';
import { createClient, EventPlugin, PluginType, SegmentEvent } from '@segment/analytics-react-native';
Expand Down Expand Up @@ -54,9 +50,9 @@ export const createSegmentClient = () => {
integrations: {
'Segment.io': {
apiKey: SEGMENT_KEY,
}
}
}
},
},
},
});

client.add({ plugin: new DisableTrackingPlugin() });
Expand All @@ -69,7 +65,7 @@ export let segmentClient: ReturnType<typeof createClient> | null = null;

function App(): React.JSX.Element {
const toast = useToastController();
const { setToast, setSelectedTab, trackEvent } = useNavigationStore();
const { setToast, setSelectedTab } = useNavigationStore();
const initUserStore = useUserStore(state => state.initUserStore);

useEffect(() => {
Expand Down
8 changes: 4 additions & 4 deletions app/src/screens/MockDataScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ const MockDataScreen: React.FC<MockDataScreenProps> = ({
let mockPassportData;
if (isInOfacList) {
mockPassportData = genMockPassportData(
selectedAlgorithm == 'rsa sha1' ? 'sha1' : 'sha256',
selectedAlgorithm == 'rsa sha1' ? 'sha1' : 'sha256',
selectedAlgorithm === 'rsa sha1' ? 'sha1' : 'sha256',
selectedAlgorithm === 'rsa sha1' ? 'sha1' : 'sha256',
signatureAlgorithmToStrictSignatureAlgorithm[
selectedAlgorithm as keyof typeof signatureAlgorithmToStrictSignatureAlgorithm
],
Expand All @@ -82,8 +82,8 @@ const MockDataScreen: React.FC<MockDataScreenProps> = ({
);
} else {
mockPassportData = genMockPassportData(
selectedAlgorithm == 'rsa sha1' ? 'sha1' : 'sha256',
selectedAlgorithm == 'rsa sha1' ? 'sha1' : 'sha256',
selectedAlgorithm === 'rsa sha1' ? 'sha1' : 'sha256',
selectedAlgorithm === 'rsa sha1' ? 'sha1' : 'sha256',
signatureAlgorithmToStrictSignatureAlgorithm[
selectedAlgorithm as keyof typeof signatureAlgorithmToStrictSignatureAlgorithm
],
Expand Down
2 changes: 1 addition & 1 deletion app/src/stores/navigationStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const useNavigationStore = create<NavigationState>((set, get) => ({
trackNavigation: (tab: string) => {
if (segmentClient) {
segmentClient.track('Navigation Change', {
tab
tab,
});
}
set({ selectedTab: tab });
Expand Down
10 changes: 5 additions & 5 deletions app/src/utils/nfcScanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,11 @@ const handleResponseAndroid = async (
eContent,
encryptedDigest,
photo,
digestAlgorithm,
signerInfoDigestAlgorithm,
digestEncryptionAlgorithm,
LDSVersion,
unicodeVersion,
// digestAlgorithm,
// signerInfoDigestAlgorithm,
// digestEncryptionAlgorithm,
// LDSVersion,
// unicodeVersion,
encapContent,
documentSigningCertificate,
dataGroupHashes,
Expand Down
22 changes: 11 additions & 11 deletions app/src/utils/zkeyDownload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export async function downloadZkey(circuit: CircuitName) {
trackEvent('Download Skipped', {
success: true,
circuit: circuit,
reason: 'already_downloaded'
reason: 'already_downloaded',
});
return;
}
Expand Down Expand Up @@ -92,15 +92,15 @@ export async function downloadZkey(circuit: CircuitName) {
success: true,
circuit: circuit,
reason: 'no_wifi',
expected_size: expectedSize
expected_size: expectedSize,
});
}
} catch (error: any) {
trackEvent('Download Failed', {
success: false,
error: error.message,
circuit: circuit,
duration_ms: Date.now() - startTime
duration_ms: Date.now() - startTime,
});
throw error;
}
Expand Down Expand Up @@ -163,7 +163,7 @@ export async function fetchZkeyAndDat(circuit: CircuitName) {

trackEvent('Files Download Started', {
success: true,
circuit: circuit
circuit: circuit,
});

update({
Expand All @@ -184,7 +184,7 @@ export async function fetchZkeyAndDat(circuit: CircuitName) {
trackEvent('File Download Started', {
success: true,
circuit: circuit,
file_type: fileName.includes('zkey') ? 'zkey' : 'dat'
file_type: fileName.includes('zkey') ? 'zkey' : 'dat',
});
},
progress: (res: any) => {
Expand All @@ -205,7 +205,7 @@ export async function fetchZkeyAndDat(circuit: CircuitName) {
trackEvent('File Download Completed', {
success: true,
circuit: circuit,
file_type: fileName.includes('zkey') ? 'zkey' : 'dat'
file_type: fileName.includes('zkey') ? 'zkey' : 'dat',
});
};

Expand All @@ -232,7 +232,7 @@ export async function fetchZkeyAndDat(circuit: CircuitName) {
trackEvent('Files Download Completed', {
success: true,
circuit: circuit,
duration_ms: Date.now() - startTime
duration_ms: Date.now() - startTime,
});

} catch (error: any) {
Expand All @@ -247,7 +247,7 @@ export async function fetchZkeyAndDat(circuit: CircuitName) {
success: false,
error: error.message,
circuit: circuit,
duration_ms: Date.now() - startTime
duration_ms: Date.now() - startTime,
});

toast.show('Error', {
Expand All @@ -264,7 +264,7 @@ async function unzipFile(circuit: CircuitName, fileType: 'zkey' | 'dat') {
trackEvent('File Unzip Started', {
success: true,
circuit: circuit,
file_type: fileType
file_type: fileType,
});

try {
Expand Down Expand Up @@ -294,15 +294,15 @@ async function unzipFile(circuit: CircuitName, fileType: 'zkey' | 'dat') {
success: true,
circuit: circuit,
file_type: fileType,
duration_ms: Date.now() - startTime
duration_ms: Date.now() - startTime,
});
} catch (error: any) {
trackEvent('File Unzip Failed', {
success: false,
error: error.message,
circuit: circuit,
file_type: fileType,
duration_ms: Date.now() - startTime
duration_ms: Date.now() - startTime,
});
throw error;
}
Expand Down

0 comments on commit cc3d661

Please sign in to comment.