@@ -56,7 +56,9 @@ export const setCurrentBandwidthSetting = (newRate) => {
5656 * @returns {Function }
5757 */
5858export const createNewPublicLink = ( remoteName , remotePath ) => {
59- remoteName = tools . addColonAtLast ( remoteName ) ;
59+ if ( ! isLocalRemoteName ( remoteName ) ) {
60+ fs = addColonAtLast ( remoteName ) ;
61+ }
6062 return new Promise ( ( resolve , reject ) => {
6163 axiosInstance . post ( urls . createPublicLink , { fs : remoteName , remote : remotePath } ) . then ( res => {
6264 resolve ( res . data ) ;
@@ -123,11 +125,13 @@ export const getFsInfo = (remoteName) => {
123125export const getFilesList = ( fs , remotePath ) => {
124126 return new Promise ( ( resolve , reject ) => {
125127 if ( ! fs || fs === "" ) {
126- reject ( "Invalid fs specified" )
128+ reject ( "Invalid fs specified" ) ;
129+ return ;
127130 }
128131
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+ }
131135
132136 axiosInstance . post ( urls . getFilesList , {
133137 fs,
@@ -150,8 +154,8 @@ export const getRemoteInfo = (remoteName) => {
150154 return new Promise ( ( resolve , reject ) => {
151155
152156 if ( ! remoteName ) {
153- reject ( "Invalid remote name specified" )
154- return
157+ reject ( "Invalid remote name specified" ) ;
158+ return ;
155159 }
156160
157161 if ( ! isLocalRemoteName ( remoteName ) ) {
@@ -219,6 +223,9 @@ export const getJobStatus = (jobId) => {
219223 * @return {Promise<unknown> }
220224 */
221225export const purgeDir = ( fs , remote ) => {
226+ if ( ! isLocalRemoteName ( fs ) ) {
227+ fs = addColonAtLast ( fs ) ;
228+ }
222229 return new Promise ( ( resolve , reject ) => {
223230 axiosInstance . post ( urls . purge , {
224231 fs,
@@ -239,7 +246,9 @@ export const purgeDir = (fs , remote) => {
239246 * @return {Promise<unknown> }
240247 */
241248export const deleteFile = ( fs , remote ) => {
242- fs = addColonAtLast ( fs )
249+ if ( ! isLocalRemoteName ( fs ) ) {
250+ fs = addColonAtLast ( fs ) ;
251+ }
243252 return new Promise ( ( resolve , reject ) => {
244253 axiosInstance . post ( urls . deleteFile , {
245254 fs,
0 commit comments