1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Chore: Desktop: Update for share permissions (#8528)

This commit is contained in:
Laurent Cozic
2023-07-23 15:57:55 +01:00
committed by GitHub
parent 880304c2fb
commit 1c1d20f82c
23 changed files with 201 additions and 71 deletions

View File

@@ -13,7 +13,8 @@ export interface ItemSlice {
// This function can be called to wrap any read-only-related code. It should be
// fast and allows an early exit for cases that don't apply, for example if not
// synchronising with Joplin Cloud or if not sharing any notebook.
export const needsReadOnlyChecks = (itemType: ModelType, changeSource: number, shareState: ShareState) => {
export const needsReadOnlyChecks = (itemType: ModelType, changeSource: number, shareState: ShareState, disableReadOnlyCheck = false) => {
if (disableReadOnlyCheck) return false;
if (Setting.value('sync.target') !== 10) return false;
if (changeSource === ItemChange.SOURCE_SYNC) return false;
if (!Setting.value('sync.userId')) return false;