1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-08-24 20:19:10 +02:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Laurent Cozic
708104661d Desktop release v2.12.19 2023-10-21 09:07:57 +01:00
Laurent Cozic
afaa2a7db3 All: Fixed issues related to sharing notes on read-only notebooks 2023-10-21 09:06:29 +01:00
Henry Heino
f4ee8af9ae Desktop: Update Electron to 25.9.0 (#9049) 2023-10-11 10:16:01 +01:00
4 changed files with 29 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@joplin/app-desktop",
"version": "2.12.18",
"version": "2.12.19",
"description": "Joplin for Desktop",
"main": "main.js",
"private": true,
@@ -116,7 +116,7 @@
"@types/react": "18.0.24",
"@types/react-redux": "7.1.25",
"@types/styled-components": "5.1.26",
"electron": "25.8.1",
"electron": "25.9.0",
"electron-builder": "24.4.0",
"glob": "10.3.3",
"gulp": "4.0.2",

View File

@@ -1,3 +1,4 @@
import Logger from '@joplin/utils/Logger';
import { ModelType } from '../../BaseModel';
import { ErrorCode } from '../../errors';
import JoplinError from '../../JoplinError';
@@ -5,6 +6,8 @@ import { State as ShareState } from '../../services/share/reducer';
import ItemChange from '../ItemChange';
import Setting from '../Setting';
const logger = Logger.create('models/utils/readOnly');
export interface ItemSlice {
id?: string;
share_id: string;
@@ -43,6 +46,18 @@ export const checkIfItemCanBeChanged = (itemType: ModelType, changeSource: numbe
export const checkIfItemCanBeAddedToFolder = async (itemType: ModelType, Folder: any, changeSource: number, shareState: ShareState, parentId: string) => {
if (needsReadOnlyChecks(itemType, changeSource, shareState) && parentId) {
const parentFolder = await Folder.load(parentId, { fields: ['id', 'share_id'] });
if (!parentFolder) {
// Historically it's always been possible to set the parent_id of a
// note to a folder that does not exist - this is to support
// synchronisation, where items are downloaded in random order. It
// is not ideal to skip the check here, but if for some reason the
// folder turns out to be read-only the issue will be resolved
// during sync.
logger.warn('checkIfItemCanBeAddedToFolder: Trying to add an item to a folder that does not exist - skipping check');
return;
}
if (itemIsReadOnlySync(itemType, changeSource, parentFolder, Setting.value('sync.userId'), shareState)) {
throw new JoplinError('Cannot add an item as a child of a read-only item', ErrorCode.IsReadOnly);
}

View File

@@ -24,6 +24,13 @@ const userFetcher = async () => {
const fileApi = await syncTarget.fileApi();
const api = fileApi.driver().api();
if (api.userId) {
// That can happen if we don't have a session yet or if it has been
// cleared
logger.info('Skipping fetching user because user ID is not available');
return;
}
const owner: UserApiResponse = await api.exec('GET', `api/users/${api.userId}`);
logger.info('Got user:', owner);

View File

@@ -4468,7 +4468,7 @@ __metadata:
compare-versions: 3.6.0
countable: 3.0.1
debounce: 1.2.1
electron: 25.8.1
electron: 25.9.0
electron-builder: 24.4.0
electron-window-state: 5.0.3
formatcoords: 1.1.3
@@ -14977,16 +14977,16 @@ __metadata:
languageName: node
linkType: hard
"electron@npm:25.8.1":
version: 25.8.1
resolution: "electron@npm:25.8.1"
"electron@npm:25.9.0":
version: 25.9.0
resolution: "electron@npm:25.9.0"
dependencies:
"@electron/get": ^2.0.0
"@types/node": ^18.11.18
extract-zip: ^2.0.1
bin:
electron: cli.js
checksum: 3305f0d3e3d68d8921533b4fd42003812778bd90d1884b2baa859b3a7d900354298e63298fbfbfcac9267223e0d0d3de584137aec52b764081f3c68bf4b09efc
checksum: 7d9bccf0af89ba7af1f904a58fdc623e6cade95e02956d4ccf6d998dadd2bac3d2a4f782a3d8a0f8bd92bdfc0d40c7a3b9b8af6bf50f104d9298c3ac4c642823
languageName: node
linkType: hard