Skip to content

Commit 439f825

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 f4e8cd1 commit 439f825

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
@@ -64,7 +64,6 @@ import {
6464
} from './menu.js'
6565
import * as MimeType from './mimeType.js'
6666
import msg from './msg.js'
67-
import { redirect, reload } from './navigation.js'
6867
import Notification from './notification.js'
6968
import PasswordConfirmation from './password-confirmation.js'
7069
import Plugins from './plugins.js'
@@ -241,8 +240,6 @@ export default {
241240
* @deprecated 19.0.0 use `imagePath` from https://www.npmjs.com/package/@nextcloud/router
242241
*/
243242
imagePath,
244-
redirect,
245-
reload,
246243
requestToken: getRequestToken(),
247244
/**
248245
* @deprecated 19.0.0 use `linkTo` from https://www.npmjs.com/package/@nextcloud/router
@@ -281,5 +278,5 @@ subscribe('csrf-token-update', (e) => {
281278
OC.requestToken = e.token
282279

283280
// Logging might help debug (Sentry) issues
284-
logger.info('OC.requestToken changed', { token: e.token})
281+
logger.info('OC.requestToken changed', { token: e.token })
285282
})

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)