mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-10-24 00:23:36 +00:00
menu: Open help page of current active server.
* menu: Open help page of the currently active server. Fixes: #758.
This commit is contained in:
@@ -195,8 +195,10 @@ class AppMenu {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: `Help Center`,
|
label: `Help Center`,
|
||||||
click() {
|
click(focusedWindow) {
|
||||||
shell.openExternal('https://zulipchat.com/help/');
|
if (focusedWindow) {
|
||||||
|
AppMenu.sendAction('open-help');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
label: 'Report an Issue',
|
label: 'Report an Issue',
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const { ipcRenderer, remote, clipboard } = require('electron');
|
const { ipcRenderer, remote, clipboard, shell } = require('electron');
|
||||||
const isDev = require('electron-is-dev');
|
const isDev = require('electron-is-dev');
|
||||||
|
|
||||||
const { session, app, Menu, dialog } = remote;
|
const { session, app, Menu, dialog } = remote;
|
||||||
@@ -269,6 +269,10 @@ class ServerManagerView {
|
|||||||
return currentIndex;
|
return currentIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getCurrentActiveServer() {
|
||||||
|
return this.tabs[this.activeTabIndex].webview.props.url;
|
||||||
|
}
|
||||||
|
|
||||||
displayInitialCharLogo($img, index) {
|
displayInitialCharLogo($img, index) {
|
||||||
/*
|
/*
|
||||||
index parameter needed because webview[data-tab-id] can increment
|
index parameter needed because webview[data-tab-id] can increment
|
||||||
@@ -623,6 +627,12 @@ class ServerManagerView {
|
|||||||
|
|
||||||
ipcRenderer.on('open-about', this.openAbout.bind(this));
|
ipcRenderer.on('open-about', this.openAbout.bind(this));
|
||||||
|
|
||||||
|
ipcRenderer.on('open-help', () => {
|
||||||
|
// Open help page of current active server
|
||||||
|
const helpPage = this.getCurrentActiveServer() + '/help';
|
||||||
|
shell.openExternal(helpPage);
|
||||||
|
});
|
||||||
|
|
||||||
ipcRenderer.on('reload-viewer', this.reloadView.bind(this, this.tabs[this.activeTabIndex].props.index));
|
ipcRenderer.on('reload-viewer', this.reloadView.bind(this, this.tabs[this.activeTabIndex].props.index));
|
||||||
|
|
||||||
ipcRenderer.on('reload-current-viewer', this.reloadCurrentView.bind(this));
|
ipcRenderer.on('reload-current-viewer', this.reloadCurrentView.bind(this));
|
||||||
@@ -786,7 +796,7 @@ class ServerManagerView {
|
|||||||
});
|
});
|
||||||
|
|
||||||
ipcRenderer.on('copy-zulip-url', () => {
|
ipcRenderer.on('copy-zulip-url', () => {
|
||||||
clipboard.writeText(DomainUtil.getDomain(this.activeTabIndex).url);
|
clipboard.writeText(this.getCurrentActiveServer());
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcRenderer.on('new-server', () => {
|
ipcRenderer.on('new-server', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user