mirror of
https://github.com/balzack/databag.git
synced 2025-04-24 02:25:26 +00:00
delinting web app
This commit is contained in:
parent
55b1f98263
commit
f3b839f96b
@ -27,10 +27,11 @@ export function Access() {
|
||||
await actions.adminLogin()
|
||||
}
|
||||
otpClose()
|
||||
} catch (err: any) {
|
||||
console.log(err.message)
|
||||
if (err.message === '405' || err.message === '403' || err.message === '429') {
|
||||
if (err.message === '429') {
|
||||
} catch (err) {
|
||||
const { message } = err as { message: string }
|
||||
console.log(message)
|
||||
if (message === '405' || message === '403' || message === '429') {
|
||||
if (message === '429') {
|
||||
setDisabled(true)
|
||||
} else {
|
||||
setDisabled(false)
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Text } from '@mantine/core'
|
||||
import React from 'react'
|
||||
import { useContacts } from './useContacts.hook'
|
||||
import { UnstyledButton, ActionIcon, TextInput, Button } from '@mantine/core'
|
||||
import { ActionIcon, TextInput, Button } from '@mantine/core'
|
||||
import { IconSearch, IconUserPlus, IconSortAscending, IconSortDescending, IconMessage2, IconPhone } from '@tabler/icons-react'
|
||||
import classes from './Contacts.module.css'
|
||||
import { Card } from '../card/Card'
|
||||
|
@ -2,7 +2,7 @@ import { useState, useContext, useEffect } from 'react'
|
||||
import { AppContext } from '../context/AppContext'
|
||||
import { DisplayContext } from '../context/DisplayContext'
|
||||
import { ContextType } from '../context/ContextType'
|
||||
import { Card, Channel } from 'databag-client-sdk'
|
||||
import { Card } from 'databag-client-sdk'
|
||||
|
||||
export function useContacts() {
|
||||
const app = useContext(AppContext) as ContextType
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { useState, useEffect, useRef } from 'react'
|
||||
import { DatabagSDK, Params, Session } from 'databag-client-sdk'
|
||||
import { DatabagSDK, Session } from 'databag-client-sdk'
|
||||
import { SessionStore } from '../SessionStore'
|
||||
import { WebCrypto } from '../WebCrypto'
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import React, { useState, useEffect } from 'react'
|
||||
import React, { useState } from 'react'
|
||||
import { useProfile } from './useProfile.hook'
|
||||
import classes from './Profile.module.css'
|
||||
import { modals } from '@mantine/modals'
|
||||
@ -18,7 +18,7 @@ import {
|
||||
IconCancel,
|
||||
IconDeviceFloppy,
|
||||
} from '@tabler/icons-react'
|
||||
import { Text, Image, ActionIcon, Button } from '@mantine/core'
|
||||
import { Text, Image, ActionIcon } from '@mantine/core'
|
||||
|
||||
export type ProfileParams = {
|
||||
guid: string
|
||||
|
@ -1,7 +1,8 @@
|
||||
import React from 'react'
|
||||
import { useRegistry } from './useRegistry.hook'
|
||||
import { TextInput } from '@mantine/core'
|
||||
import classes from './Registry.module.css'
|
||||
import { IconX, IconArrowLeft, IconServer, IconUser } from '@tabler/icons-react'
|
||||
import { IconX, IconServer, IconUser } from '@tabler/icons-react'
|
||||
import { Card } from '../card/Card'
|
||||
import { ProfileParams } from '../profile/Profile'
|
||||
|
||||
|
@ -169,10 +169,11 @@ export function Settings({ showLogout }: { showLogout: boolean }) {
|
||||
try {
|
||||
await actions.confirmMFA()
|
||||
mfaClose()
|
||||
} catch (err: any) {
|
||||
if (err.message === '401') {
|
||||
} catch (err) {
|
||||
const { message } = err as { message: string }
|
||||
if (message === '401') {
|
||||
setAuthMessage(state.strings.mfaError)
|
||||
} else if (err.message === '429') {
|
||||
} else if (message === '429') {
|
||||
setAuthMessage(state.strings.mfaDisabled)
|
||||
} else {
|
||||
setAuthMessage(`${state.strings.error}: ${state.strings.tryAgain}`)
|
||||
|
Loading…
x
Reference in New Issue
Block a user