bruiken / Notepad--

Notepad--, a lightweight web based editor with numerous optional features.
MIT License
3 stars 0 forks source link

Star in tab does not get removed on save of tab #36

Closed Justin-Reniers closed 3 years ago

jwijenbergh commented 3 years ago

For me this happens when I'm trying to save a tab that previously had saved text, but now the text field is empty. Is there any other scenario where you encountered this?

jwijenbergh commented 3 years ago

Please test 1825df7, it seems to work in every scenario that I've tested now. It did not only happen when there is empty text but also if the text is the same as the previous text.

Justin-Reniers commented 3 years ago

For me this happens when I'm trying to save a tab that previously had saved text, but now the text field is empty. Is there any other scenario where you encountered this?

This also happened to me whenever I added text, and removed exactly that text and then try to save it: the modal that says the tab has been saved pops up, but the star remains. The modal also keeps popping up in the same fashion as our saved modal initially did.

Justin-Reniers commented 3 years ago

Please test 1825df7, it seems to work in every scenario that I've tested now. It did not only happen when there is empty text but also if the text is the same as the previous text.

It still does not seem to work for me. The star persists, and if I try to save an empty tab, the modal does not pop up at all. Edit - It might be just on my browser? Some of the bugs that we seemed to have only really happened on my browser, it would be great if either @bornobob or @huynguy97 could also test this fix.

jwijenbergh commented 3 years ago

It still does not seem to work for me. The star persists, and if I try to save an empty tab, the modal does not pop up at all. Edit - It might be just on my browser? Some of the bugs that we seemed to have only really happened on my browser, it would be great if either @bornobob or @huynguy97 could also test this fix.

Did you have syntax highlighting disabled? I see that syntax highlighting makes it so that isSaved is updated more frequently (we need to remove this code). Will post a new commit for you to try. New empty tabs are automatically saved btw, you can only save when there is a * in the title.

This also happened to me whenever I added text, and removed exactly that text and then try to save it: the modal that says the tab has been saved pops up, but the star remains. The modal also keeps popping up in the same fashion as our saved modal initially did.

However, this is really weird as this should never happen. The function that calls the modal also calls the setTitle function (and the conditions of that should be satisfied to remove the star), can you test it in a private window? It might be that something is messing up in your cache

Anyways, test 4cc52c7 in a clean browser

jwijenbergh commented 3 years ago

When I load a file, save it, reload the page and then delete the contents of the tab and then try to save it indeed still doesn't work. Will debug this.

Another commit... 454e9a6, fixes this issue for me.

Justin-Reniers commented 3 years ago

It still does not seem to work for me. The star persists, and if I try to save an empty tab, the modal does not pop up at all. Edit - It might be just on my browser? Some of the bugs that we seemed to have only really happened on my browser, it would be great if either @bornobob or @huynguy97 could also test this fix.

Did you have syntax highlighting disabled? I see that syntax highlighting makes it so that isSaved is updated more frequently (we need to remove this code). Will post a new commit for you to try. New empty tabs are automatically saved btw, you can only save when there is a * in the title.

This also happened to me whenever I added text, and removed exactly that text and then try to save it: the modal that says the tab has been saved pops up, but the star remains. The modal also keeps popping up in the same fashion as our saved modal initially did.

However, this is really weird as this should never happen. The function that calls the modal also calls the setTitle function (and the conditions of that should be satisfied to remove the star), can you test it in a private window? It might be that something is messing up in your cache

Anyways, test 4cc52c7 in a clean browser

It's super nice! This works in a clean browser indeed. I'm going to clear out the cache of my browser, but I've verified that it works.

Justin-Reniers commented 3 years ago

When I load a file, save it, reload the page and then delete the contents of the tab and then try to save it indeed still doesn't work. Will debug this.

Another commit... 454e9a6, fixes this issue for me.

This also works for me! With that, I think all the bugs have been resolved as far as my manual testing has shown. I think we can close the issue for now. Good work!