Skip to content

Commit 3534262

Browse files
committed
Remove deprecation on open method
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>
1 parent 1be291a commit 3534262

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/services/Viewer.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,8 @@ export default class Viewer {
164164
* @param {Function} options.onClose callback when closing the viewer
165165
*/
166166
open({ path, list = [], loadMore = () => ([]), canLoop = true, onPrev = () => {}, onNext = () => {}, onClose = () => {} } = {}) {
167-
// TODO: remove legacy method in NC 20 ?
168167
if (typeof arguments[0] === 'string') {
169-
path = arguments[0]
170-
console.warn('Opening the viewer with a single string parameter is deprecated. Please use a destructuring object instead', `OCA.Viewer.open({ path: '${path}' })`)
168+
throw new Error('Opening the viewer with a single string parameter is deprecated. Please use a destructuring object instead', `OCA.Viewer.open({ path: '${path}' })`)
171169
}
172170

173171
if (!path.startsWith('/')) {

0 commit comments

Comments
 (0)