From 565bf308aedee0fc845a8fb1c1b8de93961f0232 Mon Sep 17 00:00:00 2001 From: diminator Date: Wed, 2 Dec 2015 21:42:35 +0100 Subject: [PATCH] tested and fixed ikonotv --- .../components/ikonotv/ikonotv_register_piece.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/js/components/whitelabel/wallet/components/ikonotv/ikonotv_register_piece.js b/js/components/whitelabel/wallet/components/ikonotv/ikonotv_register_piece.js index 16d893b7..c6f59a53 100644 --- a/js/components/whitelabel/wallet/components/ikonotv/ikonotv_register_piece.js +++ b/js/components/whitelabel/wallet/components/ikonotv/ikonotv_register_piece.js @@ -16,6 +16,9 @@ import UserActions from '../../../../../actions/user_actions'; import PieceStore from '../../../../../stores/piece_store'; import PieceActions from '../../../../../actions/piece_actions'; +import WhitelabelActions from '../../../../../actions/whitelabel_actions'; +import WhitelabelStore from '../../../../../stores/whitelabel_store'; + import GlobalNotificationModel from '../../../../../models/global_notification_model'; import GlobalNotificationActions from '../../../../../actions/global_notification_actions'; @@ -47,6 +50,7 @@ let IkonotvRegisterPiece = React.createClass({ UserStore.getState(), PieceListStore.getState(), PieceStore.getState(), + WhitelabelStore.getState(), { step: 0, pageExitWarning: getLangText("If you leave this form now, your work will not be loaned to Ikono TV.") @@ -57,7 +61,9 @@ let IkonotvRegisterPiece = React.createClass({ PieceListStore.listen(this.onChange); UserStore.listen(this.onChange); PieceStore.listen(this.onChange); + WhitelabelStore.listen(this.onChange); UserActions.fetchCurrentUser(); + WhitelabelActions.fetchWhitelabel(); // Before we load the new piece, we reset the piece store to delete old data that we do // not want to display to the user. @@ -81,6 +87,7 @@ let IkonotvRegisterPiece = React.createClass({ PieceListStore.unlisten(this.onChange); UserStore.unlisten(this.onChange); PieceStore.unlisten(this.onChange); + WhitelabelStore.listen(this.onChange); }, onChange(state) { @@ -152,7 +159,8 @@ let IkonotvRegisterPiece = React.createClass({ canSubmit() { let currentUser = this.state.currentUser; - return currentUser && currentUser.acl && currentUser.acl.acl_wallet_submit; + let whitelabel = this.state.whitelabel; + return currentUser && currentUser.acl && currentUser.acl.acl_wallet_submit && whitelabel && whitelabel.user; }, getSlideArtistDetails() { @@ -194,15 +202,16 @@ let IkonotvRegisterPiece = React.createClass({ let today = new Moment(); let enddate = new Moment(); enddate.add(2, 'years'); + const {piece, whitelabel} = this.state; return (