mirror of
https://github.com/nextcloud/server.git
synced 2026-04-21 06:08:46 -04:00
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 <opensource@fthiessen.de>
This commit is contained in:
parent
f4e8cd13a4
commit
439f825774
4 changed files with 4 additions and 27 deletions
|
|
@ -100,7 +100,8 @@
|
|||
}
|
||||
|
||||
setTimeout(function() {
|
||||
OC.redirect(window.location.href)
|
||||
window.location = window.location.href
|
||||
window.location.reload()
|
||||
}, 3000)
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -64,7 +64,6 @@ import {
|
|||
} from './menu.js'
|
||||
import * as MimeType from './mimeType.js'
|
||||
import msg from './msg.js'
|
||||
import { redirect, reload } from './navigation.js'
|
||||
import Notification from './notification.js'
|
||||
import PasswordConfirmation from './password-confirmation.js'
|
||||
import Plugins from './plugins.js'
|
||||
|
|
@ -241,8 +240,6 @@ export default {
|
|||
* @deprecated 19.0.0 use `imagePath` from https://www.npmjs.com/package/@nextcloud/router
|
||||
*/
|
||||
imagePath,
|
||||
redirect,
|
||||
reload,
|
||||
requestToken: getRequestToken(),
|
||||
/**
|
||||
* @deprecated 19.0.0 use `linkTo` from https://www.npmjs.com/package/@nextcloud/router
|
||||
|
|
@ -281,5 +278,5 @@ subscribe('csrf-token-update', (e) => {
|
|||
OC.requestToken = e.token
|
||||
|
||||
// Logging might help debug (Sentry) issues
|
||||
logger.info('OC.requestToken changed', { token: e.token})
|
||||
logger.info('OC.requestToken changed', { token: e.token })
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
/**
|
||||
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @param targetURL
|
||||
*/
|
||||
export function redirect(targetURL) {
|
||||
window.location = targetURL
|
||||
}
|
||||
|
||||
/**
|
||||
* Reloads the current page
|
||||
*
|
||||
* @deprecated 17.0.0 use window.location.reload directly
|
||||
*/
|
||||
export function reload() {
|
||||
window.location.reload()
|
||||
}
|
||||
|
|
@ -46,7 +46,7 @@ export function processAjaxError(xhr) {
|
|||
Notification.showUpdate(n('core', 'Problem loading page, reloading in %n second', 'Problem loading page, reloading in %n seconds', seconds - timer))
|
||||
if (timer >= seconds) {
|
||||
clearInterval(interval)
|
||||
OC.reload()
|
||||
window.location.reload()
|
||||
}
|
||||
timer++
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue