-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Desktop: Resolves #8493: Link to FAQ when encryption password may hav…
…e been reset by an update (#8667) Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
- Loading branch information
1 parent
f0c1042
commit 3778f19
Showing
5 changed files
with
55 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
packages/app-desktop/gui/ConfigScreen/controls/MissingPasswordHelpLink.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import * as React from 'react'; | ||
|
||
import shim from '@joplin/lib/shim'; | ||
import bridge from '../../../services/bridge'; | ||
import StyledLink from '../../style/StyledLink'; | ||
|
||
interface Props { | ||
theme: any; | ||
text: string; | ||
} | ||
|
||
const openMissingPasswordFAQ = () => | ||
bridge().openExternal('https://joplinapp.org/faq#why-did-my-sync-and-encryption-passwords-disappear-after-updating-joplin'); | ||
|
||
// A link to a specific part of the FAQ related to passwords being cleared when upgrading | ||
// to a MacOS/ARM release. | ||
const MacOSMissingPasswordHelpLink: React.FunctionComponent<Props> = props => { | ||
const macInfoLink = ( | ||
<StyledLink href="#" | ||
onClick={openMissingPasswordFAQ} | ||
style={props.theme.linkStyle} | ||
> | ||
{props.text} | ||
</StyledLink> | ||
); | ||
|
||
// The FAQ section related to missing passwords is specific to MacOS/ARM -- only show it | ||
// in that case. | ||
const newArchitectureReleasedRecently = Date.now() <= Date.UTC(2023, 11); // 11 = December | ||
const showMacInfoLink = shim.isMac() && process.arch === 'arm64' && newArchitectureReleasedRecently; | ||
|
||
return showMacInfoLink ? macInfoLink : null; | ||
}; | ||
|
||
export default MacOSMissingPasswordHelpLink; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters