mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
Desktop: Fixes #8844: Hide option to share a notebook when it is not available
This commit is contained in:
parent
efd7cc7a6b
commit
b9f36705ff
@ -18,6 +18,6 @@ export const runtime = (comp: any): CommandRuntime => {
|
||||
},
|
||||
});
|
||||
},
|
||||
enabledCondition: 'joplinServerConnected && (folderIsShareRootAndOwnedByUser || !folderIsShared)',
|
||||
enabledCondition: 'joplinServerConnected && joplinCloudAccountType != 1 && (folderIsShareRootAndOwnedByUser || !folderIsShared)',
|
||||
};
|
||||
};
|
||||
|
@ -723,6 +723,8 @@ class Setting extends BaseModel {
|
||||
|
||||
'sync.10.canUseSharePermissions': { value: false, type: SettingItemType.Bool, public: false },
|
||||
|
||||
'sync.10.accountType': { value: 0, type: SettingItemType.Int, public: false },
|
||||
|
||||
'sync.5.syncTargets': { value: {}, type: SettingItemType.Object, public: false },
|
||||
|
||||
'sync.resourceDownloadMode': {
|
||||
|
@ -32,6 +32,7 @@ export interface WhenClauseContext {
|
||||
folderIsShared: boolean;
|
||||
folderIsShareRoot: boolean;
|
||||
joplinServerConnected: boolean;
|
||||
joplinCloudAccountType: number;
|
||||
hasMultiProfiles: boolean;
|
||||
noteIsReadOnly: boolean;
|
||||
folderIsReadOnly: boolean;
|
||||
@ -87,6 +88,7 @@ export default function stateToWhenClauseContext(state: State, options: WhenClau
|
||||
folderIsShared: commandFolder ? !!commandFolder.share_id : false,
|
||||
|
||||
joplinServerConnected: [9, 10].includes(settings['sync.target']),
|
||||
joplinCloudAccountType: settings['sync.target'] === 10 ? settings['sync.10.accountType'] : 0,
|
||||
|
||||
hasMultiProfiles: state.profileConfig && state.profileConfig.profiles.length > 1,
|
||||
|
||||
|
@ -12,6 +12,7 @@ interface UserApiResponse {
|
||||
};
|
||||
inbox_email?: string;
|
||||
can_use_share_permissions?: number;
|
||||
account_type?: number;
|
||||
}
|
||||
|
||||
const userFetcher = async () => {
|
||||
@ -31,6 +32,7 @@ const userFetcher = async () => {
|
||||
Setting.setValue('sync.10.inboxId', owner.inbox ? owner.inbox.jop_id : '');
|
||||
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);
|
||||
};
|
||||
|
||||
// Listen to the event only once
|
||||
|
Loading…
Reference in New Issue
Block a user