mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +00:00
Simplify changelog
This commit is contained in:
parent
82f1c23a02
commit
c5881e258a
@ -341,6 +341,17 @@ function createWindow () {
|
||||
trackEvent('App Menu', 'Preferences');
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "Changelog",
|
||||
click: function (menuItem, window, e) {
|
||||
if (!window || !window.webContents) {
|
||||
return
|
||||
}
|
||||
|
||||
window.webContents.send('toggle-changelog');
|
||||
trackEvent('App Menu', 'Changelog');
|
||||
}
|
||||
},
|
||||
{
|
||||
type: "separator",
|
||||
visible: IS_MAC
|
||||
|
@ -120,8 +120,8 @@ class WorkspaceDropdown extends Component {
|
||||
<i className="fa fa-cog"></i> Settings
|
||||
<DropdownHint char=","></DropdownHint>
|
||||
</DropdownItem>
|
||||
<DropdownItem onClick={e => showModal(ChangelogModal)}>
|
||||
<i className="fa fa-blank"></i> Changelog
|
||||
<DropdownItem onClick={e => showModal(SettingsModal, TAB_INDEX_EXPORT)}>
|
||||
<i className="fa fa-users"></i> For Team
|
||||
</DropdownItem>
|
||||
</Dropdown>
|
||||
)
|
||||
|
@ -9,18 +9,15 @@ import {getAppVersion, CHANGELOG_URL, CHANGELOG_PAGE} from '../../../common/cons
|
||||
class ChangelogModal extends Component {
|
||||
constructor (props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
startVersion: getAppVersion(),
|
||||
changelog: null
|
||||
};
|
||||
this.state = {changelog: null};
|
||||
}
|
||||
|
||||
show (startVersion = null) {
|
||||
show () {
|
||||
this.modal.show();
|
||||
}
|
||||
|
||||
if (startVersion) {
|
||||
this.setState({startVersion});
|
||||
}
|
||||
toggle () {
|
||||
this.modal.toggle();
|
||||
}
|
||||
|
||||
async componentDidMount () {
|
||||
@ -36,12 +33,8 @@ class ChangelogModal extends Component {
|
||||
this.setState({changelog});
|
||||
}
|
||||
|
||||
shouldComponentUpdate (nextProps, nextState) {
|
||||
return nextState !== this.state;
|
||||
}
|
||||
|
||||
render () {
|
||||
const {changelog, startVersion} = this.state;
|
||||
const {changelog} = this.state;
|
||||
|
||||
let html;
|
||||
|
||||
@ -54,6 +47,7 @@ class ChangelogModal extends Component {
|
||||
} else {
|
||||
html = [];
|
||||
|
||||
const startVersion = getAppVersion();
|
||||
let startIndex = changelog.findIndex(c => c.version === startVersion);
|
||||
if (startIndex < 0) {
|
||||
startIndex = 0;
|
||||
|
@ -302,6 +302,10 @@ class App extends Component {
|
||||
toggleModal(SettingsModal);
|
||||
});
|
||||
|
||||
ipcRenderer.on('toggle-changelog', () => {
|
||||
toggleModal(ChangelogModal);
|
||||
});
|
||||
|
||||
ipcRenderer.on('toggle-sidebar', this._handleToggleSidebar.bind(this));
|
||||
}
|
||||
|
||||
|
@ -16,4 +16,8 @@
|
||||
padding-left: @padding-lg;
|
||||
margin-bottom: 1.5em;
|
||||
}
|
||||
|
||||
hr {
|
||||
margin: @padding-lg 0 !important;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user