Skip to content

Changed saveServerIcon() to not use request() on defaultIconUrl #627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions app/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,6 @@ app.on('ready', () => {

ipcMain.on('update-menu', (event, props) => {
appMenu.setMenu(props);
const activeTab = props.tabs[props.activeTabIndex];
if (activeTab) {
mainWindow.setTitle(`Zulip - ${activeTab.webview.props.name}`);
}
});

ipcMain.on('toggleAutoLauncher', (event, AutoLaunchValue) => {
Expand Down
13 changes: 4 additions & 9 deletions app/renderer/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ class ServerManagerView {
$serverImgs.forEach(($serverImg, index) => {
this.addContextMenu($serverImg, index);
if ($serverImg.src.includes('img/icon.png')) {
this.displayInitialCharLogo($serverImg, index);
this.displayInitialCharLogo($serverImg);
}
$serverImg.addEventListener('error', () => {
this.displayInitialCharLogo($serverImg, index);
this.displayInitialCharLogo($serverImg);
});
});
}
Expand Down Expand Up @@ -253,12 +253,7 @@ class ServerManagerView {
return currentIndex;
}

displayInitialCharLogo($img, index) {
/*
index parameter needed because webview[data-tab-id] can increment
beyond size of sidebar org array and throw error
*/

displayInitialCharLogo($img) {
const $altIcon = document.createElement('div');
const $parent = $img.parentElement;
const $container = $parent.parentElement;
Expand All @@ -278,7 +273,7 @@ class ServerManagerView {
$parent.removeChild($img);
$parent.appendChild($altIcon);

this.addContextMenu($altIcon, index);
this.addContextMenu($altIcon, $webview.getAttribute('data-tab-id'));
}

sidebarHoverEvent(SidebarButton, SidebarTooltip, addServer = false) {
Expand Down
18 changes: 18 additions & 0 deletions app/renderer/js/notification/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,26 @@ function parseReply(reply) {

function setupReply(id) {
const { narrow } = window;
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
const narrowByTopic = narrow.by_topic || narrow.by_subject;
narrowByTopic(id, { trigger: 'notification' });
=======
narrow.by_topic(id, { trigger: 'notification' });
>>>>>>> 3e73511... notification: Fix reply from notification.
=======
const narrowByTopic = narrow.by_topic || narrow.by_subject;
narrowByTopic(id, { trigger: 'notification' });
>>>>>>> 4980c71... notification: Ensure backward compatibilty when using narrow.by_topic.
=======
const narrowByTopic = narrow.by_topic || narrow.by_subject;
narrowByTopic(id, { trigger: 'notification' });
>>>>>>> upstream/master
=======
narrow.by_subject(id, { trigger: 'notification' });
>>>>>>> parent of dd1ce9c... Changed saveServerIcon() to not use request() on defaultIconUrl
}

module.exports = {
Expand Down
17 changes: 16 additions & 1 deletion app/renderer/js/pages/preference/add-certificate.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use-strict';

const { dialog } = require('electron').remote;
const path = require('path');

const BaseComponent = require(__dirname + '/../../components/base.js');
const CertificateUtil = require(__dirname + '/../../utils/certificate-util.js');
Expand Down Expand Up @@ -42,7 +41,23 @@ class AddCertificate extends BaseComponent {
const serverUrl = this.serverUrl.value;
if (certificate !== '' && serverUrl !== '') {
const server = encodeURIComponent(DomainUtil.formatUrl(serverUrl));
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
const fileName = path.basename(certificate);
=======
const fileName = certificate.substring(certificate.lastIndexOf(path.sep) + 1);
>>>>>>> 31da113... certificate: Use path.sep for path separator to support Windows.
=======
const fileName = path.basename(certificate);
>>>>>>> 9bdc5dd... certificate: Use path.basename to get certificate file name.
=======
const fileName = path.basename(certificate);
>>>>>>> upstream/master
=======
const fileName = certificate.substring(certificate.lastIndexOf('/') + 1);
>>>>>>> parent of dd1ce9c... Changed saveServerIcon() to not use request() on defaultIconUrl
const copy = CertificateUtil.copyCertificate(server, certificate, fileName);
if (!copy) {
return;
Expand Down
Loading