mirror of
https://github.com/revanced/revanced-website.git
synced 2025-05-10 11:24:27 +02:00
chore: Apply lint fixes
This commit is contained in:
parent
a01d3f9d84
commit
54a0dd7350
@ -18,24 +18,24 @@ function makeStore(): Readable<RouterEvent> {
|
|||||||
return derived(page, ($page) => {
|
return derived(page, ($page) => {
|
||||||
return { navigating: false, target_url: $page.url };
|
return { navigating: false, target_url: $page.url };
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
// On client.
|
|
||||||
let current = new URL(location.href);
|
|
||||||
|
|
||||||
// Return store that responds to navigation events.
|
|
||||||
// The `navigating` store immediately "pushes" `null`.
|
|
||||||
// This in turn causes this derived store to immediately "push" the current URL.
|
|
||||||
return derived(navigating, ($nav) => {
|
|
||||||
let navigating = false;
|
|
||||||
// $nav is null when navigation finishes.
|
|
||||||
if ($nav != null && $nav.to != null) {
|
|
||||||
current = $nav.to.url;
|
|
||||||
navigating = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return { navigating, target_url: current };
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// On client.
|
||||||
|
let current = new URL(location.href);
|
||||||
|
|
||||||
|
// Return store that responds to navigation events.
|
||||||
|
// The `navigating` store immediately "pushes" `null`.
|
||||||
|
// This in turn causes this derived store to immediately "push" the current URL.
|
||||||
|
return derived(navigating, ($nav) => {
|
||||||
|
let navigating = false;
|
||||||
|
// $nav is null when navigation finishes.
|
||||||
|
if ($nav != null && $nav.to != null) {
|
||||||
|
current = $nav.to.url;
|
||||||
|
navigating = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return { navigating, target_url: current };
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do not subscribe to it outside of components!
|
// Do not subscribe to it outside of components!
|
||||||
|
@ -9,8 +9,7 @@ import type {
|
|||||||
DonationPlatform,
|
DonationPlatform,
|
||||||
CryptoWallet,
|
CryptoWallet,
|
||||||
Social,
|
Social,
|
||||||
About,
|
About
|
||||||
CompatiblePackage
|
|
||||||
} from '$lib/types';
|
} from '$lib/types';
|
||||||
|
|
||||||
export type ContributorsData = { contributables: Contributable[] };
|
export type ContributorsData = { contributables: Contributable[] };
|
||||||
@ -41,20 +40,21 @@ async function patches(): Promise<PatchesData> {
|
|||||||
const json = await get_json('v4/patches/list');
|
const json = await get_json('v4/patches/list');
|
||||||
const packagesWithCount: { [key: string]: number } = {};
|
const packagesWithCount: { [key: string]: number } = {};
|
||||||
|
|
||||||
json.forEach((patch) => {
|
for (const patch of json) {
|
||||||
if (!patch.compatiblePackages) return;
|
if (!patch.compatiblePackages) continue;
|
||||||
|
|
||||||
patch.compatiblePackages = Object.keys(patch.compatiblePackages).map((name) => ({
|
patch.compatiblePackages = Object.keys(patch.compatiblePackages).map((name) => ({
|
||||||
name,
|
name,
|
||||||
versions: patch.compatiblePackages[name]
|
versions: patch.compatiblePackages[name]
|
||||||
}));
|
}));
|
||||||
});
|
}
|
||||||
|
|
||||||
// gets packages and patch count
|
// gets packages and patch count
|
||||||
for (let i = 0; i < json.length; i++) {
|
for (const { compatiblePackages } of json) {
|
||||||
json[i].compatiblePackages?.forEach((pkg: CompatiblePackage) => {
|
if (!compatiblePackages) continue;
|
||||||
|
for (const pkg of compatiblePackages) {
|
||||||
packagesWithCount[pkg.name] = (packagesWithCount[pkg.name] || 0) + 1;
|
packagesWithCount[pkg.name] = (packagesWithCount[pkg.name] || 0) + 1;
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// sort packages by patch count to get most relevant apps on top
|
// sort packages by patch count to get most relevant apps on top
|
||||||
|
@ -12,7 +12,7 @@ function set_status_url(apiUrl: string) {
|
|||||||
.then((data) => {
|
.then((data) => {
|
||||||
if (data?.status) {
|
if (data?.status) {
|
||||||
localStorage.setItem(STATUS_KEY, data.status);
|
localStorage.setItem(STATUS_KEY, data.status);
|
||||||
console.log('status is now ' + localStorage.getItem(STATUS_KEY));
|
console.log('Status is now:', localStorage.getItem(STATUS_KEY));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user