Remove console.logs
This commit is contained in:
parent
20144ae130
commit
3a34f48e6c
@ -47,7 +47,6 @@ const DataDirPicker: React.FC<Props> = () => {
|
||||
next.value.name.endsWith(".esm") ||
|
||||
next.value.name.endsWith(".esl"))
|
||||
) {
|
||||
console.log(next.value);
|
||||
plugins.push(next.value);
|
||||
}
|
||||
}
|
||||
@ -55,8 +54,6 @@ const DataDirPicker: React.FC<Props> = () => {
|
||||
|
||||
plugins.forEach(async (plugin, index) => {
|
||||
const file = await plugin.getFile();
|
||||
console.log(file.lastModified);
|
||||
console.log(file.lastModifiedDate);
|
||||
const contents = new Uint8Array(await file.arrayBuffer());
|
||||
try {
|
||||
workers[index % workers.length].postMessage(
|
||||
|
@ -143,7 +143,6 @@ const Map: React.FC = () => {
|
||||
|
||||
const selectCells = useCallback(
|
||||
(cells: { x: number; y: number }[]) => {
|
||||
console.log("selectCells");
|
||||
if (!map.current) return;
|
||||
if (map.current && !map.current.getSource("grid-source")) return;
|
||||
|
||||
@ -234,7 +233,6 @@ const Map: React.FC = () => {
|
||||
);
|
||||
|
||||
const clearSelectedCell = useCallback(() => {
|
||||
console.log("clearSelectedCell");
|
||||
setSelectedCell(null);
|
||||
if (map.current) map.current.removeFeatureState({ source: "grid-source" });
|
||||
if (map.current) {
|
||||
@ -247,7 +245,6 @@ const Map: React.FC = () => {
|
||||
}, [map]);
|
||||
|
||||
const clearSelectedCells = useCallback(() => {
|
||||
console.log("clearSelectedCells");
|
||||
setSelectedCells(null);
|
||||
if (map.current) {
|
||||
map.current.removeFeatureState({ source: "selected-cell-source" });
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { configureStore, ThunkAction, Action } from "@reduxjs/toolkit"
|
||||
import plugins from "../slices/plugins"
|
||||
|
||||
import pluginsReducer from "../slices/plugins"
|
||||
import pluginsTxtReducer from "../slices/pluginsTxt"
|
||||
@ -7,6 +6,7 @@ import pluginsTxtReducer from "../slices/pluginsTxt"
|
||||
export function makeStore() {
|
||||
return configureStore({
|
||||
reducer: { pluginsTxt: pluginsTxtReducer, plugins: pluginsReducer },
|
||||
middleware: (getDefaultMiddleware) => getDefaultMiddleware({ serializableCheck: false }),
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,6 @@ module.exports = {
|
||||
siteUrl: process.env.SITE_URL || 'https://modmapper.com',
|
||||
generateRobotsTxt: true,
|
||||
additionalPaths: async (config) => {
|
||||
console.log("additional paths");
|
||||
const result = []
|
||||
|
||||
const response = await fetch(MOD_SEARCH_INDEX_URL);
|
||||
|
@ -4,7 +4,7 @@ import Head from "next/head";
|
||||
import "mapbox-gl/dist/mapbox-gl.css";
|
||||
|
||||
import Map from "../components/Map";
|
||||
import { useAppDispatch } from "../lib/hooks";
|
||||
import { useAppDispatch, useAppSelector } from "../lib/hooks";
|
||||
import {
|
||||
addPluginInOrder,
|
||||
decrementPending,
|
||||
@ -16,6 +16,7 @@ export const WorkersContext = createContext<Worker[]>([]);
|
||||
|
||||
const Home: NextPage = () => {
|
||||
const [workers, setWorkers] = useState<Worker[]>([]);
|
||||
const pluginsPending = useAppSelector((state) => state.plugins.pending);
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
useEffect(() => {
|
||||
@ -29,7 +30,6 @@ const Home: NextPage = () => {
|
||||
worker.onmessage = (evt: { data: PluginFile }) => {
|
||||
const { data } = evt;
|
||||
dispatch(decrementPending(1));
|
||||
console.log(data.parsed);
|
||||
dispatch(addPluginInOrder(data));
|
||||
};
|
||||
newWorkers.push(worker);
|
||||
|
@ -66,10 +66,7 @@ export const selectPlugins = (state: AppState) => state.plugins
|
||||
|
||||
export const applyLoadOrder = (): AppThunk => (dispatch, getState) => {
|
||||
const { plugins, pluginsTxt } = getState();
|
||||
console.log("applying load order!");
|
||||
const originalPlugins = [...plugins.plugins];
|
||||
console.log(originalPlugins);
|
||||
console.log(originalPlugins[0] && originalPlugins[0].filename);
|
||||
let newPlugins = [];
|
||||
for (let line of pluginsTxt.split("\n")) {
|
||||
let enabled = false;
|
||||
@ -82,18 +79,14 @@ export const applyLoadOrder = (): AppThunk => (dispatch, getState) => {
|
||||
line = line.slice(1);
|
||||
}
|
||||
|
||||
console.log(line);
|
||||
const originalIndex = originalPlugins.findIndex((p) => p.filename === line);
|
||||
if (originalIndex >= 0) {
|
||||
const original = originalPlugins.splice(originalIndex, 1)[0];
|
||||
console.log(original);
|
||||
if (original) {
|
||||
newPlugins.push({ ...original, enabled });
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(originalPlugins);
|
||||
console.log(newPlugins);
|
||||
dispatch(setPlugins([...originalPlugins.sort((a, b) => b.lastModified - a.lastModified), ...newPlugins]));
|
||||
}
|
||||
|
||||
|
@ -17,8 +17,6 @@ self.addEventListener('message', async (event: MessageEvent<{ skipParsing?: bool
|
||||
}
|
||||
}
|
||||
const hash = hash_plugin(contents).toString(36);
|
||||
console.log(filename)
|
||||
console.log(parsed);
|
||||
self.postMessage({ filename, lastModified, parsed, hash, parseError, enabled: parsed && !parseError });
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
Loading…
Reference in New Issue
Block a user