Skip to content

Commit

Permalink
use to set the hash instead of directly manipulating it (#4351)
Browse files Browse the repository at this point in the history
* use  to set the hash instead of directly manipulating it

* Update Jobs.jsx
  • Loading branch information
Omer Lachish authored Nov 13, 2019
1 parent d5a3f0d commit ef56e4e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions client/app/pages/admin/Jobs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import Layout from '@/components/admin/Layout';
import { CounterCard } from '@/components/admin/CeleryStatus';
import { WorkersTable, QueuesTable, OtherJobsTable } from '@/components/admin/RQStatus';

import { $http } from '@/services/ng';
import { $http, $location, $rootScope } from '@/services/ng';
import recordEvent from '@/services/recordEvent';
import { routesToAngularRoutes } from '@/lib/utils';
import moment from 'moment';

class Jobs extends React.Component {
state = {
activeTab: location.hash.replace('#', '') || null,
activeTab: $location.hash(),
isLoading: true,
error: null,

Expand Down Expand Up @@ -80,7 +80,8 @@ class Jobs extends React.Component {
const { isLoading, error, queueCounters, startedJobs, overallCounters, workers, activeTab } = this.state;

const changeTab = (newTab) => {
location.replace(`${location.pathname}#${newTab}`);
$location.hash(newTab);
$rootScope.$applyAsync();
this.setState({ activeTab: newTab });
};

Expand Down

0 comments on commit ef56e4e

Please sign in to comment.