From ac3a106833a9e1ce8e4329d0598a7b1f62940233 Mon Sep 17 00:00:00 2001 From: Kimmo Saari Date: Thu, 6 Feb 2020 13:05:34 +0200 Subject: [PATCH] Version 0.5.3-beta6 --- CHANGELOG.md | 9 +++ package.json | 2 +- public/electron.js | 2 + src/assets/constants.js | 2 + src/container/App/App.js | 21 ++++-- src/container/App/AppProvider.js | 69 ++++++++++++------- src/container/App/InitialState.js | 1 + src/container/Loading/Loading.js | 7 +- .../View/Configuration/Configuration.js | 52 +++++++------- src/container/View/Instance/Instance.js | 1 - src/container/View/View.js | 4 +- 11 files changed, 109 insertions(+), 61 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc7425d..9a4e81f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,11 +18,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Removed `border-bottom` from `:last-child`. - Uses modified Node-Wifi, for Windows compatibility. - `allowDowngrade` is always `true`, so if you have enabled pre-releases and want to switch back to latest stable, just disable `Allow pre-releases`, check updates, install and restart the app and you're back in the latest stable version. Also if I have accidentally published a buggy version of the app and want to delete the release (and you have already updated), you would have in-app option to downgrade into latest stable version with ease. +- Disabled Auto Update on Windows and Linux, since it is not working yet. ### Fixed - Fixed couple of typos in changelog. - Bug fixes for Node-Wifi, detecting BSSID on Mac. - A bug on Node-Wifi in Windows. +- Removed unwanted scrolls. + +## [0.5.3-beta5] - 2020-02-06 +### Fixed +- Removed unwanted scrolls. + +### Changed +- Disabled Auto Update on Windows and Linux, since it is not working yet. ## [0.5.3-beta4] - 2020-02-06 ### Fixed diff --git a/package.json b/package.json index 3983e29..e801baa 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "0.5.3-beta4", + "version": "0.5.3-beta5", "name": "slothy", "description": "Changes your Slack status based on the SSID you're currently connected to.", "productName": "Slothy", diff --git a/public/electron.js b/public/electron.js index 45d00be..bf6a688 100644 --- a/public/electron.js +++ b/public/electron.js @@ -4,6 +4,7 @@ const url = require('url'); const ipc = require('electron').ipcMain; const { autoUpdater, CancellationToken } = require('electron-updater'); const log = require('electron-log'); +const os = require('os'); const storage = require('./lib/storage'); const menuTemplate = require('./menuTemplate'); @@ -404,6 +405,7 @@ ipc ifCachedSend('configurations', getConfigurations); ifCachedSend('connections', getConnections); ifCachedSend('slackInstances', getSlackInstances); + sendIfMainWindow('setOs', () => os.platform()); if (appConfigurations.updates.checkUpdatesOnLaunch) { autoUpdater.checkForUpdates(); } diff --git a/src/assets/constants.js b/src/assets/constants.js index 2607e21..27e34ff 100644 --- a/src/assets/constants.js +++ b/src/assets/constants.js @@ -5,3 +5,5 @@ const YEAR_NOW = new Date().getFullYear(); const YEAR_END = `${YEAR_NOW > YEAR_STARTED ? ` - ${YEAR_NOW}` : ''}`; export const COPYRIGHT_YEAR = `${YEAR_STARTED}${YEAR_END}`; export const COPYRIGHT = `Kirbo © ${COPYRIGHT_YEAR}`; + +export const RELEASES_URL = 'https://github.com/kirbo/slothy/releases'; diff --git a/src/container/App/App.js b/src/container/App/App.js index 09b1295..4681c32 100755 --- a/src/container/App/App.js +++ b/src/container/App/App.js @@ -14,12 +14,16 @@ import View from '../View'; * @returns {jsx} */ const Authorized = () => ( - - - - - - + + {({ showLoading }) => ( + + + + + + + )} + ); /** @@ -37,6 +41,11 @@ const Styled = styled.div` min-height: 100vh; overflow: hidden; + ${({ showLoading }) => showLoading && ` + width: 100vw; + height: 100vh; + `} + & .ant-layout { min-height: 100vh; } diff --git a/src/container/App/AppProvider.js b/src/container/App/AppProvider.js index bd4b355..0b8161b 100644 --- a/src/container/App/AppProvider.js +++ b/src/container/App/AppProvider.js @@ -7,7 +7,8 @@ import INITIAL_STATE from './InitialState'; import { Provider } from './Context'; import Loading from '../Loading'; -import { sortBy } from '../../assets/utils'; +import { sortBy, openExternal } from '../../assets/utils'; +import { RELEASES_URL } from '../../assets/constants'; const electron = window.require('electron'); const { ipcRenderer } = electron; @@ -136,6 +137,11 @@ class AppProvider extends Component { ssidsLoaded: true, }); }) + .on('setOs', (event, value) => { + setProperty({ + os: value, + }); + }) .on('scanningConnections', () => { setProperty({ ssidsLoaded: false, @@ -188,6 +194,7 @@ class AppProvider extends Component { message.loading(data.message); }) .on('update-notification', (event, data) => { + const { os } = this.state; let description = `
Current version @@ -227,14 +234,30 @@ class AppProvider extends Component { duration: 0, key: 'update-notification', btn: ( - + <> - - + { + os === 'darwin' + ? ( + + ) + : ( + + ) + } + ), onClose: () => notification.close('update-notification'), }); @@ -248,11 +271,11 @@ class AppProvider extends Component { duration: 0, key: 'update-progress', btn: !appConfigurations.updates.autoDownload && ( - + <> - + ), onClose: () => notification.close('update-progress'), }); @@ -265,14 +288,14 @@ class AppProvider extends Component { duration: 0, key: 'update-downloaded', btn: ( - + <> - + ), onClose: () => notification.close('update-downloaded'), }); @@ -285,14 +308,14 @@ class AppProvider extends Component { duration: 0, key: 'update-cancelled', btn: ( - + <> - + ), onClose: () => notification.close('update-notification'), }); @@ -351,20 +374,20 @@ class AppProvider extends Component { const { children } = this.props; return ( - + <> {showLoading && ( - + )} {children} - + ); } } diff --git a/src/container/App/InitialState.js b/src/container/App/InitialState.js index 1c1f1b6..7be33fd 100644 --- a/src/container/App/InitialState.js +++ b/src/container/App/InitialState.js @@ -26,6 +26,7 @@ const INITIAL_STATE = { ssids: [], viewType: type, wifiEnabled: false, + os: '', }; export default INITIAL_STATE; diff --git a/src/container/Loading/Loading.js b/src/container/Loading/Loading.js index 67ccfb2..a1f1a5a 100644 --- a/src/container/Loading/Loading.js +++ b/src/container/Loading/Loading.js @@ -52,19 +52,19 @@ class Loading extends Component { render = () => { const { hideLoading } = this.props; return ( - + <>
- Loading, please standby... + Loading, please standby...
-
+ ); } } @@ -96,6 +96,7 @@ const Styled = styled.div` justify-content: center; background: radial-gradient(${COLOR.darkBlue}, ${COLOR.black}); transition: all 0.5s ease; + z-index: 10000; opacity: ${({ hideLoading }) => (hideLoading ? 0 : 1)}; & div.logo { diff --git a/src/container/View/Configuration/Configuration.js b/src/container/View/Configuration/Configuration.js index 5e83a94..8847b99 100644 --- a/src/container/View/Configuration/Configuration.js +++ b/src/container/View/Configuration/Configuration.js @@ -74,7 +74,7 @@ const timerFormatter = value => { const Configuration = () => ( {({ - appConfigurations, configurations, slackInstances, currentSsids, updateAppConfigurations, saveConfiguration, + os, appConfigurations, configurations, slackInstances, currentSsids, updateAppConfigurations, saveConfiguration, }) => { const connectedBssids = currentSsids.map(({ bssid }) => bssid.toUpperCase()); const bssidConfigurations = configurations.filter(({ bssid }) => bssid && connectedBssids.includes(bssid.toUpperCase())); @@ -249,29 +249,33 @@ const Configuration = () => ( /> - - - - Auto download updates - - - - - - - - - Install updates automatically on application quit - - - - + {os === 'darwin' && ( + <> + + + + Auto download updates + + + + + + + + + Install updates automatically on application quit + + + + + + )} diff --git a/src/container/View/Instance/Instance.js b/src/container/View/Instance/Instance.js index 23b55a9..d9db15a 100644 --- a/src/container/View/Instance/Instance.js +++ b/src/container/View/Instance/Instance.js @@ -215,7 +215,6 @@ const Centered = styled.div` flex: 1 1 100%; justify-content: center; margin: ${DIMENSION['1x']} 0; - width: calc(100vw - 200px); `; const Image = styled.div` &.round img { diff --git a/src/container/View/View.js b/src/container/View/View.js index 048fa61..1f1e517 100644 --- a/src/container/View/View.js +++ b/src/container/View/View.js @@ -34,9 +34,7 @@ const StyledView = styled.div` display: flex; flex: 1 1 100%; max-width: calc(100vw - 200px); - overflow-x: hidden; - overflow-y: auto; - + overflow: auto; & .ant-layout { max-width: 100%;