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

Position occasionally reverts back to starting position #27

Open
nayyala opened this issue Jun 2, 2023 · 2 comments
Open

Position occasionally reverts back to starting position #27

nayyala opened this issue Jun 2, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@nayyala
Copy link

nayyala commented Jun 2, 2023

Plugin informations (please complete the following information):

  • OS: Windows 11
  • Chesser version: most recent
  • Obsidian version: 1.3

Describe the bug
When I first compile the Chesser block, everything is great and it render. But then upon making an edit, it seems to first revert back to the starting position. I then move my cursor back into the chesser block and it fixes itself at the second try. It works but is very annoying to constantly deal with.

Expected behavior
Once the Chesser block is created, it should persist the FEN every time it's compiled

Recording.2023-06-02.150827.mp4
@nayyala nayyala added the bug Something isn't working label Jun 2, 2023
@latenitecoding
Copy link

I tried putting a little bit of work into this issue. I did come up with one quick fix, which was to instantiate the Chess object with the confi.fen string (if it exists). If a page has chesser and the positions have already been rendered, if you close and open that page, it will open with the correctly rendered position. However, if you attempt to edit the chesser block or otherwise look at its markdown, it will alternate between rendering the initial board state and the correct board position.

My guess is that there is either a null exception or that there are too many attempts to load FEN strings. A better way to deal with FEN strings isn't to keep loading them but to construct a singleton Chess object with the FEN string that is then used forever and doesn't permit new FEN strings to be loaded.

@latenitecoding
Copy link

I'm not as happy with my fix since I haven't been able to stop it from alternating positions, but I can send you what I have so far if you're interested. It's enough for me I think to just be able to open a note with the correct positions. I don't open the chesser blocks very often.

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

3 participants