From 439b17800f92c7fbef4399d029ecbdbe9af0f243 Mon Sep 17 00:00:00 2001 From: Rolf Schmidt Date: Mon, 13 Jun 2022 08:23:35 +0200 Subject: [PATCH] Follow up 949a47a7be6cf10dc7fd38c3c5b06def6efad26d - Fixes #4040 - users customer name is displayed as id. --- app/assets/javascripts/app/controllers/user.coffee | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/app/controllers/user.coffee b/app/assets/javascripts/app/controllers/user.coffee index 53f0dce03..9c508de17 100644 --- a/app/assets/javascripts/app/controllers/user.coffee +++ b/app/assets/javascripts/app/controllers/user.coffee @@ -50,6 +50,9 @@ class User extends App.ControllerSubContent @delay(@search, 220, 'search') ) + # App.User.subscribe will clear model data so we use controllerBind (#4040) + @controllerBind('User:create User:update User:touch User:destroy', => @delay(@search, 220, 'search')) + # show last 20 users @search() @@ -182,9 +185,6 @@ class User extends App.ControllerSubContent 'click': edit ) - if !@subscribeId - @subscribeId = App.User.subscribe(=> @delay(@search, 220, 'search')) - search: => role_ids = [] @$('.tab.active').each( (i,d) -> @@ -242,8 +242,4 @@ class User extends App.ControllerSubContent container: @el.closest('.content') ) - release: => - if @subscribeId - App.User.unsubscribe(@subscribeId) - App.Config.set( 'User', { prio: 1000, name: __('Users'), parent: '#manage', target: '#manage/users', controller: User, permission: ['admin.user'] }, 'NavBarAdmin' )