Skip to content

Commit

Permalink
fix: workaround using animatedValue= to fix ProgressBar crashes
Browse files Browse the repository at this point in the history
Warning: Error: Exception in HostFunction: Loss of precision during arithmetic conversion: (long long) 52.493322164093

This error is located at:
    in RCTView (created by View)
    in View (created by ProgressBar)
    in ProgressBar (created by Importer)
    in RCTView (created by View)
    in View (created by Styled(View))
    in Styled(View) (created by Importer)
    in Importer (created by SceneView)
    in StaticContainer

callstack/react-native-paper#4544
facebook/react-native#47635
  • Loading branch information
linonetwo committed Nov 29, 2024
1 parent e8f4318 commit 2550e62
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/pages/Importer/ImportBinary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export function ImportBinary(props: { autoImportBinary?: boolean; wikiWorkspace:
? `${t('Downloading.FetchAndWrite')} ${Math.floor(importBinaryFetchAndWritPercentage * 100)}%`
: t('Log.SynchronizationFinish'))}
</Text>
<ProgressBar progress={importBinaryReadListPercentage} color={MD3Colors.tertiary40} />
<ProgressBar progress={importBinaryFetchAndWritPercentage} color={MD3Colors.tertiary50} />
<ProgressBar animatedValue={importBinaryReadListPercentage} color={MD3Colors.tertiary40} />
<ProgressBar animatedValue={importBinaryFetchAndWritPercentage} color={MD3Colors.tertiary50} />
</>
)}
{importBinaryError !== undefined && (
Expand Down
16 changes: 8 additions & 8 deletions src/pages/Importer/Index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,13 @@ export const Importer: FC<StackScreenProps<RootStackParameterList, 'Importer'>>
<>
<Text variant='titleLarge'>{t('Loading')}</Text>
<Text>{t('Downloading.HTML')}</Text>
<ProgressBar progress={skinnyHtmlDownloadPercentage} color={MD3Colors.neutral30} />
<ProgressBar animatedValue={skinnyHtmlDownloadPercentage} color={MD3Colors.neutral30} />
<Text>{t('Downloading.TiddlersListAndEssential')}</Text>
<ProgressBar progress={skinnyTiddlerStoreScriptDownloadPercentage} color={MD3Colors.neutral40} />
<ProgressBar progress={nonSkinnyTiddlerStoreScriptDownloadPercentage} color={MD3Colors.neutral50} />
<ProgressBar progress={binaryTiddlersListDownloadPercentage} color={MD3Colors.neutral60} />
<ProgressBar animatedValue={skinnyTiddlerStoreScriptDownloadPercentage} color={MD3Colors.neutral40} />
<ProgressBar animatedValue={nonSkinnyTiddlerStoreScriptDownloadPercentage} color={MD3Colors.neutral50} />
<ProgressBar animatedValue={binaryTiddlersListDownloadPercentage} color={MD3Colors.neutral60} />
<Text>{t('Downloading.TiddlerTexts')}</Text>
<ProgressBar progress={skinnyTiddlerTextCacheDownloadPercentage} color={MD3Colors.neutral70} />
<ProgressBar animatedValue={skinnyTiddlerTextCacheDownloadPercentage} color={MD3Colors.neutral70} />
</>
)}
{importStatus === 'sqlite' && (
Expand All @@ -266,9 +266,9 @@ export const Importer: FC<StackScreenProps<RootStackParameterList, 'Importer'>>
? `${t('Downloading.Text')} ${Math.floor(addTextToSQLitePercentage * 100)}%`
: t('Log.SynchronizationFinish'))}
</Text>
<ProgressBar progress={addSystemTiddlersToSQLitePercentage} color={MD3Colors.tertiary40} />
<ProgressBar progress={addFieldsToSQLitePercentage} color={MD3Colors.tertiary50} />
<ProgressBar progress={addTextToSQLitePercentage} color={MD3Colors.tertiary60} />
<ProgressBar animatedValue={addSystemTiddlersToSQLitePercentage} color={MD3Colors.tertiary40} />
<ProgressBar animatedValue={addFieldsToSQLitePercentage} color={MD3Colors.tertiary50} />
<ProgressBar animatedValue={addTextToSQLitePercentage} color={MD3Colors.tertiary60} />
</>
)}
{importStatus === 'success' && createdWikiWorkspace !== undefined && (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/WikiWebView/WikiViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export function WikiViewer({ wikiWorkspace, webviewSideReceiver, quickLoad }: Wi
// TODO: check if webViewKeyToReloadAfterRecycleByOS on component is working. Sometimes the source works, but preload is not applied
return (
<>
<TopProgressBar progress={streamChunksToWebViewPercentage} color={MD3Colors.neutral50} />
<TopProgressBar animatedValue={streamChunksToWebViewPercentage} color={MD3Colors.neutral50} />
<WebViewContainer showProgressBar={showProgressBar}>
<CustomWebView
webViewReference={webViewReference}
Expand Down

0 comments on commit 2550e62

Please sign in to comment.