mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-03 00:33:49 +03:00
feat: removing publishers
This commit is contained in:
parent
618d6f8337
commit
3a1fa9ab00
@ -37,8 +37,6 @@ export function App() {
|
|||||||
|
|
||||||
const { t } = useTranslation("app");
|
const { t } = useTranslation("app");
|
||||||
|
|
||||||
const downloadSourceMigrationLock = useRef(false);
|
|
||||||
|
|
||||||
const { updateRepacks } = useRepacks();
|
const { updateRepacks } = useRepacks();
|
||||||
|
|
||||||
const { clearDownload, setLastPacket } = useDownload();
|
const { clearDownload, setLastPacket } = useDownload();
|
||||||
@ -198,10 +196,6 @@ export function App() {
|
|||||||
}, [dispatch, draggingDisabled]);
|
}, [dispatch, draggingDisabled]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (downloadSourceMigrationLock.current) return;
|
|
||||||
|
|
||||||
downloadSourceMigrationLock.current = true;
|
|
||||||
|
|
||||||
updateRepacks();
|
updateRepacks();
|
||||||
|
|
||||||
const id = crypto.randomUUID();
|
const id = crypto.randomUUID();
|
||||||
|
@ -155,14 +155,15 @@ self.onmessage = async (event: MessageEvent<Payload>) => {
|
|||||||
const downloadSources = await downloadSourcesTable.toArray();
|
const downloadSources = await downloadSourcesTable.toArray();
|
||||||
const existingRepacks = await repacksTable.toArray();
|
const existingRepacks = await repacksTable.toArray();
|
||||||
|
|
||||||
|
if (downloadSources.some((source) => !source.fingerprint)) {
|
||||||
|
await Promise.all(
|
||||||
|
downloadSources.map(async (source) => {
|
||||||
|
await deleteDownloadSource(source.id);
|
||||||
|
await importDownloadSource(source.url);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
} else {
|
||||||
for (const downloadSource of downloadSources) {
|
for (const downloadSource of downloadSources) {
|
||||||
console.log(downloadSource);
|
|
||||||
if (!downloadSource.fingerprint) {
|
|
||||||
await deleteDownloadSource(downloadSource.id);
|
|
||||||
await importDownloadSource(downloadSource.url);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const headers = new AxiosHeaders();
|
const headers = new AxiosHeaders();
|
||||||
|
|
||||||
if (downloadSource.etag) {
|
if (downloadSource.etag) {
|
||||||
@ -211,6 +212,7 @@ self.onmessage = async (event: MessageEvent<Payload>) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
channel.postMessage(newRepacksCount);
|
channel.postMessage(newRepacksCount);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
Loading…
Reference in New Issue
Block a user