Skip to content

Commit

Permalink
refactor and improve
Browse files Browse the repository at this point in the history
- update tribes-list.client.controller
- fix propTypes warnings
- cleanup
  • Loading branch information
mrkvon committed Dec 14, 2019
1 parent a2ce198 commit 23b6138
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
3 changes: 0 additions & 3 deletions modules/tribes/client/components/Tribe.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ const Container = styled.div`
position: relative;
`;

/**
* @TODO maybe rename to Tribe
*/
export default function Tribe({ tribe, user, onMembershipUpdated }) {
const { t } = useTranslation('tribes');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

// Exposed to the view
vm.user = Authentication.user;
vm.broadcastChange = function (data) {
if (data.tribe) {
$rootScope.$broadcast('tribeUpdated', data.tribe);
}

/**
* Update the Authentication.user with updated tribe membership
*/
vm.broadcastUpdatedUser = function (data) {
if (data.user) {
Authentication.user = data.user;
$rootScope.$broadcast('userUpdated');
Expand All @@ -24,7 +24,6 @@

/**
* Emit photo credits info
* @TODO remove this
*/
vm.addPhotoCredits = function addPhotoCredits(photo) {
$scope.$emit('photoCreditsUpdated', photo);
Expand Down
2 changes: 1 addition & 1 deletion modules/tribes/client/views/tribes-list.client.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
user="app.user"
onDisplayPhoto="tribesList.addPhotoCredits"
onHidePhoto="tribesList.removePhotoCredits"
onMembershipUpdated="tribesList.broadcastChange"
onMembershipUpdated="tribesList.broadcastUpdatedUser"
></tribes-page>

0 comments on commit 23b6138

Please sign in to comment.