Set terminal closed by default (auto-open on error) and remove manual AdSense code
This commit is contained in:
32
App.tsx
32
App.tsx
@@ -15,17 +15,9 @@ const App: React.FC = () => {
|
||||
const [hwVersion, setHwVersion] = useState<string | null>(null);
|
||||
const [activeTab, setActiveTab] = useState<'dashboard' | 'settings'>('dashboard');
|
||||
const [errorMsg, setErrorMsg] = useState<string | null>(null);
|
||||
const [isTerminalOpen, setIsTerminalOpen] = useState(true);
|
||||
const [isTerminalOpen, setIsTerminalOpen] = useState(false);
|
||||
|
||||
|
||||
// Polling Logic
|
||||
useEffect(() => {
|
||||
try {
|
||||
// @ts-ignore
|
||||
(window.adsbygoogle = window.adsbygoogle || []).push({});
|
||||
} catch (e) {
|
||||
console.error("AdSense error", e);
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
let isMounted = true;
|
||||
@@ -65,6 +57,7 @@ const App: React.FC = () => {
|
||||
console.error("Polling error:", e);
|
||||
// Log to terminal for debugging
|
||||
serialService.log('error', `Poll Fail: ${e.message}`);
|
||||
setIsTerminalOpen(true);
|
||||
} finally {
|
||||
// Schedule next poll cycle in 500ms
|
||||
if (isMounted && connectionState === ConnectionState.CONNECTED && activeTab === 'dashboard') {
|
||||
@@ -93,6 +86,7 @@ const App: React.FC = () => {
|
||||
console.error(e);
|
||||
setConnectionState(ConnectionState.ERROR);
|
||||
setErrorMsg(e.message || "시리얼 포트 연결 실패");
|
||||
setIsTerminalOpen(true);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -165,24 +159,6 @@ const App: React.FC = () => {
|
||||
<span className="ml-3 hidden lg:block font-medium">EEPROM</span>
|
||||
</button>
|
||||
</nav>
|
||||
|
||||
{/* AdSense Unit */}
|
||||
<div className="px-4 pb-2">
|
||||
<div className="text-[10px] text-gray-600 text-center mb-1">Sponsored</div>
|
||||
<ins className="adsbygoogle"
|
||||
style={{ display: "block" }}
|
||||
data-ad-client="ca-pub-4444852135420953"
|
||||
data-ad-slot="7799405796"
|
||||
data-ad-format="auto"
|
||||
data-full-width-responsive="true"></ins>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div className="p-4 border-t border-gray-200 flex-1 flex flex-col justify-end">
|
||||
{/* AdSense Area - Expanded */}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Main Content Area */}
|
||||
|
||||
Reference in New Issue
Block a user