minor frontend changes to discard responses if route changed

This commit is contained in:
abdulmohsen
2024-08-02 21:14:40 +03:00
parent 8d0746f1f2
commit bf2d822f50
26 changed files with 217 additions and 94 deletions

View File

@@ -67,6 +67,7 @@ import request from '~/utils/request'
import Message from '~/components/Message'
import {notification} from '~/utils/index'
import Confirm from '~/components/Confirm'
import {useSessionCache} from '~/utils/cache'
const error = ref()
const isResetting = ref(false)
@@ -93,6 +94,10 @@ const resetSystem = async () => {
}
}
if (useRoute().name !== 'reset') {
return
}
if (200 !== response.status) {
error.value = json
return
@@ -103,7 +108,7 @@ const resetSystem = async () => {
// -- remove all session storage due to the reset.
try {
Object.keys(sessionStorage).forEach(k => sessionStorage.removeItem(k))
useSessionCache().clear()
} catch (e) {
}
} catch (e) {