mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-11 13:56:16 +00:00
feat: add feature flag check for Nimbus preview on Repack Modal
This commit is contained in:
@@ -4,6 +4,7 @@ enum Feature {
|
||||
CheckDownloadWritePermission = "CHECK_DOWNLOAD_WRITE_PERMISSION",
|
||||
Torbox = "TORBOX",
|
||||
Nimbus = "NIMBUS",
|
||||
NimbusPreview = "NIMBUS_PREVIEW",
|
||||
}
|
||||
|
||||
export function useFeature() {
|
||||
|
||||
@@ -14,7 +14,7 @@ import { DownloadSettingsModal } from "./download-settings-modal";
|
||||
import { gameDetailsContext } from "@renderer/context";
|
||||
import { Downloader } from "@shared";
|
||||
import { orderBy } from "lodash-es";
|
||||
import { useDate } from "@renderer/hooks";
|
||||
import { useDate, useFeature } from "@renderer/hooks";
|
||||
import "./repacks-modal.scss";
|
||||
|
||||
export interface RepacksModalProps {
|
||||
@@ -58,7 +58,13 @@ export function RepacksModal({
|
||||
return match ? match[1].toLowerCase() : null;
|
||||
};
|
||||
|
||||
const { isFeatureEnabled, Feature } = useFeature();
|
||||
|
||||
useEffect(() => {
|
||||
if (!isFeatureEnabled(Feature.NimbusPreview)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const magnets = repacks.flatMap((repack) =>
|
||||
repack.uris.filter((uri) => uri.startsWith("magnet:"))
|
||||
);
|
||||
@@ -66,7 +72,7 @@ export function RepacksModal({
|
||||
window.electron.checkDebridAvailability(magnets).then((availableHashes) => {
|
||||
setHashesInDebrid(availableHashes);
|
||||
});
|
||||
}, [repacks]);
|
||||
}, [repacks, isFeatureEnabled, Feature]);
|
||||
|
||||
const sortedRepacks = useMemo(() => {
|
||||
return orderBy(
|
||||
|
||||
Reference in New Issue
Block a user