refactor app status provider, adding loading texts

This commit is contained in:
Vitaly Turovsky 2024-06-18 03:47:20 +03:00
commit 18c693dabc
3 changed files with 13 additions and 6 deletions

View file

@ -0,0 +1,12 @@
export const guessProblem = (errorMessage: string) => {
if (errorMessage.endsWith('Socket error: ECONNREFUSED')) {
return 'Most probably the server is not running.'
}
}
export const loadingTexts = [
'Like the project? Give us a star on GitHub or rate us on AlternativeTo!',
'To stay updated with the latest changes, go to the GitHub page, click on "Watch", choose "Custom", and then opt for "Releases"!',
'Upvote features on GitHub issues to help us prioritize them!',
'Want to contribute to the project? Check out Contributing.md on GitHub!',
]

View file

@ -1,5 +0,0 @@
export const guessProblem = (errorMessage: string) => {
if (errorMessage.endsWith('Socket error: ECONNREFUSED')) {
return 'Most probably the server is not running.'
}
}

View file

@ -3,7 +3,7 @@ import { useEffect } from 'react'
import { activeModalStack, activeModalStacks, hideModal, insertActiveModalStack, miscUiState } from '../globalState'
import { resetLocalStorageWorld } from '../browserfs'
import { fsState } from '../loadSave'
import { guessProblem } from '../guessProblem'
import { guessProblem } from '../errorLoadingScreenHelpers'
import AppStatus from './AppStatus'
import DiveTransition from './DiveTransition'
import { useDidUpdateEffect } from './utils'