Skip to content

Commit 772471d

Browse files
authored
Merge pull request #57642 from nextcloud/chore/xhr
chore: drop duplicated legacy Ajax error handling
2 parents 2b985ac + 65351bd commit 772471d

13 files changed

+18
-157
lines changed

core/src/OC/index.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,6 @@ import Settings from './settings.js'
7373
import { theme } from './theme.js'
7474
import Util from './util.js'
7575
import webroot from './webroot.js'
76-
import {
77-
ajaxConnectionLostHandler,
78-
processAjaxError,
79-
registerXHRForErrorProcessing,
80-
} from './xhr-error.js'
8176

8277
/** @namespace OC */
8378
export default {
@@ -125,13 +120,11 @@ export default {
125120
L10N,
126121

127122
/**
128-
* Ajax error handlers
123+
* This is already handled by `interceptRequests` in `core/src/init.js`.
129124
*
130-
* @todo remove from here and keep internally -> requires new tests
125+
* @deprecated 33.0.0 - unused by Nextcloud and only a stub remains. Just remove usage.
131126
*/
132-
_ajaxConnectionLostHandler: ajaxConnectionLostHandler,
133-
_processAjaxError: processAjaxError,
134-
registerXHRForErrorProcessing,
127+
registerXHRForErrorProcessing: () => {},
135128

136129
/**
137130
* Capabilities

core/src/OC/xhr-error.js

Lines changed: 0 additions & 102 deletions
This file was deleted.

core/src/init.js

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -67,36 +67,6 @@ export function initCore() {
6767
interceptRequests()
6868
initFallbackClipboardAPI()
6969

70-
$(window).on('unload.main', () => {
71-
OC._unloadCalled = true
72-
})
73-
$(window).on('beforeunload.main', () => {
74-
// super-trick thanks to http://stackoverflow.com/a/4651049
75-
// in case another handler displays a confirmation dialog (ex: navigating away
76-
// during an upload), there are two possible outcomes: user clicked "ok" or
77-
// "cancel"
78-
79-
// first timeout handler is called after unload dialog is closed
80-
setTimeout(() => {
81-
OC._userIsNavigatingAway = true
82-
83-
// second timeout event is only called if user cancelled (Chrome),
84-
// but in other browsers it might still be triggered, so need to
85-
// set a higher delay...
86-
setTimeout(() => {
87-
if (!OC._unloadCalled) {
88-
OC._userIsNavigatingAway = false
89-
}
90-
}, 10000)
91-
}, 1)
92-
})
93-
$(document).on('ajaxError.main', function(event, request, settings) {
94-
if (settings && settings.allowAuthErrors) {
95-
return
96-
}
97-
OC._processAjaxError(request)
98-
})
99-
10070
initSessionHeartBeat()
10171

10272
OC.registerMenu($('#expand'), $('#expanddiv'), false, true)

dist/7883-7883.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/7883-7883.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core-login.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core-login.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core-unsupported-browser-redirect.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)