mirror of
https://github.com/ReVanced/revanced-website.git
synced 2026-01-20 01:33:57 +00:00
feat: loading spinner and re-add hydration
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
import { readable } from 'svelte/store';
|
||||
import type { Repository } from 'src/data/types';
|
||||
|
||||
export type ContribData = { repositories: Repository[] };
|
||||
|
||||
const fetchContributors = async (): Promise<ContribData> => {
|
||||
const response = await fetch('https://releases.rvcd.win/contributors');
|
||||
const data = await response.json();
|
||||
return data;
|
||||
};
|
||||
|
||||
export const ContributorsStore = readable(fetchContributors());
|
||||
@@ -1,23 +0,0 @@
|
||||
import { readable } from 'svelte/store';
|
||||
import type { Patch } from 'src/data/types';
|
||||
|
||||
export type PatchesData = { patches: Patch[]; packages: string[] };
|
||||
|
||||
const fetchPatches = async (): Promise<PatchesData> => {
|
||||
const response = await fetch('https://releases.rvcd.win/patches');
|
||||
const patches = await response.json();
|
||||
let packages: string[] = [];
|
||||
|
||||
// gets packages
|
||||
for (let i = 0; i < patches.length; i++) {
|
||||
patches[i].compatiblePackages.forEach((pkg: Patch) => {
|
||||
let index = packages.findIndex((x) => x == pkg.name);
|
||||
if (index === -1) {
|
||||
packages.push(pkg.name);
|
||||
}
|
||||
});
|
||||
}
|
||||
return { patches, packages };
|
||||
};
|
||||
|
||||
export const PatchesStore = readable(fetchPatches());
|
||||
Reference in New Issue
Block a user