mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-30 01:40:02 -05:00
Sync on ctrl+s (#1770)
This commit is contained in:
@@ -32,6 +32,7 @@ import Link from './common/Link';
|
||||
import Paragraph from './common/Paragraph';
|
||||
import Text from './common/Text';
|
||||
import View from './common/View';
|
||||
import { KeyHandlers } from './KeyHandlers';
|
||||
import LoggedInUser from './LoggedInUser';
|
||||
import { useServerURL } from './ServerContext';
|
||||
import { useSidebar } from './sidebar';
|
||||
@@ -173,30 +174,40 @@ export function SyncButton({ style, isMobile = false }: SyncButtonProps) {
|
||||
: {};
|
||||
|
||||
return (
|
||||
<Button
|
||||
type="bare"
|
||||
style={{
|
||||
...style,
|
||||
WebkitAppRegion: 'none',
|
||||
color: isMobile ? mobileColor : desktopColor,
|
||||
}}
|
||||
hoveredStyle={activeStyle}
|
||||
activeStyle={activeStyle}
|
||||
onClick={sync}
|
||||
>
|
||||
{syncState === 'error' ? (
|
||||
<AlertTriangle width={13} />
|
||||
) : (
|
||||
<AnimatedRefresh animating={syncing} />
|
||||
)}
|
||||
<Text style={{ marginLeft: 3 }}>
|
||||
{syncState === 'disabled'
|
||||
? 'Disabled'
|
||||
: syncState === 'offline'
|
||||
? 'Offline'
|
||||
: 'Sync'}
|
||||
</Text>
|
||||
</Button>
|
||||
<>
|
||||
<KeyHandlers
|
||||
keys={{
|
||||
'ctrl+s, cmd+s': () => {
|
||||
sync();
|
||||
},
|
||||
}}
|
||||
/>
|
||||
|
||||
<Button
|
||||
type="bare"
|
||||
style={{
|
||||
...style,
|
||||
WebkitAppRegion: 'none',
|
||||
color: isMobile ? mobileColor : desktopColor,
|
||||
}}
|
||||
hoveredStyle={activeStyle}
|
||||
activeStyle={activeStyle}
|
||||
onClick={sync}
|
||||
>
|
||||
{syncState === 'error' ? (
|
||||
<AlertTriangle width={13} />
|
||||
) : (
|
||||
<AnimatedRefresh animating={syncing} />
|
||||
)}
|
||||
<Text style={{ marginLeft: 3 }}>
|
||||
{syncState === 'disabled'
|
||||
? 'Disabled'
|
||||
: syncState === 'offline'
|
||||
? 'Offline'
|
||||
: 'Sync'}
|
||||
</Text>
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
6
upcoming-release-notes/1770.md
Normal file
6
upcoming-release-notes/1770.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Enhancements
|
||||
authors: [Compositr, shaankhosla]
|
||||
---
|
||||
|
||||
Sync on Ctrl+S
|
||||
Reference in New Issue
Block a user