-
Notifications
You must be signed in to change notification settings - Fork 970
Saving a document doesn't show correct origin #8786
Conversation
@@ -73,6 +73,8 @@ class DownloadItem extends ImmutableComponent { | |||
} | |||
render () { | |||
const origin = getOrigin(this.props.download.get('url')) | |||
const localFileOrigins = ['file:', 'blob:', 'data:', 'chrome-extension:', 'chrome:'] | |||
const localFile = localFileOrigins.some((localFileOrigin) => origin.startsWith(localFileOrigin)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should check that origin is not null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean like this: origin && localFileOrigins.some((localFileOrigin) => origin.startsWith(localFileOrigin))
@diracdeltas
@@ -160,7 +162,7 @@ class DownloadItem extends ImmutableComponent { | |||
? <span className='fa fa-unlock isInsecure' /> | |||
: null | |||
} | |||
<span title={origin}>{origin}</span> | |||
<span title={origin}>{localFile ? 'Local file' : origin}</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add translation here
}) | ||
}) | ||
|
||
Object.values(downloadStates).forEach(function (state) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that you could do this tests insider previous forEach
c2de975
to
277074e
Compare
@diracdeltas @NejcZdovc review? |
@kumarrishav great job on this 😄 |
git rebase -i
to squash commits (if needed).Fix #8698
Test Plan:
Open browser
Download file having orgin file:/// or chrome-extension: or other local origin.
It should show text 'Local file' for local origin file/