Skip to content

Commit 5622b97

Browse files
committed
chore: remove deprecated OC.redirect and OC.reload
- Deprecated since Nextcloud 17 To replace `OC.redirect` directly use `window.location`. To replace `OC.reload` directly use `window.location.reload`. Signed-off-by: Ferdinand Thiessen <[email protected]>
1 parent 9e1ed70 commit 5622b97

File tree

4 files changed

+4
-27
lines changed

4 files changed

+4
-27
lines changed

core/js/update.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@
100100
}
101101

102102
setTimeout(function() {
103-
OC.redirect(window.location.href)
103+
window.location = window.location.href
104+
window.location.reload()
104105
}, 3000)
105106
}
106107
})

core/src/OC/index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ import {
6565
} from './menu.js'
6666
import * as MimeType from './mimeType.js'
6767
import msg from './msg.js'
68-
import { redirect, reload } from './navigation.js'
6968
import Notification from './notification.js'
7069
import PasswordConfirmation from './password-confirmation.js'
7170
import Plugins from './plugins.js'
@@ -250,8 +249,6 @@ export default {
250249
* @deprecated 19.0.0 use `imagePath` from https://www.npmjs.com/package/@nextcloud/router
251250
*/
252251
imagePath,
253-
redirect,
254-
reload,
255252
requestToken: getRequestToken(),
256253
/**
257254
* @deprecated 19.0.0 use `linkTo` from https://www.npmjs.com/package/@nextcloud/router
@@ -290,5 +287,5 @@ subscribe('csrf-token-update', (e) => {
290287
OC.requestToken = e.token
291288

292289
// Logging might help debug (Sentry) issues
293-
logger.info('OC.requestToken changed', { token: e.token})
290+
logger.info('OC.requestToken changed', { token: e.token })
294291
})

core/src/OC/navigation.js

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

core/src/OC/xhr-error.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function processAjaxError(xhr) {
4646
Notification.showUpdate(n('core', 'Problem loading page, reloading in %n second', 'Problem loading page, reloading in %n seconds', seconds - timer))
4747
if (timer >= seconds) {
4848
clearInterval(interval)
49-
OC.reload()
49+
window.location.reload()
5050
}
5151
timer++
5252
},

0 commit comments

Comments
 (0)