forked from ddrilling/asb_cloud_front
rename showLoader
This commit is contained in:
parent
ad0719b54b
commit
68b0827f66
@ -60,8 +60,7 @@ export default function Messages({idWell}) {
|
|||||||
const [range, setRange] = useState([])
|
const [range, setRange] = useState([])
|
||||||
const [categories, setCategories] = useState([])
|
const [categories, setCategories] = useState([])
|
||||||
const [searchString, setSearchString] = useState('')
|
const [searchString, setSearchString] = useState('')
|
||||||
|
const [showLoader, setShowLoader] = useState(false)
|
||||||
const [loader, setLoader] = useState(false)
|
|
||||||
|
|
||||||
const children = filterOptions.map((line) => <Option key={line.value}>{line.label}</Option>)
|
const children = filterOptions.map((line) => <Option key={line.value}>{line.label}</Option>)
|
||||||
|
|
||||||
@ -79,7 +78,7 @@ export default function Messages({idWell}) {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const GetMessages = async () => {
|
const GetMessages = async () => {
|
||||||
setLoader(true)
|
setShowLoader(true)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let begin = null
|
let begin = null
|
||||||
@ -97,7 +96,7 @@ export default function Messages({idWell}) {
|
|||||||
searchString)
|
searchString)
|
||||||
if (paginatedMessages === null){
|
if (paginatedMessages === null){
|
||||||
notify(`Данных по скважине "${idWell}" нет`, 'warning')
|
notify(`Данных по скважине "${idWell}" нет`, 'warning')
|
||||||
setLoader(false)
|
setShowLoader(false)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,7 +117,7 @@ export default function Messages({idWell}) {
|
|||||||
console.log(ex)
|
console.log(ex)
|
||||||
notify(`Не удалось загрузить сообщения по скважине "${idWell}"`, 'error')
|
notify(`Не удалось загрузить сообщения по скважине "${idWell}"`, 'error')
|
||||||
}
|
}
|
||||||
setLoader(false)
|
setShowLoader(false)
|
||||||
}
|
}
|
||||||
GetMessages()
|
GetMessages()
|
||||||
}, [idWell, page, categories, range, searchString])
|
}, [idWell, page, categories, range, searchString])
|
||||||
@ -146,7 +145,7 @@ export default function Messages({idWell}) {
|
|||||||
onSearch={onChangeSearchString}
|
onSearch={onChangeSearchString}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<LoaderPortal show={loader}>
|
<LoaderPortal show={showLoader}>
|
||||||
<Table
|
<Table
|
||||||
columns={columns}
|
columns={columns}
|
||||||
dataSource={messages}
|
dataSource={messages}
|
||||||
|
Loading…
Reference in New Issue
Block a user