Skip to content

Commit

Permalink
Update: Revert tracked query params
Browse files Browse the repository at this point in the history
- Query params are technically owned (managed) by the ember framework
 so we should be using set to notify them to update
- https://discuss.emberjs.com/t/query-params-tracked/17467/21
- emberjs/ember.js#18715
  • Loading branch information
Kevin Hinterlong committed Mar 6, 2020
1 parent 3744eed commit 5c4623d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/directory/addon/controllers/directory.js
Expand Up @@ -3,8 +3,7 @@
* Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms.
*/
import Controller from '@ember/controller';
import { tracked } from '@glimmer/tracking';
import { getProperties, get, computed, action } from '@ember/object';
import { getProperties, get, set, computed, action } from '@ember/object';
import { inject as service } from '@ember/service';
import { A as arr } from '@ember/array';

Expand Down Expand Up @@ -34,12 +33,12 @@ export default class DirectoryController extends Controller {
* @property {String} type - query param for type
* allowed types - reports, dashboards
*/
@tracked type = null;
type = null;

/**
* @property {String} sortBy - query param for sortBy
*/
@tracked sortBy = 'updatedOn';
sortBy = 'updatedOn';

/**
* @property {String} sortKey - sort key (computed by sortBy query param)
Expand All @@ -52,12 +51,12 @@ export default class DirectoryController extends Controller {
/**
* @property {String} sortDir - query param for sort direction
*/
@tracked sortDir = 'desc';
sortDir = 'desc';

/**
* @property {String} q - query param for the search query
*/
@tracked q = '';
q = '';

/**
* @property {String} title - Title for the table
Expand Down Expand Up @@ -86,7 +85,7 @@ export default class DirectoryController extends Controller {
*/
@action
searchFor(query) {
this.q = query;
set(this, 'q', query);
}

/**
Expand Down

0 comments on commit 5c4623d

Please sign in to comment.