241241</template >
242242
243243<script >
244- import userRow from ' ./UserList/UserRow'
245- import { Multiselect , Actions , ActionButton } from ' @nextcloud/vue'
244+ import { subscribe , unsubscribe } from ' @nextcloud/event-bus'
246245import InfiniteLoading from ' vue-infinite-loading'
247246import Vue from ' vue'
248247
248+ import Multiselect from ' @nextcloud/vue/dist/Components/Multiselect'
249+ import Actions from ' @nextcloud/vue/dist/Components/Actions'
250+ import ActionButton from ' @nextcloud/vue/dist/Components/ActionButton'
251+
252+ import userRow from ' ./UserList/UserRow'
253+
249254const unlimitedQuota = {
250255 id: ' none' ,
251256 label: t (' settings' , ' Unlimited' ),
@@ -407,6 +412,7 @@ export default {
407412 }
408413 },
409414 },
415+
410416 mounted () {
411417 if (! this .settings .canChangePassword ) {
412418 OC .Notification .showTemporary (t (' settings' , ' Password change is disabled because the master key is disabled' ))
@@ -420,13 +426,19 @@ export default {
420426 /**
421427 * Register search
422428 */
423- this .userSearch = new OCA.Search (this .search , this .resetSearch )
429+ subscribe (' nextcloud:unified-search:search' , this .search )
430+ subscribe (' nextcloud:unified-search:reset' , this .resetSearch )
424431
425432 /**
426433 * If disabled group but empty, redirect
427434 */
428435 this .redirectIfDisabled ()
429436 },
437+ beforeDestroy () {
438+ unsubscribe (' nextcloud:unified-search:search' , this .search )
439+ unsubscribe (' nextcloud:unified-search:reset' , this .resetSearch )
440+ },
441+
430442 methods: {
431443 onScroll (event ) {
432444 this .scrolled = event .target .scrollTo > 0
@@ -465,13 +477,13 @@ export default {
465477 },
466478
467479 /* SEARCH */
468- search (query ) {
480+ search ({ query } ) {
469481 this .searchQuery = query
470482 this .$store .commit (' resetUsers' )
471483 this .$refs .infiniteLoading .stateChanger .reset ()
472484 },
473485 resetSearch () {
474- this .search (' ' )
486+ this .search ({ query : ' ' } )
475487 },
476488
477489 resetForm () {
0 commit comments