|
1 | 1 | import { compress, decompress, debounce, isScrollable } from "@sv443-network/userutils";
|
2 | 2 | import { defaultConfig, getFeatures, migrations, saveFeatures, setDefaultFeatures } from "../config";
|
3 | 3 | import { host, scriptInfo } from "../constants";
|
4 |
| -import { FeatureCategory, FeatInfoKey, featInfo, disableBeforeUnload } from "../features/index"; |
| 4 | +import { featInfo, disableBeforeUnload } from "../features/index"; |
5 | 5 | import { error, getResourceUrl, info, log, resourceToHTMLString, warn } from "../utils";
|
6 | 6 | import { formatVersion } from "../config";
|
7 | 7 | import { emitSiteEvent, siteEvents } from "../siteEvents";
|
8 | 8 | import { getLocale, hasKey, initTranslations, setLocale, t } from "../translations";
|
9 |
| -import { FeatureConfig, HotkeyObj } from "../types"; |
| 9 | +import { FeatureCategory, FeatureKey, FeatureConfig, HotkeyObj } from "../types"; |
10 | 10 | import changelog from "../../changelog.md";
|
11 | 11 | import "./menu_old.css";
|
12 | 12 | import { createHotkeyInput } from "./hotkeyInput";
|
@@ -245,11 +245,11 @@ export async function addCfgMenu() {
|
245 | 245 | .reduce(
|
246 | 246 | (acc, [key, { category }]) => {
|
247 | 247 | if(!acc[category])
|
248 |
| - acc[category] = {} as Record<FeatInfoKey, unknown>; |
249 |
| - acc[category][key as FeatInfoKey] = featureCfg[key as FeatInfoKey]; |
| 248 | + acc[category] = {} as Record<FeatureKey, unknown>; |
| 249 | + acc[category][key as FeatureKey] = featureCfg[key as FeatureKey]; |
250 | 250 | return acc;
|
251 | 251 | },
|
252 |
| - {} as Record<FeatureCategory, Record<FeatInfoKey, unknown>>, |
| 252 | + {} as Record<FeatureCategory, Record<FeatureKey, unknown>>, |
253 | 253 | );
|
254 | 254 |
|
255 | 255 | const fmtVal = (v: unknown) => String(v).trim();
|
@@ -310,7 +310,7 @@ export async function addCfgMenu() {
|
310 | 310 | e.preventDefault();
|
311 | 311 | e.stopPropagation();
|
312 | 312 |
|
313 |
| - openHelpDialog(featKey as FeatInfoKey); |
| 313 | + openHelpDialog(featKey as FeatureKey); |
314 | 314 | });
|
315 | 315 | }
|
316 | 316 | else {
|
@@ -632,10 +632,10 @@ function checkToggleScrollIndicator() {
|
632 | 632 |
|
633 | 633 | let isHelpDialogOpen = false;
|
634 | 634 | /** Key of the feature currently loaded in the help dialog */
|
635 |
| -let helpDialogCurFeature: FeatInfoKey | undefined; |
| 635 | +let helpDialogCurFeature: FeatureKey | undefined; |
636 | 636 |
|
637 | 637 | /** Opens the feature help dialog for the given feature */
|
638 |
| -async function openHelpDialog(featureKey: FeatInfoKey) { |
| 638 | +async function openHelpDialog(featureKey: FeatureKey) { |
639 | 639 | if(isHelpDialogOpen)
|
640 | 640 | return;
|
641 | 641 | isHelpDialogOpen = true;
|
|
0 commit comments