mirror of
				https://github.com/KevinMidboe/immich.git
				synced 2025-10-29 17:40:28 +00:00 
			
		
		
		
	chore(web): use axios isCancel function (#4227)
Use of this function should be more idiomatic and reliable - it's much less likely for changes to Axios to cause regressions.
This commit is contained in:
		@@ -1,5 +1,5 @@
 | 
			
		||||
import type { ApiError } from '@api';
 | 
			
		||||
import * as axios from 'axios';
 | 
			
		||||
import axios from 'axios';
 | 
			
		||||
import { notificationController, NotificationType } from '../components/shared-components/notification/notification';
 | 
			
		||||
 | 
			
		||||
export async function getServerErrorMessage(error: unknown) {
 | 
			
		||||
@@ -17,7 +17,7 @@ export async function getServerErrorMessage(error: unknown) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export async function handleError(error: unknown, message: string) {
 | 
			
		||||
  if (error instanceof axios.CanceledError) {
 | 
			
		||||
  if (axios.isCancel(error)) {
 | 
			
		||||
    return;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user