* [bug] Ensure accounts logging out in the background doesn't impact active account ui
The main issue here: inactive accounts with a logout timeout actually log out the active account" is fixed by pulling in jslib.
These changes are for some asthetic issues I noticed, where inactive accounts logging out still fires a switchAccount event, which causes a loading spinner to appear and a sync that redraws the vault.
* Only load if the account being logged out is the active account:
* Replaced any calls to `stateService.activeAccount.getValue` with references to `this.activeUserId`, since we subscribe to that in the component now.
* Only send a "switchAccount" method if the active user before a clean and after a clean don't match
* [bug] Ensure default vault timeout is set to On Restart
We dont override the StateMigrationService instance that is injected in desktop, so it is not aware of desktop defaults.
This results in fresh accounts having a "Never" timeout action insteads of "On Restart"
* Use the correct StateMigrationService instance
* update jslib
* [bug] Move bulk of system lock checks into app.component
* [review] Extract shared system timeout logic
* [review] Correct an improper number
* [review] Opt for a more locally scoped system timeout helper than a dedicated enum
* [Icons] Update Font Sheet
* Added import statement for styles
* updated to clone icon
* Changed save to save changes icon
* Revert to using base bwi class
* Updated import order for bwi icon styles
* Converted new account switcher ui updates
* Bump jslib
* Fix occurances where bwi-eye-slash was used instead of btw-eye-slash-2
* Move settings cog to the left side
* Updated eye/eye-slash icon references
* Update jslib
* Update jslib
* Update fallback image for cipher icon
* Update jslib
Co-authored-by: Hinton <oscar@oscarhinton.com>
The DI refactor created a bad initlizer for SystemService that left out the reload callback.
This callback is null in prod, so I just set up a factory initlizer that used null for the callback value.
This fixes a bug causing clipboard clearing to not function, as platformUtilsService was not correctly injected.
* Design changes to settings menu
* Remove black border on settings headers
* Pull in jslib
* Only load account related settings when authed
* Hide account related settings when not authed
* Change settings titles
* Changes discussed with Danielle
With the account switching work a header was added to the desktop app that new acts as a home for the mac window controls.
Previously we needed a special home for these controls, but since moving them we are not just creating empty space.
Removing this class and the divs that use it corrects the behavior.
* [dep] Implement new StateService factory parameter from jslib
* [bug] Ensure setLastActive uses the correct userId
Sometimes, because of how often it fires, setLastActive can cause accounts to override each other. To make sure the correct userId is always used we now subscribe to activeUser in the appComponent and pass that value into any setLastActive calls.
* [bug] Show loader when logging out
When logging out of a large vault the application can appear to hang. This commit turns on the app component loader while logout is doing work.
* [bug] Stop tracking activity without an active user
* [style] Ran prettier
* [chore] Update jslib
* [Bug] VaultTimeout incorrectly defaults to "Never"
The default desktop vault timeout value is "On Restart", but there is no default set for this in the state service and account model.
This commit extends the StateService and Account model to consider the special vault timeout default requirements needed for desktop.
* [style] Lint fixes
* [chore] Update jslib
* [bug] Pull serverUrl directly from stateService for the account switcher
Create a small extended Account model for handling the switchers server url, and pull environment urls from disk where they actually live
* [refactor] Add a message handler for switching accounts
* This allows for logic reuse between manually switching accounts and automatically switching accounts on login
* This commit also adds a loading spinner to app root while syncing after a switch
* [bug] Remove vertical scrollbar
* An old styling fix to add extra height and padding seems to be now creating an unecassary scroll bar. It is likely that since making more use of flexbox for our containers that this issue has been resolved without the manually added extra hight & padding
* [refactor] Turn down activity monitoring
Saving last activity is a disk call, and we currently do this a lot more than is necassary. For example:
* We track mousedown & click, which is redundant
* We track every mouse movement regardless of if an action is taken. This seems inappropriate for use in locking behavior.
* [bug] Address potential race condition when locking
Sometimes when swapping between an unlocked account and a locked account a race condition occurs that swaps the user but doesn't redirect to the lock screen
This commit just adds some awaits and restructures lock order of operations to be more in line with other message handlers
* [refactor] Change click event to mousedown event for the account switcher
This is simply a little snappier, and ensures we stay ahead of change detection and don't get stuck not properly interpreting the action
* [chore] Update jslib
* [chore] Linter fixes
* [chore] Linter fixes
* [chore] Update jslib
* [chore] Update jslib
* [refactor] Remove references to deprecated services
* [feature] Implement account switching
* [bug] Fix state handling for authentication dependent system menu items
* [bug] Enable the account switcher to fucntion properly when switching to a locked accounts
* [feature] Enable locking any account from the menu
* [bug] Ensure the avatar instance used in the account switcher updates on account change
* [style] Fix lint complaints
* [bug] Ensure the logout command callback can handle any user in state
* [style] Fix lint complaints
* rollup
* [style] Fix lint complaints
* [bug] Don't clean up state until everything else is done on logout
* [bug] Navigate to vault on a succesful account switch
* [bug] Init the state service on start
* [feature] Limit account switching to 5 account maximum
* [bug] Resolve app lock state with 5 logged out accounts
* [chore] Update account refrences to match recent jslib restructuring
* [bug] Add missing awaits
* [bug] Update app menu on logout
* [bug] Hide the switcher if there are no authed accounts
* [bug] Move authenticationStatus display information out of jslib
* [bug] Remove unused active style from scss
* [refactor] Rewrite the menu bar
* [style] Fix lint complaints
* [bug] Clean state of loggout out user after redirect
* [bug] Redirect on logout if not explicity provided a userId that isn't active
* [bug] Relocated several settings items to persistant storage
* [bug] Correct account switcher styles on all themes
* [chore] Include state migration service in services
* [bug] Swap to next account on logout
* [bug] Correct DI service
* [bug] fix loginGuard deps in services.module
* [chore] update jslib
* [bug] Remove badly merged scss
* [chore] update jslib
* [review] Code review cleanup
* [review] Code review cleanup
Co-authored-by: Hinton <oscar@oscarhinton.com>