Skip to content

Commit 09a8d40

Browse files
committed
fix: refine 5M family printer detection to match backend logic
Changed printer type detection to exactly match the backend PrinterUtils.detectPrinterFamily() implementation: - Removed overly broad 'Pro' check that could incorrectly catch legacy "Pro" models (e.g., Guider Pro, Creator Pro) - Now only checks for '5m' and 'ad5x' (case-insensitive) - This correctly identifies: * Adventurer 5M (contains '5m') * Adventurer 5M Pro (contains '5m') * AD5X (contains 'ad5x') * AD5X Pro (contains 'ad5x') - Prevents false positives on legacy Pro models Reference: FlashForgeUI-Electron/src/utils/PrinterUtils.ts:228-266
1 parent 3d756d1 commit 09a8d40

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/webui/static/features/printer-discovery.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,10 @@ async function connectToDiscoveredPrinter(
235235
): Promise<void> {
236236
try {
237237
// Determine printer type based on model
238-
// 5M family includes: 5M, 5M Pro, AD5X, AD5X Pro
239-
const is5MFamily = model.includes('5M') ||
240-
model.includes('Pro') ||
241-
model.includes('AD5X') ||
242-
model.includes('ad5x');
238+
// 5M family includes: Adventurer 5M, Adventurer 5M Pro, AD5X, AD5X Pro
239+
// Match backend logic in PrinterUtils.detectPrinterFamily()
240+
const modelLower = model.toLowerCase();
241+
const is5MFamily = modelLower.includes('5m') || modelLower.includes('ad5x');
243242
const type = is5MFamily ? 'new' : 'legacy';
244243

245244
// If 5M family printer, prompt for check code

0 commit comments

Comments
 (0)