mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-28 23:09:46 -05:00
Merge pull request #3448 from CommanderRoot/refactor/rm-deprecated-substr
refactor: replace deprecated String.prototype.substr()
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
Enhancement: Replace deprecated String.prototype.substr()
|
||||
|
||||
We've replaced all occurrences of the deprecated String.prototype.substr()
|
||||
function with String.prototype.slice() which works similarly but isn't
|
||||
deprecated.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3448
|
||||
@@ -85,7 +85,7 @@ function Chooseaccount({ loading, errors, classes, hello, history, dispatch }) {
|
||||
className={classes.accountListItem}
|
||||
disabled={!!loading}
|
||||
onClick={(event) => logon(event)}
|
||||
><ListItemAvatar><Avatar>{username.substr(0, 1)}</Avatar></ListItemAvatar>
|
||||
><ListItemAvatar><Avatar>{username.slice(0, 1)}</Avatar></ListItemAvatar>
|
||||
<ListItemText className="oc-light" primary={username} />
|
||||
</ListItem>
|
||||
<ListItem
|
||||
|
||||
@@ -14,7 +14,7 @@ const envPublicUrl = process.env.PUBLIC_URL;
|
||||
function ensureSlash(inputPath, needsSlash) {
|
||||
const hasSlash = inputPath.endsWith('/');
|
||||
if (hasSlash && !needsSlash) {
|
||||
return inputPath.substr(0, inputPath.length - 1);
|
||||
return inputPath.slice(0, -1);
|
||||
} else if (!hasSlash && needsSlash) {
|
||||
return `${inputPath}/`;
|
||||
} else {
|
||||
|
||||
@@ -49,7 +49,7 @@ export default {
|
||||
methods: {
|
||||
...mapActions('Settings', ['saveValue']),
|
||||
getSettingComponent (setting) {
|
||||
return 'Setting' + setting.type[0].toUpperCase() + setting.type.substr(1)
|
||||
return 'Setting' + setting.type[0].toUpperCase() + setting.type.slice(1)
|
||||
},
|
||||
getValue (setting) {
|
||||
return this.getSettingsValue({ settingId: setting.id })
|
||||
|
||||
Reference in New Issue
Block a user