Skip to content

Commit b468074

Browse files
authored
fix: replace .substr by .substring (#1891)
License: MIT Signed-off-by: Henrique Dias <[email protected]>
1 parent 6b9d604 commit b468074

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/bundles/files/actions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const cumulativeSize = async (ipfs, cidOrPath) => {
6868
// TODO: use sth else
6969
export const realMfsPath = (path) => {
7070
if (path.startsWith('/files')) {
71-
return path.substr('/files'.length) || '/'
71+
return path.substring('/files'.length) || '/'
7272
}
7373

7474
return path

src/bundles/files/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export const infoFromPath = (path, uriDecode = true) => {
209209
* @param {string} prefix
210210
*/
211211
const check = (prefix) => {
212-
info.realPath = info.path.substr(prefix.length).trim() || '/'
212+
info.realPath = info.path.substring(prefix.length).trim() || '/'
213213
info.isRoot = info.realPath === '/'
214214
}
215215

src/files/modals/Modals.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class Modals extends React.Component {
177177
case cliCmdKeys.ADD_DIRECTORY:
178178
case cliCmdKeys.CREATE_NEW_DIRECTORY:
179179
case cliCmdKeys.FROM_IPFS:
180-
return cliCommandList[action](root.substr('/files'.length))
180+
return cliCommandList[action](root.substring('/files'.length))
181181
case cliCmdKeys.DELETE_FILE_FROM_IPFS:
182182
case cliCmdKeys.REMOVE_FILE_FROM_IPFS:
183183
return cliCommandList[action](path)

0 commit comments

Comments
 (0)