1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-24 08:12:24 +02:00

Merge branch 'release-1.2' into dev

This commit is contained in:
Laurent Cozic 2020-10-07 21:00:20 +01:00
commit c9c44d5643
7 changed files with 40 additions and 22 deletions

View File

@ -115,17 +115,9 @@ class SideBarComponent extends React.Component<Props, State> {
this.header_contextMenu = this.header_contextMenu.bind(this);
this.onAddFolderButtonClick = this.onAddFolderButtonClick.bind(this);
this.folderItem_click = this.folderItem_click.bind(this);
this.itemContextMenu = this.itemContextMenu.bind(this);
}
// componentDidUpdate(prevProps:any, _prevState:any) {
// const props = this.props as any;
// for (const k in this.props) {
// if (prevProps[k] !== props[k]) {
// console.info('Props', k, props[k]);
// }
// }
// }
onFolderDragStart_(event:any) {
const folderId = event.currentTarget.getAttribute('data-folder-id');
if (!folderId) return;
@ -412,7 +404,7 @@ class SideBarComponent extends React.Component<Props, State> {
selected={selected}
data-id={tag.id}
data-type={BaseModel.TYPE_TAG}
onContextMenu={(event:any) => this.itemContextMenu(event)}
onContextMenu={this.itemContextMenu}
onClick={() => {
this.tagItem_click(tag);
}}

View File

@ -78,6 +78,7 @@ export const StyledListItemAnchor = styled.a`
flex: 1;
align-items: center;
user-select: none;
height: 100%;
`;
export const StyledExpandLink = styled.a`

View File

@ -1,6 +1,6 @@
{
"name": "Joplin",
"version": "1.2.3",
"version": "1.2.4",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -1535,7 +1535,7 @@
},
"mkdirp": {
"version": "0.5.1",
"resolved": false,
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"dev": true,
"optional": true,
@ -1701,7 +1701,7 @@
"dependencies": {
"minimist": {
"version": "1.2.0",
"resolved": false,
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true,
"optional": true
@ -1817,7 +1817,7 @@
},
"tar": {
"version": "4.4.8",
"resolved": false,
"resolved": "https://registry.npmjs.org/tar/-/tar-4.4.8.tgz",
"integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==",
"dev": true,
"optional": true,
@ -6122,7 +6122,7 @@
"dependencies": {
"minimist": {
"version": "1.2.0",
"resolved": false,
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true,
"optional": true

View File

@ -1,6 +1,6 @@
{
"name": "Joplin",
"version": "1.2.3",
"version": "1.2.4",
"description": "Joplin for Desktop",
"main": "main.js",
"scripts": {

View File

@ -125,8 +125,8 @@ android {
applicationId "net.cozic.joplin"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 2097579
versionName "1.2.2"
versionCode 2097580
versionName "1.2.3"
ndk {
abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}

View File

@ -82,12 +82,18 @@
<!-- 2018-12-16: Changed android:launchMode from "singleInstance" to "singleTop" for Firebase notification -->
<!-- Previously singleInstance was necessary to prevent multiple instance of the RN app from running at the same time, but maybe no longer needed. -->
<!-- 2020-10-06: Changed back again to "singleInstance" and notifications still seem to work. Changing to singleInstance -->
<!-- to try to fix this bug: https://discourse.joplinapp.org/t/joplin-android-app-looses-nextcloud-sync-settings/10997/6 -->
<!-- Users would lose their settings, and it's possibly due to multiple instances of the app running at the same time, perhaps -->
<!-- due to sharing with the app. When checking the log, it would show "saving settings", then the app startup message, and after the app -->
<!-- has started, it would show "setting saved". So basically the app, or one instance of it, has started while settings were being saved -->
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize"
android:launchMode="singleTop">
android:launchMode="singleInstance">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />

View File

@ -349,6 +349,8 @@ class JoplinDatabase extends Database {
+ `Expected version: ${existingDatabaseVersions[existingDatabaseVersions.length - 1]}`);
}
this.logger().info(`Upgrading database from version ${fromVersion}`);
if (currentVersionIndex == existingDatabaseVersions.length - 1) return fromVersion;
let latestVersion = fromVersion;
@ -856,18 +858,32 @@ class JoplinDatabase extends Database {
queries.push('CREATE VIRTUAL TABLE notes_spellfix USING spellfix1');
}
queries.push({ sql: 'UPDATE version SET version = ?', params: [targetVersion] });
const updateVersionQuery = { sql: 'UPDATE version SET version = ?', params: [targetVersion] };
queries.push(updateVersionQuery);
try {
await this.transactionExecBatch(queries);
} catch (error) {
// In some cases listed below, when the upgrade fail it is acceptable (a fallback will be used)
// and in those cases, even though it fails, we still want to set the version number so that the
// migration is not repeated on next upgrade.
let saveVersionAgain = false;
if (targetVersion === 15 || targetVersion === 18 || targetVersion === 33) {
this.logger().warn('Could not upgrade to database v15 or v18 or v33 - FTS feature will not be used', error);
saveVersionAgain = true;
} else if (targetVersion === 34) {
// this.logger().warn('Could not upgrade to database v34 - fuzzy search will not be used', error);
this.logger().warn('Could not upgrade to database v34 - fuzzy search will not be used', error);
saveVersionAgain = true;
} else {
throw error;
}
if (saveVersionAgain) {
this.logger().info('Migration failed with fallback and will not be repeated - saving version number');
await this.transactionExecBatch([updateVersionQuery]);
}
}
latestVersion = targetVersion;
@ -933,10 +949,13 @@ class JoplinDatabase extends Database {
const version = !versionRow ? 0 : versionRow.version;
const tableFieldsVersion = !versionRow ? 0 : versionRow.table_fields_version;
this.version_ = version;
this.logger().info('Current database version', version);
this.logger().info('Current database version', versionRow);
const newVersion = await this.upgradeDatabase(version);
this.version_ = newVersion;
this.logger().info(`New version: ${newVersion}. Previously recorded version: ${tableFieldsVersion}`);
if (newVersion !== tableFieldsVersion) await this.refreshTableFields(newVersion);
this.tableFields_ = {};