Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Small sonarqube fixes #2165

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions minifier/next_gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,17 +228,6 @@ function createMiniDefinition(jsonData: JsonData, uniqueKey: string): ProcessedD
Icons: new Map(),
};

// Send a repeat string and get a index value back
// function getRepeatStringIndexMap(name: RepeatStringsName, s: string): number {
// const index = repeatStrings[name].indexOf(s);
// if (index === -1) {
// repeatStrings[name].push(s);
// return getRepeatStringIndexMap(name, s);
// }

// return index;
// }

function getRepeatStringIndexMap(name: RepeatStringsName, s: string): number {
if (!repeatStringsMap[name].has(s)) {
repeatStringsMap[name].set(s, repeatStringsMap[name].size);
Expand Down
12 changes: 5 additions & 7 deletions native/app/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@ import * as SplashScreen from "expo-splash-screen";
import { NavigationContainer, type NavigationContainerRef, type Theme } from "@react-navigation/native";
import { useEffect, useRef } from "react";
import { StatusBar, useWindowDimensions, Platform, Appearance } from "react-native";
import { enableFreeze } from "react-native-screens";
import { enableFreeze, enableScreens } from "react-native-screens";
import { object, parse, string } from "valibot";
import Toast from "react-native-toast-message";
import { GestureHandlerRootView } from "react-native-gesture-handler";
import { PortalHost } from "@rn-primitives/portal";
import { enableScreens } from "react-native-screens";

// Enable screens for better performance
enableScreens();

import { BUNGIE_MANIFEST_URL, CUSTOM_MANIFEST_URL, getFullProfile } from "@/app/bungie/BungieApi.ts";
import { getJsonBlob } from "@/app/utilities/Helpers.ts";
Expand All @@ -21,13 +17,15 @@ import App from "@/app/App"; // Do not use the file extension or the web version
import "@/global.css";
import { removeAsyncStorageItem } from "@/app/store/DefinitionsSlice.ts";

// Enable screens for better performance
enableScreens();
enableFreeze(true);

SplashScreen.preventAutoHideAsync();
if (Platform.OS !== "web") {
Appearance.setColorScheme("dark");
}

enableFreeze(true);

let customDownloadAttempts = 0;
async function getCustomItemDefinition() {
try {
Expand Down
1 change: 0 additions & 1 deletion native/app/inventory/logic/Sockets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ export function createSockets(destinyItem: DestinyItem): Sockets | null {
const sockets = expandAndCreateSockets(destinyItem.itemHash);

if (!sockets) {
// console.error("Failed to create sockets for item", destinyItem.itemHash);
return null;
}

Expand Down
2 changes: 1 addition & 1 deletion native/app/inventory/logic/Transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ async function moveItem(transferItem: TransferItem): Promise<[JSON, DestinyItem]
}

let toVault = false;
let characterId = "" as CharacterId;
let characterId: CharacterId;

if (transferItem.destinyItem.characterId !== VAULT_CHARACTER_ID) {
if (GLOBAL_INVENTORY_NAMES.includes(transferItem.destinyItem.characterId)) {
Expand Down
2 changes: 1 addition & 1 deletion native/app/inventory/pages/details/ScreenInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function getPrimaryStatLabel(destinyItem: DestinyItem): string {
return "";
}

function PrimaryStatUI({ destinyItem }: { destinyItem: DestinyItem }) {
function PrimaryStatUI({ destinyItem }: { readonly destinyItem: DestinyItem }) {
"use memo";
const POWER_NAME = getPrimaryStatLabel(destinyItem);

Expand Down