closeAllGlobalMessages
} from '../../../components/store/globalMessages';
import { reloadUpdateKeyPage } from './utils';
+import RecentHistory from '../../../main/nav/component/RecentHistory';
class BulkUpdate extends React.Component {
static propTypes = {
const result = r.keys.find(result => result.key === component.key);
const newComponentKey = result != null ? result.newKey : component.key;
+ if (newComponentKey !== component.key) {
+ RecentHistory.remove(component.key);
+ }
+
this.props.addGlobalSuccessMessage(translate('update_key.key_updated'));
this.setState({ updating: false });
reloadUpdateKeyPage(newComponentKey);
} from '../../../components/store/globalMessages';
import { parseError } from '../../code/utils';
import { reloadUpdateKeyPage } from './utils';
+import RecentHistory from '../../../main/nav/component/RecentHistory';
class Key extends React.Component {
static propTypes = {
this.props.addGlobalSuccessMessage(translate('update_key.key_updated'));
if (key === this.props.component.key) {
+ RecentHistory.remove(key);
reloadUpdateKeyPage(newKey);
}
}).catch(e => {
RecentHistory.set(newHistory);
}
}
+
+ static remove (componentKey) {
+ const history = RecentHistory.get();
+ const newHistory = _.reject(history, entry => entry.key === componentKey);
+ RecentHistory.set(newHistory);
+ }
}