fix: remove large console logs
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
});
|
||||
|
||||
function initializeCropper() {
|
||||
console.log("initializeCropper called, imageElement:", !!imageElement, "CropperJS:", !!CropperJS);
|
||||
// Remove verbose debug logging
|
||||
if (!imageElement || !CropperJS) {
|
||||
return;
|
||||
}
|
||||
@@ -49,10 +49,7 @@
|
||||
errorMessage = undefined;
|
||||
setLoading(true);
|
||||
|
||||
console.log("Calling getCropperCanvas");
|
||||
const cropperCanvasElement = cropper.getCropperCanvas();
|
||||
console.log("CropperCanvas result:", cropperCanvasElement);
|
||||
console.log("CropperCanvas type:", typeof cropperCanvasElement);
|
||||
|
||||
if (!cropperCanvasElement) {
|
||||
throw new Error("Не удалось получить обрезанное изображение");
|
||||
|
||||
@@ -18,27 +18,20 @@
|
||||
}
|
||||
|
||||
$effect(() => {
|
||||
console.log(
|
||||
"[PanelPreview] Effect triggered. Panel background:",
|
||||
panel?.backgroundImage,
|
||||
"Current image src:",
|
||||
backgroundImage?.src,
|
||||
);
|
||||
if (panel?.backgroundImage && panel.backgroundImage !== backgroundImage?.src) {
|
||||
console.log("[PanelPreview] Loading new background image:", panel.backgroundImage);
|
||||
loadImage(panel.backgroundImage);
|
||||
}
|
||||
});
|
||||
|
||||
function loadImage(src: string) {
|
||||
console.log("[PanelPreview] Starting to load image:", src);
|
||||
// Remove verbose logging - image data is too large for console
|
||||
console.log("[PanelPreview] Loading background image");
|
||||
const img = document.createElement("img");
|
||||
img.onload = () => {
|
||||
console.log("[PanelPreview] Image loaded successfully:", src);
|
||||
backgroundImage = img;
|
||||
};
|
||||
img.onerror = (error) => {
|
||||
console.error("[PanelPreview] Failed to load image:", src, error);
|
||||
console.error("[PanelPreview] Failed to load background image");
|
||||
};
|
||||
img.src = src;
|
||||
}
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
|
||||
// Only update if settings actually changed
|
||||
if (settingsString !== previousSettings) {
|
||||
console.log("[SETTINGS] Applying text settings to all panels:", currentSettings);
|
||||
|
||||
// Update panels with new settings
|
||||
const updatedPanels = panels.map((panel) => ({
|
||||
...panel,
|
||||
@@ -47,29 +45,23 @@
|
||||
|
||||
onMount(async () => {
|
||||
// Initialize with default texts for common Twitch panels
|
||||
console.log("[INIT] Creating default texts...");
|
||||
const defaultTexts = [
|
||||
{ id: crypto.randomUUID(), text: "About" },
|
||||
{ id: crypto.randomUUID(), text: "Links" },
|
||||
];
|
||||
texts = defaultTexts;
|
||||
console.log("[INIT] Default texts created:", texts);
|
||||
|
||||
// Load background image
|
||||
try {
|
||||
console.log("[INIT] Loading default background...");
|
||||
const loadedBackground = await imageService.loadDefaultBackground();
|
||||
console.log("[INIT] Background loaded:", loadedBackground);
|
||||
backgroundImage = loadedBackground;
|
||||
} catch (error) {
|
||||
console.error("[INIT] Error loading background:", error);
|
||||
console.error("Failed to load default background");
|
||||
exportService.setErrorMessage("Не удалось загрузить фоновое изображение по умолчанию");
|
||||
}
|
||||
|
||||
// Create panels from texts (with or without background)
|
||||
console.log("[INIT] Creating panels from texts...");
|
||||
const initialPanels = panelService.updatePanelsFromTexts(texts, [], backgroundImage || "");
|
||||
console.log("[INIT] Panels created:", initialPanels);
|
||||
panels = initialPanels;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user