optimize Simple Mode with true dead code elimination
This commit is contained in:
@@ -5,7 +5,15 @@ import { createIcons, icons } from 'lucide';
|
|||||||
import * as pdfjsLib from 'pdfjs-dist';
|
import * as pdfjsLib from 'pdfjs-dist';
|
||||||
import '../css/styles.css';
|
import '../css/styles.css';
|
||||||
|
|
||||||
const hideBrandingSections = () => {
|
const init = () => {
|
||||||
|
pdfjsLib.GlobalWorkerOptions.workerSrc = new URL(
|
||||||
|
'pdfjs-dist/build/pdf.worker.min.mjs',
|
||||||
|
import.meta.url
|
||||||
|
).toString();
|
||||||
|
|
||||||
|
// Handle simple mode - hide branding sections
|
||||||
|
if (__SIMPLE_MODE__) {
|
||||||
|
const hideBrandingSections = () => {
|
||||||
const nav = document.querySelector('nav');
|
const nav = document.querySelector('nav');
|
||||||
if (nav) {
|
if (nav) {
|
||||||
nav.style.display = 'none';
|
nav.style.display = 'none';
|
||||||
@@ -73,16 +81,8 @@ const hideBrandingSections = () => {
|
|||||||
if (app) {
|
if (app) {
|
||||||
app.style.paddingTop = '2rem';
|
app.style.paddingTop = '2rem';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const init = () => {
|
|
||||||
pdfjsLib.GlobalWorkerOptions.workerSrc = new URL(
|
|
||||||
'pdfjs-dist/build/pdf.worker.min.mjs',
|
|
||||||
import.meta.url
|
|
||||||
).toString();
|
|
||||||
|
|
||||||
// Handle simple mode - hide branding sections
|
|
||||||
if (__SIMPLE_MODE__) {
|
|
||||||
hideBrandingSections();
|
hideBrandingSections();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user