You've already forked joplin
							
							
				mirror of
				https://github.com/laurent22/joplin.git
				synced 2025-10-31 00:07:48 +02:00 
			
		
		
		
	Desktop: Fixes #8844: Hide option to share a notebook when it is not available
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user