Skip to content

Commit

Permalink
fix for login issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kinabalu committed Sep 21, 2024
1 parent cb5cb9d commit ea7c383
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 15 deletions.
5 changes: 4 additions & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ export default class VoiceNotesPlugin extends Plugin {
await this.loadSettings();
this.addSettingTab(new VoiceNotesSettingTab(this.app, this));

this.setupAutoSync();
if (this.settings.token) {
this.setupAutoSync();
}

this.addCommand({
id: 'manual-sync-voicenotes',
Expand Down Expand Up @@ -332,6 +334,7 @@ export default class VoiceNotesPlugin extends Plugin {
? recording.tags.map((tag: { name: string }) => `#${tag.name.replace(/\s+/g, '-')}`).join(' ')
: null;
const context = {
recording_id: recording.recording_id,
title: title,
date: formatDate(recording.created_at, this.settings.dateFormat),
transcript: transcript,
Expand Down
4 changes: 3 additions & 1 deletion settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export class VoiceNotesSettingTab extends PluginSettingTab {
if (this.plugin.settings.token) {
new Notice('Login to voicenotes.com was successful');
await this.plugin.saveSettings();
this.plugin.setupAutoSync();
await this.display();
} else {
new Notice('Login to voicenotes.com was unsuccessful');
Expand All @@ -78,6 +79,7 @@ export class VoiceNotesSettingTab extends PluginSettingTab {
if (response) {
new Notice('Login to voicenotes.com was successful');
await this.plugin.saveSettings();
this.plugin.setupAutoSync();
await this.display();
} else {
new Notice('Login to voicenotes.com was unsuccessful');
Expand Down Expand Up @@ -227,7 +229,7 @@ export class VoiceNotesSettingTab extends PluginSettingTab {

new Setting(containerEl)
.setName('Custom Note Template')
.setDesc('Custom template for synced notes. Available variables: {{title}}, {{date}}, {{transcript}}, {{audio_link}}, {{summary}}, {{tidy}}, {{points}}, {{todo}}, {{email}}, {{tweet}}, {{blog}}, {{custom}}, {{parent_note}} and {{related_notes}} (uncheck to add a custom frontmatter)')
.setDesc('Custom template for synced notes. Available variables: {{recording_id}}, {{title}}, {{date}}, {{transcript}}, {{audio_link}}, {{summary}}, {{tidy}}, {{points}}, {{todo}}, {{email}}, {{tweet}}, {{blog}}, {{custom}}, {{parent_note}} and {{related_notes}} (uncheck to add a custom frontmatter)')
.addTextArea((text) => {
text
.setPlaceholder(this.plugin.settings.noteTemplate)
Expand Down
37 changes: 24 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.11.0.tgz#b0ffd0312b4a3fd2d6f77237e7248a5ad3a680ae"
integrity sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==

"@eslint/eslintrc@^2.1.1":
"@eslint/eslintrc@^2.1.4":
version "2.1.4"
resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.4.tgz#388a269f0f25c1b6adc317b5a2c55714894c70ad"
integrity sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==
Expand All @@ -29,12 +29,12 @@
minimatch "^3.1.2"
strip-json-comments "^3.1.1"

"@eslint/js@^8.46.0":
"@eslint/js@8.57.0":
version "8.57.0"
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.57.0.tgz#a5417ae8427873f1dd08b70b3574b453e67b5f7f"
integrity sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==

"@humanwhocodes/config-array@^0.11.10":
"@humanwhocodes/config-array@^0.11.14":
version "0.11.14"
resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.14.tgz#d78e481a039f7566ecc9660b4ea7fe6b1fec442b"
integrity sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==
Expand Down Expand Up @@ -351,6 +351,11 @@
"@typescript-eslint/types" "8.0.1"
eslint-visitor-keys "^3.4.3"

"@ungap/structured-clone@^1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406"
integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==

acorn-jsx@^5.3.2:
version "5.3.2"
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937"
Expand Down Expand Up @@ -563,31 +568,32 @@ eslint-scope@^7.2.2:
esrecurse "^4.3.0"
estraverse "^5.2.0"

eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.2, eslint-visitor-keys@^3.4.3:
eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3:
version "3.4.3"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800"
integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==

eslint@8.46.0:
version "8.46.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.46.0.tgz#a06a0ff6974e53e643acc42d1dcf2e7f797b3552"
integrity sha512-cIO74PvbW0qU8e0mIvk5IV3ToWdCq5FYG6gWPHHkx6gNdjlbAYvtfHmlCMXxjcoVaIdwy/IAt3+mDkZkfvb2Dg==
eslint@^8.57.0:
version "8.57.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.57.0.tgz#c786a6fd0e0b68941aaf624596fb987089195668"
integrity sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==
dependencies:
"@eslint-community/eslint-utils" "^4.2.0"
"@eslint-community/regexpp" "^4.6.1"
"@eslint/eslintrc" "^2.1.1"
"@eslint/js" "^8.46.0"
"@humanwhocodes/config-array" "^0.11.10"
"@eslint/eslintrc" "^2.1.4"
"@eslint/js" "8.57.0"
"@humanwhocodes/config-array" "^0.11.14"
"@humanwhocodes/module-importer" "^1.0.1"
"@nodelib/fs.walk" "^1.2.8"
"@ungap/structured-clone" "^1.2.0"
ajv "^6.12.4"
chalk "^4.0.0"
cross-spawn "^7.0.2"
debug "^4.3.2"
doctrine "^3.0.0"
escape-string-regexp "^4.0.0"
eslint-scope "^7.2.2"
eslint-visitor-keys "^3.4.2"
eslint-visitor-keys "^3.4.3"
espree "^9.6.1"
esquery "^1.4.2"
esutils "^2.0.2"
Expand Down Expand Up @@ -918,6 +924,11 @@ jackspeak@^3.1.2:
optionalDependencies:
"@pkgjs/parseargs" "^0.11.0"

jinja-js@^0.1.8:
version "0.1.8"
resolved "https://registry.yarnpkg.com/jinja-js/-/jinja-js-0.1.8.tgz#0b13eeb96e90993f040514d7ce64f53786f58511"
integrity sha512-1wJNbeZxknEckfqt5VU4oVvphC2qASn9yfAw5BNF0JhRZM5LNPcnQKC6nAiEx8nJh0NhxkjCWjQDOut/zQqUOw==

js-yaml@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
Expand Down Expand Up @@ -1430,4 +1441,4 @@ wrappy@1:
yocto-queue@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==

0 comments on commit ea7c383

Please sign in to comment.