You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-26 22:41:17 +02:00
All: Fixes 12810: Ensure the sync shows an error when the server is down, when using a local WebDAV server (#13301)
This commit is contained in:
@@ -53,6 +53,11 @@ export const getSupportsDeltaWithItems = (deltaResponse: PaginatedList) => {
|
||||
return 'jopItem' in deltaResponse.items[0];
|
||||
};
|
||||
|
||||
export const isLocalServer = (url: string) => {
|
||||
const regex = /^(https?:\/\/)?(localhost|127(?:\.\d{1,3}){3}|\[::1\])(?::\d{1,5})?(\/.*)?$/i;
|
||||
return regex.test(url);
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
function requestCanBeRepeated(error: any) {
|
||||
const errorCode = typeof error === 'object' && error.code ? error.code : null;
|
||||
|
||||
Reference in New Issue
Block a user