-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#71 - Legacy warning always appears. #72
Conversation
@arnaldop thank you for the contribution! going to review code |
There are 3 cases to cover:
1. Legacy editor only (or property is missing) - should warn
2. Legacy editor on - should warn
3. Legacy editor off - should not warn
Currently, even though I have the newest version of Obsidian with a clean
Vault, I get the warning every time I start Obsidian.
This change should ha dld all of these cases correctly. (I think!!! 😂)
…On Tue, Aug 9, 2022, 5:30 PM Viacheslav Slinko ***@***.***> wrote:
***@***.**** requested changes on this pull request.
------------------------------
In src/ObsidianZoomPlugin.ts
<#72 (comment)>:
> @@ -140,12 +140,8 @@ export default class ObsidianZoomPlugin extends Plugin {
}
private isLegacyEditorEnabled() {
- const config: { legacyEditor: boolean } = {
- legacyEditor: true,
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- ...(this.app.vault as any).config,
- };
-
- return config.legacyEditor;
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ const config = (this.app.vault as any).config;
+ return (!("legacyEditor" in config) && true) || config.legacyEditor;
It looks like your version should work like the original
<https://www.typescriptlang.org/play?#code/GYVwdgxgLglg9mABDAzgGQKYHMCGECeAogCYxRwBOhYOARgDYbEDCIFFGYUAFAG44h6UZgmAwsALkQ4w+AJSIA3gChEaxBAQooG0eKmLEjXARJlKU2nDiMZiAL6IAvEtXr3xvEVLkKUqBQgGAA0bu5qAHRR-ILCelih7vYA3MphiBxQbEiaYGJYEZ6mPpSp9mmgkLAIyOjYXma+1HSMxAByGADufAJCInn60rIKKu652roDWM6IMX3xqe6Z2YjcAITcAERF3uYUm8g58QoAZCeIAUEKAD7Xk-mF9cV7ZWnKjDoQwNMuiinK4xsGEKcCw3C+CVqmBMuyaNAYTFY7E4PAhcmCUKesMozQR7S64O+cjkaQhM0UO0aFkQwBw9BQGH+gMYILBEIxqGhDRKVHhrSRHC4hKw6MxMKpvJaTA63TRJIB33JlJ5-kCjNSzOB9FBwo5dXFPNx-LYgtRRL1XOecKl+NlRJJQA>.
What were you trying to change?
—
Reply to this email directly, view it on GitHub
<#72 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSVTDTTAGU5KBVM4SZDW23VYLEXFANCNFSM552XNCKQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@lukemt, I see your point in the TypeScript Playground. TBH, I am not sure how that is. My user experience is, every time I open my Obsidian, which is a fresh installation on a brand new Vault (thus, My feeling as a user is that I should only get that warning when I'm not sure how to fix this, but my local user experience is as not optimal, IMO. |
@arnaldop Ow, I have rights to do that. |
No description provided.