Skip to content

Commit 01d6589

Browse files
authored
Fix: Gutenberg/Atomic 'Enable SSO' Toggle (#48144)
1 parent 69a0f00 commit 01d6589

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

desktop/e2e/appStart.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe( 'check app loads', function () {
2121
mainWindow.webContents.send( 'is-calypso' );
2222
} );
2323

24-
ipcMain.on( 'is-calypso-response', function ( ev, value ) {
24+
ipcMain.on( 'is-calypso-response', function ( _, value ) {
2525
expect( value ).to.be.true;
2626
done();
2727
} );

desktop/public_desktop/desktop-app.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,10 @@ function startDesktopApp() {
9595
}
9696

9797
// This is called by Calypso
98+
// eslint-disable-next-line no-unused-vars
9899
startApp = function () {
99100
document.addEventListener( 'dragover', ( ev ) => {
100-
if ( [ ...event.dataTransfer.types ].includes( 'text/uri-list' ) ) {
101+
if ( [ ...ev.dataTransfer.types ].includes( 'text/uri-list' ) ) {
101102
ev.preventDefault();
102103
}
103104
} );
@@ -117,7 +118,7 @@ function startDesktopApp() {
117118
const build = window.electron.config.build;
118119
document.documentElement.classList.add( 'build-' + build );
119120

120-
if ( navigator.onLine ) {
121+
if ( typeof window.navigator !== 'undefined' && window.navigator.onLine ) {
121122
startCalypso();
122123

123124
if ( calysoHasLoaded() ) {
@@ -138,7 +139,7 @@ try {
138139
window.electron.receive( 'is-calypso-response', document.getElementById( 'wpcom' ) !== null );
139140
} );
140141

141-
window.electron.receive( 'app-config', function ( _, details ) {
142+
window.electron.receive( 'app-config', function ( details ) {
142143
// if this is the first run, and on the login page, show Windows and Mac users a pin app reminder
143144
if ( details.firstRun && document.querySelectorAll( '.logged-out-auth' ).length > 0 ) {
144145
if ( details.platform === 'windows' || details.platform === 'darwin' ) {

desktop/public_desktop/preload.js

+8
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,29 @@ const { ipcRenderer, contextBridge } = require( 'electron' );
44
// Maintain this list in alphabetical order.
55
const sendChannels = [
66
'cannot-use-editor',
7+
'enable-site-option-response',
78
'get-config',
89
'get-settings',
910
'log',
1011
'request-site-response',
1112
'unread-notices-count',
1213
'user-auth',
1314
'user-login-status',
15+
'view-post-clicked',
16+
'print',
17+
'secrets',
18+
'toggle-dev-tools',
1419
];
1520

1621
// Incoming IPC message channels from Main process to Renderer.
1722
// Maintain this list in alphabetical order.
1823
const receiveChannels = [
24+
'app-config',
1925
'cookie-auth-complete',
2026
'enable-notification-badge',
2127
'enable-site-option',
28+
'is-calypso',
29+
'is-calypso-response',
2230
'navigate',
2331
'new-post',
2432
'notification-clicked',

0 commit comments

Comments
 (0)