mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-10-23 03:31:56 +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`,
|
||||
click() {
|
||||
shell.openExternal('https://zulipchat.com/help/');
|
||||
click(focusedWindow) {
|
||||
if (focusedWindow) {
|
||||
AppMenu.sendAction('open-help');
|
||||
}
|
||||
}
|
||||
}, {
|
||||
label: 'Report an Issue',
|
||||
|
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const { ipcRenderer, remote, clipboard } = require('electron');
|
||||
const { ipcRenderer, remote, clipboard, shell } = require('electron');
|
||||
const isDev = require('electron-is-dev');
|
||||
|
||||
const { session, app, Menu, dialog } = remote;
|
||||
@@ -269,6 +269,10 @@ class ServerManagerView {
|
||||
return currentIndex;
|
||||
}
|
||||
|
||||
getCurrentActiveServer() {
|
||||
return this.tabs[this.activeTabIndex].webview.props.url;
|
||||
}
|
||||
|
||||
displayInitialCharLogo($img, index) {
|
||||
/*
|
||||
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-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-current-viewer', this.reloadCurrentView.bind(this));
|
||||
@@ -786,7 +796,7 @@ class ServerManagerView {
|
||||
});
|
||||
|
||||
ipcRenderer.on('copy-zulip-url', () => {
|
||||
clipboard.writeText(DomainUtil.getDomain(this.activeTabIndex).url);
|
||||
clipboard.writeText(this.getCurrentActiveServer());
|
||||
});
|
||||
|
||||
ipcRenderer.on('new-server', () => {
|
||||
|
Reference in New Issue
Block a user