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

Preliminary fix for update button deleting all mangas #22

Merged
merged 3 commits into from
Oct 30, 2023

Conversation

db-2001
Copy link
Collaborator

@db-2001 db-2001 commented Oct 30, 2023

Moved the code to populate the mangas into ResetContent().

Addresses #18 (but with proper Git etiquette)

Copy link
Owner

@C9Glax C9Glax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay thank you 😄
The reason

GetMonitorJobs().then((json) => {
    if(monitoringJobsCount != json.length){
      ResetContent();
      //console.log(json);
      json.forEach(job => {
        var mangaView = CreateManga(job.manga, job.mangaConnector.name);
        mangaView.addEventListener("click", (event) => {
          ShowMangaWindow(job, job.manga, event, false);
        });
        tasksContent.appendChild(mangaView);
      });
      monitoringJobsCount = json.length;
    }
  });

was in UpdateJobs() was to also reflect changes made from other sources. With the removal from that function (which is called every second, see line 83-85), these - to the website - external changes would only become apparent when reloading.

So you could leave that block in UpdateJobs() (with the comparison of monitoringJobsCount), and just additionally call in ResetContent() I think it should work.

@db-2001
Copy link
Collaborator Author

db-2001 commented Oct 30, 2023

Ok, yeah, that makes sense, I wasn't necessarily thinking about external sources. I added that block of code as it was originally back in, in addition to adding it into ResetContent()

@C9Glax C9Glax merged commit 135aca0 into C9Glax:master Oct 30, 2023
1 check failed
@db-2001 db-2001 deleted the fix-update-button branch October 30, 2023 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants