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
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ self.onmessage = async function (event) {
switch (type) {
case 'generate_proof':
try {
const { voteId, publicKey, address, signature, previousCiphertext, messageHash } = data
const { voteId, publicKey, address, signature, previousCiphertext } = data

// voteId is either 0 or 1, so we need to encode the vote accordingly.
// We are adapting to the current CRISP application.
Expand All @@ -32,7 +32,6 @@ self.onmessage = async function (event) {
merkleLeaves,
balance,
previousCiphertext,
messageHash,
})
const encodedProof = encodeSolidityProof(proof)

Expand Down
26 changes: 22 additions & 4 deletions examples/CRISP/client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import { Routes, Route, Navigate } from 'react-router-dom'
import Navbar from '@/components/Navbar'
import Footer from '@/components/Footer'
import { useSwitchChain } from 'wagmi'
//Pages
import Landing from '@/pages/Landing/Landing'
import DailyPoll from '@/pages/DailyPoll/DailyPoll'
Expand All @@ -17,17 +18,34 @@
import RoundPoll from '@/pages/RoundPoll'
import useScrollToTop from '@/hooks/generic/useScrollToTop'
import { useVoteManagementContext } from '@/context/voteManagement'
import { useNotificationAlertContext } from '@/context/NotificationAlert'
import { handleGenericError } from '@/utils/handle-generic-error'
import { getChain } from './utils/methods'

const App: React.FC = () => {
useScrollToTop()
const { initialLoad } = useVoteManagementContext()
const { switchChain } = useSwitchChain()
const { showToast } = useNotificationAlertContext()

useEffect(() => {
async function loadWasm() {
await initialLoad()
}
loadWasm()
;(async () => {
try {
await initialLoad()

const chain = getChain()
switchChain({ chainId: chain.id })
} catch (error) {
const errorMessage = error instanceof Error ? error.message : String(error)
handleGenericError('App initial load', error instanceof Error ? error : new Error(errorMessage))
showToast({
type: 'danger',
message: 'Failed to initialize application. Please refresh the page.',
persistent: true,
})
}
})()
}, [])

Check warning on line 48 in examples/CRISP/client/src/App.tsx

View workflow job for this annotation

GitHub Actions / integration_prebuild

React Hook useEffect has missing dependencies: 'initialLoad', 'showToast', and 'switchChain'. Either include them or remove the dependency array
Comment thread
cedoor marked this conversation as resolved.

return (
<Fragment>
Expand Down
10 changes: 0 additions & 10 deletions examples/CRISP/client/src/assets/icons/arrowRight.svg

This file was deleted.

14 changes: 0 additions & 14 deletions examples/CRISP/client/src/assets/icons/calendarCheck.svg

This file was deleted.

11 changes: 0 additions & 11 deletions examples/CRISP/client/src/assets/icons/caretCircle.svg

This file was deleted.

10 changes: 0 additions & 10 deletions examples/CRISP/client/src/assets/icons/check.svg

This file was deleted.

4 changes: 0 additions & 4 deletions examples/CRISP/client/src/assets/icons/close.svg

This file was deleted.

6 changes: 0 additions & 6 deletions examples/CRISP/client/src/assets/icons/enclaveLogo.svg

This file was deleted.

15 changes: 0 additions & 15 deletions examples/CRISP/client/src/assets/icons/fingerprint.svg

This file was deleted.

15 changes: 0 additions & 15 deletions examples/CRISP/client/src/assets/icons/fingerprintWhite.svg

This file was deleted.

12 changes: 0 additions & 12 deletions examples/CRISP/client/src/assets/icons/logout.svg

This file was deleted.

13 changes: 0 additions & 13 deletions examples/CRISP/client/src/assets/icons/notebook.svg

This file was deleted.

Loading
Loading