mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 05:00:30 +08:00
add update animation
This commit is contained in:
parent
f596888e12
commit
d7af082a03
@ -28,6 +28,7 @@ const Profiles: React.FC = () => {
|
|||||||
const { current, items = [] } = profileConfig || {}
|
const { current, items = [] } = profileConfig || {}
|
||||||
const [sortedItems, setSortedItems] = useState(items)
|
const [sortedItems, setSortedItems] = useState(items)
|
||||||
const [importing, setImporting] = useState(false)
|
const [importing, setImporting] = useState(false)
|
||||||
|
const [updating, setUpdating] = useState(false)
|
||||||
const [fileOver, setFileOver] = useState(false)
|
const [fileOver, setFileOver] = useState(false)
|
||||||
const [url, setUrl] = useState('')
|
const [url, setUrl] = useState('')
|
||||||
const sensors = useSensors(useSensor(PointerSensor))
|
const sensors = useSensors(useSensor(PointerSensor))
|
||||||
@ -101,7 +102,9 @@ const Profiles: React.FC = () => {
|
|||||||
<Button
|
<Button
|
||||||
size="sm"
|
size="sm"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
isLoading={updating}
|
||||||
onPress={async () => {
|
onPress={async () => {
|
||||||
|
setUpdating(true)
|
||||||
for (const item of items) {
|
for (const item of items) {
|
||||||
if (item.id === current) continue
|
if (item.id === current) continue
|
||||||
if (item.type !== 'remote') continue
|
if (item.type !== 'remote') continue
|
||||||
@ -111,6 +114,7 @@ const Profiles: React.FC = () => {
|
|||||||
if (currentItem && currentItem.type === 'remote') {
|
if (currentItem && currentItem.type === 'remote') {
|
||||||
await addProfileItem(currentItem)
|
await addProfileItem(currentItem)
|
||||||
}
|
}
|
||||||
|
setUpdating(false)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
更新全部订阅
|
更新全部订阅
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user