Skip to content

Commit 2356dc9

Browse files
authored
Merge pull request #936 from nextcloud/fix/open-deprecation
Remove deprecation on open method
2 parents 1be291a + 5595638 commit 2356dc9

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

js/viewer-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/viewer-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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)