Commit c784190 Pompurin404
committed
1 parent 196367a commit c784190 Copy full SHA for c784190
File tree 2 files changed +3
-5
lines changed
2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ export async function createProfile(item: Partial<IProfileItem>): Promise<IProfi
104
104
const id = item . id || new Date ( ) . getTime ( ) . toString ( 16 )
105
105
const newItem = {
106
106
id,
107
- name : item . name || 'Local File' ,
107
+ name : item . name || item . type === 'remote' ? 'Remote File' : 'Local File' ,
108
108
type : item . type || 'local' ,
109
109
url : item . url ,
110
110
interval : item . interval || 0 ,
@@ -134,7 +134,7 @@ export async function createProfile(item: Partial<IProfileItem>): Promise<IProfi
134
134
} )
135
135
const data = res . data
136
136
const headers = res . headers
137
- if ( headers [ 'content-disposition' ] ) {
137
+ if ( headers [ 'content-disposition' ] && newItem . name === 'Remote File' ) {
138
138
newItem . name = parseFilename ( headers [ 'content-disposition' ] )
139
139
}
140
140
if ( headers [ 'profile-web-page-url' ] ) {
Original file line number Diff line number Diff line change @@ -21,9 +21,7 @@ const Profiles: React.FC = () => {
21
21
const handleImport = async ( ) : Promise < void > => {
22
22
setImporting ( true )
23
23
try {
24
- await addProfileItem ( { name : 'Remote File' , type : 'remote' , url } )
25
- } catch ( e ) {
26
- console . error ( e )
24
+ await addProfileItem ( { name : '' , type : 'remote' , url } )
27
25
} finally {
28
26
setImporting ( false )
29
27
}
You can’t perform that action at this time.
0 commit comments