Desktop, Mobile: Add Joplin Cloud account information to configuration screen (#10553)

This commit is contained in:
pedr authored and GitHub committed 2024-06-12 15:14:32 +01:00
1 parent 7d0cc675aa
commit 889c395818
10 files changed
+173 -30

No files matched your search

@@ -1,6 +1,6 @@
import * as fs from 'fs-extra';
import markdownUtils, { MarkdownTableHeader, MarkdownTableRow } from '../markdownUtils';
import { _ } from '../locale';
import markdownUtils, { MarkdownTableHeader, MarkdownTableRow } from '../../markdownUtils';
import { _ } from '../../locale';
import { htmlentities } from '@joplin/utils/html';
type FeatureId = string;
+16
View File
@@ -0,0 +1,16 @@
enum AccountType {
Default = 0,
Basic = 1,
Pro = 2,
Team = 3,
}
// eslint-disable-next-line import/prefer-default-export
export function accountTypeToString(accountType: AccountType): string {
if (accountType === AccountType.Default) return 'Default';
if (accountType === AccountType.Basic) return 'Basic';
if (accountType === AccountType.Pro) return 'Pro';
if (accountType === AccountType.Team) return 'Team';
const exhaustivenessCheck: never = accountType;
throw new Error(`Invalid type: ${exhaustivenessCheck}`);
}
+2
View File
@@ -13,6 +13,7 @@ interface UserApiResponse {
inbox_email?: string;
can_use_share_permissions?: number;
account_type?: number;
email: string;
}
const userFetcher = async () => {
@@ -40,6 +41,7 @@ const userFetcher = async () => {
Setting.setValue('sync.10.inboxEmail', owner.inbox_email ? owner.inbox_email : '');
Setting.setValue('sync.10.canUseSharePermissions', !!owner.can_use_share_permissions);
Setting.setValue('sync.10.accountType', owner.account_type);
Setting.setValue('sync.10.userEmail', owner.email);
};
// Listen to the event only once