mirror of
https://git.um-react.app/um/um-react.git
synced 2025-11-28 03:23:02 +00:00
feat: add basic instruction to paste device key from qtfm-device-id
This commit is contained in:
@@ -2,11 +2,10 @@ import { debounce } from 'radash';
|
||||
import { produce } from 'immer';
|
||||
|
||||
import type { AppStore } from '~/store';
|
||||
import { settingsSlice, setProductionChanges, ProductionSettings, QINGTING_DEVICE_INFO_KEY } from './settingsSlice';
|
||||
import { settingsSlice, setProductionChanges, ProductionSettings } from './settingsSlice';
|
||||
import { enumObject } from '~/util/objects';
|
||||
import { getLogger } from '~/util/logUtils';
|
||||
import { parseKwm2ProductionKey } from './keyFormats';
|
||||
import type { QingTingDeviceInfo } from '@jixun/libparakeet';
|
||||
|
||||
const DEFAULT_STORAGE_KEY = 'um-react-settings';
|
||||
|
||||
@@ -35,14 +34,8 @@ function mergeSettings(settings: ProductionSettings): ProductionSettings {
|
||||
}
|
||||
}
|
||||
|
||||
if (settings?.qtfm?.android) {
|
||||
const qtfmAndroid = settings.qtfm.android;
|
||||
draft.qtfm.android = Object.fromEntries(
|
||||
QINGTING_DEVICE_INFO_KEY.map((key) => {
|
||||
const value = qtfmAndroid[key];
|
||||
return [key, typeof value === 'string' ? value : ''];
|
||||
}),
|
||||
) as unknown as QingTingDeviceInfo;
|
||||
if (typeof settings?.qtfm?.android === 'string') {
|
||||
draft.qtfm.android = settings.qtfm.android.replace(/[^0-9a-fA-F]/g, '');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user