Refresh library mangas after update

the gql updater subscription currently return stale data, thus, the mangas do net get updated in the cache
This commit is contained in:
schroda
2023-10-27 20:45:03 +02:00
parent b1aaeb4d5d
commit 09c7e804ba
2 changed files with 13 additions and 3 deletions

View File

@@ -45,7 +45,7 @@ const calcProgress = (status: UpdaterSubscription['updateStatusChanged'] | undef
return Number.isNaN(progress) ? 0 : progress;
};
function UpdateChecker() {
function UpdateChecker({ handleFinishedUpdate }: { handleFinishedUpdate: () => void }) {
const { t } = useTranslation();
const { data: updaterData } = requestManager.useUpdaterSubscription();
@@ -62,6 +62,11 @@ function UpdateChecker() {
],
);
const isUpdateFinished = progress === 100;
if (isUpdateFinished) {
handleFinishedUpdate();
}
const onClick = async () => {
try {
await requestManager.startGlobalUpdate().response;