fix: update os cancel refresh on update page

This commit is contained in:
Zack Spear
2024-05-09 16:38:32 -07:00
committed by Zack Spear
parent 7d55a1c2cd
commit f0ded9f5be

View File

@@ -79,6 +79,13 @@ export const useUpdateOsStore = defineStore('updateOs', () => {
if (!response.success) {
throw new Error('Unable to cancel update');
}
// if current path is /Tools/Update, then we should redirect to /Tools
// otherwise it will redirect to the account update os page.
if (window.location.pathname === '/Tools/Update') {
window.location.href = '/Tools';
return;
}
// otherwise refresh the page
window.location.reload();
} catch (error) {
throw new Error('[cancelUpdate] Error cancelling update');