Download wp-calypso/desktop/app/lib/platform/linux/index.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.27 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/desktop/app/lib/platform/linux/index.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/desktop/app/lib/platform/linux/index.js
-
curl -L -o index.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/desktop/app/lib/platform/linux/index.js
1.27 kB
| const { app } = require( 'electron' ); | |
| const log = require( '../../../lib/logger' )( 'platform:linux' ); | |
| /** | |
| * | |
| * Module variables | |
| */ | |
| let window; | |
| function LinuxPlatform( appWindow ) { | |
| window = appWindow.window; | |
| app.on( 'activate', function () { | |
| log.info( 'Window activated' ); | |
| window.show(); | |
| window.focus(); | |
| } ); | |
| app.on( 'window-all-closed', function () { | |
| log.info( 'All windows closed, shutting down' ); | |
| app.quit(); | |
| } ); | |
| window.on( 'close', function () { | |
| app.quit(); | |
| } ); | |
| } | |
| LinuxPlatform.prototype.restore = function () { | |
| if ( window.isMinimized() ) { | |
| window.restore(); | |
| } | |
| window.show(); | |
| }; | |
| LinuxPlatform.prototype.showNotificationsBadge = function ( count ) { | |
| // Linux: updating badge count requires Unity launcher | |
| // https://www.electronjs.org/docs/api/app#appsetbadgecountcount-linux-macos | |
| if ( ! app.isUnityRunning() ) { | |
| log.info( `Unity not running, skipping badge update (unseenCount: ${ count })` ); | |
| return; | |
| } | |
| const badgeCount = app.getBadgeCount(); | |
| if ( badgeCount === count ) { | |
| return; | |
| } | |
| app.setBadgeCount( count ); | |
| }; | |
| LinuxPlatform.prototype.clearNotificationsBadge = function () { | |
| app.setBadgeCount( 0 ); | |
| }; | |
| LinuxPlatform.prototype.setDockMenu = function () { | |
| // no op | |
| }; | |
| module.exports = LinuxPlatform; | |