mirror of
https://github.com/Lifeforge-app/lifeforge.git
synced 2026-06-28 06:46:24 +00:00
refactor: codebase linting
This commit is contained in:
@@ -58,7 +58,8 @@ export function APIOnlineStatusProvider({
|
||||
}) {
|
||||
const apiEndpoint = useAPIEndpoint()
|
||||
const [isOnline, setIsOnline] = useState<boolean | 'loading'>('loading')
|
||||
const [environment, setEnvironment] = useState<
|
||||
|
||||
const [environment, setEnvironment] = useState<
|
||||
'production' | 'development' | null
|
||||
>(null)
|
||||
const handleRetry = useCallback(() => {
|
||||
|
||||
@@ -68,7 +68,8 @@ export function AuthProvider({
|
||||
const [userData, setUserData] = useState<UserData | null>(null)
|
||||
const [authLoading, setAuthLoading] = useState(true)
|
||||
const tid = useRef('')
|
||||
const setAuth = useCallback(
|
||||
|
||||
const setAuth = useCallback(
|
||||
(value: boolean) => {
|
||||
_setAuth(value)
|
||||
},
|
||||
|
||||
@@ -25,7 +25,8 @@ export function EncryptionProvider({
|
||||
}: EncryptionProviderProps) {
|
||||
const [ready, setReady] = useState(hasServerPublicKey())
|
||||
const [error, setError] = useState<string | null>(null)
|
||||
useEffect(() => {
|
||||
|
||||
useEffect(() => {
|
||||
if (ready) return
|
||||
|
||||
initializeEncryption(apiHost)
|
||||
|
||||
@@ -21,7 +21,8 @@ export interface SocketEvent<
|
||||
export function SocketProvider({ children }: { children: React.ReactNode }) {
|
||||
const apiHost = useAPIEndpoint()
|
||||
const [socket, setSocket] = useState<Socket | null>(null)
|
||||
useEffect(() => {
|
||||
|
||||
useEffect(() => {
|
||||
const newSocket = io(apiHost, {
|
||||
auth: {
|
||||
token: localStorage.getItem('session')
|
||||
|
||||
@@ -6,7 +6,8 @@ export function usePromiseLoading<T extends any[]>(
|
||||
onError?: (error: unknown) => void
|
||||
): [boolean, (...args: T) => Promise<void>] {
|
||||
const [isLoading, setIsLoading] = useState(false)
|
||||
const onClick = useCallback(
|
||||
|
||||
const onClick = useCallback(
|
||||
async (...args: T) => {
|
||||
setIsLoading(true)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user