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