mirror of
https://github.com/laurent22/joplin.git
synced 2026-10-25 02:47:28 +00:00
Desktop, Mobile: Add Joplin Cloud account information to configuration screen (#10553)
This commit is contained in:
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;
|
||||
@@ -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}`);
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user