Skip to content

Commit

Permalink
Merge pull request #701 from uploadcare/fix/remote-tab
Browse files Browse the repository at this point in the history
Fix remote tab
  • Loading branch information
bautrukevich authored Feb 10, 2020
2 parents 05e6b4f + 5fcc359 commit 9aae5a4
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/widget/tabs/remote-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { registerMessage, unregisterMessage } from '../../utils/messages'
import { warn, debug } from '../../utils/warnings'
import { globRegexp, parseHTML } from '../../utils'
import { html } from '../../utils/html'
import { UrlFile } from '../../files/url'

import { version } from '../../../package.json'
import WidgetFile from '../../file'

class RemoteTab {
constructor(container, tabButton, dialogApi, settings, name1) {
Expand Down Expand Up @@ -92,14 +92,10 @@ class RemoteTab {
return message.url
})()

const sourceInfo = Object.assign(
{
source: this.name
},
message.info || {}
)

const file = new UrlFile(url, this.settings, sourceInfo)
const file = new WidgetFile(url, {
...this.settings,
source: this.name
})

if (message.filename) {
file.setName(message.filename)
Expand All @@ -109,7 +105,7 @@ class RemoteTab {
file.setIsImage(message.is_image)
}

this.dialogApi.addFiles([file.promise()])
this.dialogApi.addFiles([file])
})

registerMessage('open-new-window', iframe, message => {
Expand Down

0 comments on commit 9aae5a4

Please sign in to comment.