feat: move from life cycle to data or watcher
- remove from created / mounted - initialize component services in data - use immediate watcher where appropriate - deep watch for route changes
This commit is contained in:

committed by
kolaente

parent
ebeca48be4
commit
f51371bbe0
@ -76,7 +76,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
passwordResetService: PasswordResetService,
|
||||
passwordResetService: new PasswordResetService(),
|
||||
credentials: {
|
||||
password: '',
|
||||
password2: '',
|
||||
@ -85,9 +85,6 @@ export default {
|
||||
successMessage: '',
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.passwordResetService = new PasswordResetService()
|
||||
},
|
||||
mounted() {
|
||||
this.setTitle(this.$t('user.auth.resetPassword'))
|
||||
},
|
||||
|
@ -59,16 +59,12 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
passwordResetService: PasswordResetService,
|
||||
passwordReset: PasswordResetModel,
|
||||
passwordResetService: new PasswordResetService(),
|
||||
passwordReset: new PasswordResetModel(),
|
||||
errorMsg: '',
|
||||
isSuccess: false,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.passwordResetService = new PasswordResetService()
|
||||
this.passwordReset = new PasswordResetModel()
|
||||
},
|
||||
mounted() {
|
||||
this.setTitle(this.$t('user.auth.resetPassword'))
|
||||
},
|
||||
|
@ -302,15 +302,15 @@ export default {
|
||||
name: 'Settings',
|
||||
data() {
|
||||
return {
|
||||
passwordUpdateService: PasswordUpdateService,
|
||||
passwordUpdate: PasswordUpdateModel,
|
||||
passwordUpdateService: new PasswordUpdateService(),
|
||||
passwordUpdate: new PasswordUpdateModel(),
|
||||
passwordConfirm: '',
|
||||
|
||||
emailUpdateService: EmailUpdateService,
|
||||
emailUpdate: EmailUpdateModel,
|
||||
emailUpdateService: new EmailUpdateService(),
|
||||
emailUpdate: new EmailUpdateModel(),
|
||||
|
||||
totpService: TotpService,
|
||||
totp: TotpModel,
|
||||
totpService: new TotpService(),
|
||||
totp: new TotpModel(),
|
||||
totpQR: '',
|
||||
totpEnrolled: false,
|
||||
totpConfirmPasscode: '',
|
||||
@ -320,7 +320,7 @@ export default {
|
||||
language: getCurrentLanguage(),
|
||||
|
||||
settings: UserSettingsModel,
|
||||
userSettingsService: UserSettingsService,
|
||||
userSettingsService: new UserSettingsService(),
|
||||
|
||||
defaultList: null,
|
||||
}
|
||||
@ -332,16 +332,6 @@ export default {
|
||||
DataExport,
|
||||
},
|
||||
created() {
|
||||
this.passwordUpdateService = new PasswordUpdateService()
|
||||
this.passwordUpdate = new PasswordUpdateModel()
|
||||
|
||||
this.emailUpdateService = new EmailUpdateService()
|
||||
this.emailUpdate = new EmailUpdateModel()
|
||||
|
||||
this.totpService = new TotpService()
|
||||
this.totp = new TotpModel()
|
||||
|
||||
this.userSettingsService = new UserSettingsService()
|
||||
this.settings = this.$store.state.auth.settings
|
||||
|
||||
this.playSoundWhenDone = localStorage.getItem(playSoundWhenDoneKey) === 'true' || localStorage.getItem(playSoundWhenDoneKey) === null
|
||||
|
Reference in New Issue
Block a user