diff --git a/src/apiclient.ts b/src/apiclient.ts index f6b3d6e..b96405b 100644 --- a/src/apiclient.ts +++ b/src/apiclient.ts @@ -258,7 +258,7 @@ export class PocketbookCloudLoginClient { // use first defined response, if any const login_response = login_responses.filter(response => response.result).first(); if (!login_response) { - throw new Error('Could not log in to Pocketbook Cloud'); + throw new Error('Could not log in to Pocketbook Cloud - check if username / password are correct.'); } this.access_token = login_response.result.access_token; diff --git a/src/settings.ts b/src/settings.ts index 35a52fa..6526009 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -64,12 +64,17 @@ export class PocketbookCloudHighlightsImporterSettingTab extends PluginSettingTa null, new Date() ); - api_client.login(); + try { + await api_client.login(); + } catch (error) { + new Notice(`❌ Error logging in: ${error.message}`); + return; + } this.plugin.settings.access_token = await api_client.getAccessToken(); this.plugin.settings.access_token_valid_until = api_client.getAccessTokenValidUntil(); this.plugin.settings.refresh_token = await api_client.getRefreshToken(); - this.plugin.saveSettings(); + await this.plugin.saveSettings(); shop_name_text_field.setValue(this.plugin.settings.shop_name); diff --git a/test-vault/.obsidian/community-plugins.json b/test-vault/.obsidian/community-plugins.json index a50b08b..7fac138 100644 --- a/test-vault/.obsidian/community-plugins.json +++ b/test-vault/.obsidian/community-plugins.json @@ -1,5 +1,4 @@ [ "dataview", - "obsidian-pocketbook-cloud-highlight-importer", "pocketbook-cloud-highlight-importer" ] \ No newline at end of file diff --git a/test-vault/.obsidian/core-plugins.json b/test-vault/.obsidian/core-plugins.json index 9405bfd..c1d47db 100644 --- a/test-vault/.obsidian/core-plugins.json +++ b/test-vault/.obsidian/core-plugins.json @@ -1,20 +1,32 @@ -[ - "file-explorer", - "global-search", - "switcher", - "graph", - "backlink", - "canvas", - "outgoing-link", - "tag-pane", - "page-preview", - "daily-notes", - "templates", - "note-composer", - "command-palette", - "editor-status", - "bookmarks", - "outline", - "word-count", - "file-recovery" -] \ No newline at end of file +{ + "file-explorer": true, + "global-search": true, + "switcher": true, + "graph": true, + "backlink": true, + "canvas": true, + "outgoing-link": true, + "tag-pane": true, + "page-preview": true, + "daily-notes": true, + "templates": true, + "note-composer": true, + "command-palette": true, + "slash-command": false, + "editor-status": true, + "starred": true, + "markdown-importer": false, + "zk-prefixer": false, + "random-note": false, + "outline": true, + "word-count": true, + "slides": false, + "audio-recorder": false, + "workspaces": false, + "file-recovery": true, + "publish": false, + "sync": false, + "bookmarks": true, + "properties": false, + "webviewer": false +} \ No newline at end of file diff --git a/test-vault/.obsidian/plugins/pocketbook-cloud-highlight-importer/.gitignore b/test-vault/.obsidian/plugins/pocketbook-cloud-highlight-importer/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/test-vault/.obsidian/plugins/pocketbook-cloud-highlight-importer/manifest.json b/test-vault/.obsidian/plugins/pocketbook-cloud-highlight-importer/manifest.json index 32f6fca..fe648f7 100644 --- a/test-vault/.obsidian/plugins/pocketbook-cloud-highlight-importer/manifest.json +++ b/test-vault/.obsidian/plugins/pocketbook-cloud-highlight-importer/manifest.json @@ -1,7 +1,7 @@ { "id": "pocketbook-cloud-highlight-importer", "name": "Pocketbook Cloud Highlight Importer", - "version": "0.1.5", + "version": "0.1.6", "minAppVersion": "1.1.16", "description": "Imports notes and highlights from your Pocketbook Cloud account.", "author": "Lena Brüder", diff --git a/test-vault/.obsidian/workspace.json b/test-vault/.obsidian/workspace.json index 70339e1..544bcac 100644 --- a/test-vault/.obsidian/workspace.json +++ b/test-vault/.obsidian/workspace.json @@ -12,7 +12,9 @@ "type": "leaf", "state": { "type": "empty", - "state": {} + "state": {}, + "icon": "lucide-file", + "title": "New tab" } } ] @@ -34,8 +36,11 @@ "state": { "type": "file-explorer", "state": { - "sortOrder": "alphabetical" - } + "sortOrder": "alphabetical", + "autoReveal": false + }, + "icon": "lucide-folder-closed", + "title": "Files" } }, { @@ -50,7 +55,9 @@ "collapseAll": false, "extraContext": false, "sortOrder": "alphabetical" - } + }, + "icon": "lucide-search", + "title": "Search" } }, { @@ -58,7 +65,9 @@ "type": "leaf", "state": { "type": "starred", - "state": {} + "state": {}, + "icon": "lucide-file", + "title": "Plugin no longer active" } }, { @@ -66,7 +75,9 @@ "type": "leaf", "state": { "type": "bookmarks", - "state": {} + "state": {}, + "icon": "lucide-bookmark", + "title": "Bookmarks" } } ] @@ -96,7 +107,9 @@ "searchQuery": "", "backlinkCollapsed": false, "unlinkedCollapsed": true - } + }, + "icon": "links-coming-in", + "title": "Backlinks" } }, { @@ -107,7 +120,9 @@ "state": { "linksCollapsed": false, "unlinkedCollapsed": true - } + }, + "icon": "links-going-out", + "title": "Outgoing links" } }, { @@ -117,8 +132,12 @@ "type": "tag", "state": { "sortOrder": "frequency", - "useHierarchy": true - } + "useHierarchy": true, + "showSearch": false, + "searchQuery": "" + }, + "icon": "lucide-tags", + "title": "Tags" } }, { @@ -126,7 +145,13 @@ "type": "leaf", "state": { "type": "outline", - "state": {} + "state": { + "followCursor": false, + "showSearch": false, + "searchQuery": "" + }, + "icon": "lucide-list", + "title": "Outline" } } ]