From 7efe153b0bc23e596d5019b9fb3e3e32b6cfeccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9as=20Livet?= Date: Tue, 19 Dec 2017 10:45:49 +0100 Subject: Enh #106 : Add an autoPlayVideo user attribute (#159) Warning : I was not able to run the tests on my machine. It uses a different approach to handle databse connexion and didn't find where to configure it... - create a migration file to add a boolean column in user table - add autoPlayVideo attribute everywhere it is needed (both on client and server side) - add tests - add a way to configure this attribute in account-settings - use the attribute in video-watch component to actually autoplay or not the video --- .../account-settings/account-details/account-details.component.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'client/src/app/account/account-settings/account-details/account-details.component.ts') diff --git a/client/src/app/account/account-settings/account-details/account-details.component.ts b/client/src/app/account/account-settings/account-details/account-details.component.ts index d835c53e5..b8c19d8d6 100644 --- a/client/src/app/account/account-settings/account-details/account-details.component.ts +++ b/client/src/app/account/account-settings/account-details/account-details.component.ts @@ -31,7 +31,8 @@ export class AccountDetailsComponent extends FormReactive implements OnInit { buildForm () { this.form = this.formBuilder.group({ - displayNSFW: [ this.user.displayNSFW ] + displayNSFW: [ this.user.displayNSFW ], + autoPlayVideo: [ this.user.autoPlayVideo ] }) this.form.valueChanges.subscribe(data => this.onValueChanged(data)) @@ -43,8 +44,10 @@ export class AccountDetailsComponent extends FormReactive implements OnInit { updateDetails () { const displayNSFW = this.form.value['displayNSFW'] + const autoPlayVideo = this.form.value['autoPlayVideo'] const details: UserUpdateMe = { - displayNSFW + displayNSFW, + autoPlayVideo } this.error = null -- cgit v1.2.3