mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-02 21:13:32 +00:00
certificate: Use path.sep for path separator to support Windows.
Fixes the certificate path issue on Windows.
This commit is contained in:
committed by
Akash Nimare
parent
4980c71e5a
commit
31da1131a4
@@ -1,6 +1,7 @@
|
||||
'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');
|
||||
@@ -41,7 +42,7 @@ class AddCertificate extends BaseComponent {
|
||||
const serverUrl = this.serverUrl.value;
|
||||
if (certificate !== '' && serverUrl !== '') {
|
||||
const server = encodeURIComponent(DomainUtil.formatUrl(serverUrl));
|
||||
const fileName = certificate.substring(certificate.lastIndexOf('/') + 1);
|
||||
const fileName = certificate.substring(certificate.lastIndexOf(path.sep) + 1);
|
||||
const copy = CertificateUtil.copyCertificate(server, certificate, fileName);
|
||||
if (!copy) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user