Skip to content
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

[Bug]: Crash in Android after adding IGHORING FOLDER! #1065

Closed
Ahatzoda-Tehronshoh opened this issue Sep 13, 2024 · 5 comments
Closed

[Bug]: Crash in Android after adding IGHORING FOLDER! #1065

Ahatzoda-Tehronshoh opened this issue Sep 13, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@Ahatzoda-Tehronshoh
Copy link

Describe the bug

After adding "Folders to Ignore" in settings, command does not become active!
I change isEqualOrSubPath method and now it is working good in android and windows. I replace isEqualOrSubPath method to this:

function isEqualOrSubPath(toCheck, rootPath) {
 // Преобразуем пути в нижний регистр и заменяем обратные и прямые слэши на системный разделитель
  const normalizePath = (path) => {
    return path
      .toLowerCase()
      .replace(/\\/g, '/')
      .split('/')
      .filter((p) => p !== '');
  };

  const rootPathSections = normalizePath(rootPath);
  const pathSections = normalizePath(toCheck);

  if (pathSections.length < rootPathSections.length) {
    return false;
  }

  for (let i = 0; i < rootPathSections.length; i++) {
    if (rootPathSections[i] !== pathSections[i]) {
      return false;
    }
  }

  return true;
}

To Reproduce

Android Version Obsidian -> Spaced Repitition Plugin -> Settings -> Folders to Ignore -> adding some folder path -> execute command

Expected behavior

Can not execute Plugin's Command

Screenshots

No response

OS of your device

Android 13

Obsidian version

1.6.7

Plugin version

1.12.5

Installer version

No response

Additional context

No response

Config file

No response

@Ahatzoda-Tehronshoh Ahatzoda-Tehronshoh added the bug Something isn't working label Sep 13, 2024
@ronzulu
Copy link
Collaborator

ronzulu commented Sep 13, 2024

Please see #1064

@Ahatzoda-Tehronshoh
Copy link
Author

Please see #1064

Thank you for replying. I have read bug #1064, but I did not activate "Convert Folders to decks and subdecks".

My bug appears after adding a folder in "Folders to Ignore", and it does not disappear even after deleting all of them.
I could fix it only after uninstalling and installing again.
I debugged and handled the error in that method and rewrote the method myself. After rewriting, it is working well for the Android version and the Windows version also.

@ronzulu
Copy link
Collaborator

ronzulu commented Sep 13, 2024

I debugged and handled the error in that method and rewrote the method myself. After rewriting, it is working well for the Android version and the Windows version also.

That function was fixed in [FIX] isEqualOrSubPath function but not included in the latest mainstream release.

That fix is included in the beta release at:
Beta release of outstanding PRs #1011

If you are able to try that, and let us know if that solves your issue that would be appreciated.

Cheers
Ronny

@Ahatzoda-Tehronshoh
Copy link
Author

I am going to try it!
Thanks you!

@ronzulu
Copy link
Collaborator

ronzulu commented Sep 14, 2024

Thanks @Ahatzoda-Tehronshoh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants