mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
SDA-2977: UBS: Inconsistent 'Copy Email Address' output on MessageML (#1193)
* fix: SDA-2948 (Redesign notification) (#1186) * fix: SDA-2948 - Redesign notification * fix: SDA-2948 - Fix background color * SDA-2977: add support for mailto links Co-authored-by: Kiran Niranjan <kiran.niranjan@symphony.com>
This commit is contained in:
parent
426964ccaf
commit
57c363f956
@ -36,25 +36,18 @@ const MIN_HEIGHT = 300;
|
||||
*/
|
||||
const verifyProtocolForNewUrl = (url: string): boolean => {
|
||||
const parsedUrl = parse(url);
|
||||
if (!parsedUrl) {
|
||||
if (!parsedUrl || !parsedUrl.protocol) {
|
||||
logger.info(
|
||||
`child-window-handler: The url ${url} doesn't have a protocol. Returning false for verification!`,
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
const allowedProtocols = ['http:', 'https:', 'mailto:'];
|
||||
// url parse returns protocol with :
|
||||
if (parsedUrl.protocol === 'https:') {
|
||||
if (allowedProtocols.includes(parsedUrl.protocol)) {
|
||||
logger.info(
|
||||
`child-window-handler: The url ${url} is a https url! Returning true for verification!`,
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
// url parse returns protocol with :
|
||||
if (parsedUrl.protocol === 'http:') {
|
||||
logger.info(
|
||||
`child-window-handler: The url ${url} is a http url! Returning true for verification!`,
|
||||
`child-window-handler: Protocol of the url ${url} is whitelisted! Returning true for verification!`,
|
||||
);
|
||||
return true;
|
||||
}
|
||||
@ -303,7 +296,7 @@ export const handleChildWindow = (webContents: WebContents): void => {
|
||||
return;
|
||||
}
|
||||
logger.info(`child-window-handler: new window url is ${newWinUrl} which is not of the same host,
|
||||
so opening it in the default browser!`);
|
||||
so opening it in the default app!`);
|
||||
windowHandler.openUrlInDefaultBrowser(newWinUrl);
|
||||
}
|
||||
};
|
||||
|
@ -434,16 +434,24 @@ class Notification extends NotificationHandler {
|
||||
...this.activeNotifications,
|
||||
};
|
||||
const inactiveNotificationWindows = { ...[], ...this.inactiveWindows };
|
||||
for (const activeWindow of activeNotificationWindows) {
|
||||
if (activeWindow && windowExists(activeWindow)) {
|
||||
await this.hideNotification(
|
||||
(activeWindow as ICustomBrowserWindow).clientId,
|
||||
);
|
||||
if (activeNotificationWindows && Array.isArray(activeNotificationWindows)) {
|
||||
for (const activeWindow of activeNotificationWindows) {
|
||||
if (activeWindow && windowExists(activeWindow)) {
|
||||
await this.hideNotification(
|
||||
(activeWindow as ICustomBrowserWindow).clientId,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const inactiveWindow of inactiveNotificationWindows) {
|
||||
if (inactiveWindow && windowExists(inactiveWindow)) {
|
||||
inactiveWindow.close();
|
||||
|
||||
if (
|
||||
inactiveNotificationWindows &&
|
||||
Array.isArray(inactiveNotificationWindows)
|
||||
) {
|
||||
for (const inactiveWindow of inactiveNotificationWindows) {
|
||||
if (inactiveWindow && windowExists(inactiveWindow)) {
|
||||
inactiveWindow.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user