@@ -56,7 +56,9 @@ export const setCurrentBandwidthSetting = (newRate) => {
56
56
* @returns {Function }
57
57
*/
58
58
export const createNewPublicLink = ( remoteName , remotePath ) => {
59
- remoteName = tools . addColonAtLast ( remoteName ) ;
59
+ if ( ! isLocalRemoteName ( remoteName ) ) {
60
+ fs = addColonAtLast ( remoteName ) ;
61
+ }
60
62
return new Promise ( ( resolve , reject ) => {
61
63
axiosInstance . post ( urls . createPublicLink , { fs : remoteName , remote : remotePath } ) . then ( res => {
62
64
resolve ( res . data ) ;
@@ -123,11 +125,13 @@ export const getFsInfo = (remoteName) => {
123
125
export const getFilesList = ( fs , remotePath ) => {
124
126
return new Promise ( ( resolve , reject ) => {
125
127
if ( ! fs || fs === "" ) {
126
- reject ( "Invalid fs specified" )
128
+ reject ( "Invalid fs specified" ) ;
129
+ return ;
127
130
}
128
131
129
- // check if it is a local path
130
- fs = fs . indexOf ( '/' ) !== 0 ? addColonAtLast ( fs ) : fs ;
132
+ if ( ! isLocalRemoteName ( fs ) ) {
133
+ fs = addColonAtLast ( fs ) ;
134
+ }
131
135
132
136
axiosInstance . post ( urls . getFilesList , {
133
137
fs,
@@ -150,8 +154,8 @@ export const getRemoteInfo = (remoteName) => {
150
154
return new Promise ( ( resolve , reject ) => {
151
155
152
156
if ( ! remoteName ) {
153
- reject ( "Invalid remote name specified" )
154
- return
157
+ reject ( "Invalid remote name specified" ) ;
158
+ return ;
155
159
}
156
160
157
161
if ( ! isLocalRemoteName ( remoteName ) ) {
@@ -219,6 +223,9 @@ export const getJobStatus = (jobId) => {
219
223
* @return {Promise<unknown> }
220
224
*/
221
225
export const purgeDir = ( fs , remote ) => {
226
+ if ( ! isLocalRemoteName ( fs ) ) {
227
+ fs = addColonAtLast ( fs ) ;
228
+ }
222
229
return new Promise ( ( resolve , reject ) => {
223
230
axiosInstance . post ( urls . purge , {
224
231
fs,
@@ -239,7 +246,9 @@ export const purgeDir = (fs , remote) => {
239
246
* @return {Promise<unknown> }
240
247
*/
241
248
export const deleteFile = ( fs , remote ) => {
242
- fs = addColonAtLast ( fs )
249
+ if ( ! isLocalRemoteName ( fs ) ) {
250
+ fs = addColonAtLast ( fs ) ;
251
+ }
243
252
return new Promise ( ( resolve , reject ) => {
244
253
axiosInstance . post ( urls . deleteFile , {
245
254
fs,
0 commit comments