Skip to content

Commit

Permalink
Remove deprecation on open method
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>
  • Loading branch information
skjnldsv committed Aug 2, 2021
1 parent 1be291a commit 3534262
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/services/Viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,8 @@ export default class Viewer {
* @param {Function} options.onClose callback when closing the viewer
*/
open({ path, list = [], loadMore = () => ([]), canLoop = true, onPrev = () => {}, onNext = () => {}, onClose = () => {} } = {}) {
// TODO: remove legacy method in NC 20 ?
if (typeof arguments[0] === 'string') {
path = arguments[0]
console.warn('Opening the viewer with a single string parameter is deprecated. Please use a destructuring object instead', `OCA.Viewer.open({ path: '${path}' })`)
throw new Error('Opening the viewer with a single string parameter is deprecated. Please use a destructuring object instead', `OCA.Viewer.open({ path: '${path}' })`)
}

if (!path.startsWith('/')) {
Expand Down

0 comments on commit 3534262

Please sign in to comment.