Merge branch 'master' into auto-write-config
This commit is contained in:
@@ -82,9 +82,9 @@ export class KeymapEditComponent {
|
||||
site: 'https://ultimatehackingkeyboard.com',
|
||||
description: 'Ultimate Hacking Keyboard keymap',
|
||||
keyboardModel: 'UHK60',
|
||||
dataModelMajorVersion: userConfiguration.dataModelMajorVersion,
|
||||
dataModelMinorVersion: userConfiguration.dataModelMinorVersion,
|
||||
dataModelPatchVersion: userConfiguration.dataModelPatchVersion,
|
||||
userConfigMajorVersion: userConfiguration.userConfigMajorVersion,
|
||||
userConfigMinorVersion: userConfiguration.userConfigMinorVersion,
|
||||
userConfigPatchVersion: userConfiguration.userConfigPatchVersion,
|
||||
objectType: 'keymap',
|
||||
objectValue: keymap.toJsonObject()
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"signature": "UHK",
|
||||
"dataModelVersion": 0,
|
||||
"hardwareConfigVersion": 0,
|
||||
"hardwareId": 0,
|
||||
"brandId": 0,
|
||||
"isIso": false,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"dataModelMajorVersion": 3,
|
||||
"dataModelMinorVersion": 0,
|
||||
"dataModelPatchVersion": 0,
|
||||
"userConfigMajorVersion": 4,
|
||||
"userConfigMinorVersion": 0,
|
||||
"userConfigPatchVersion": 0,
|
||||
"deviceName": "My UHK",
|
||||
"doubleTapSwitchLayerTimeout": 250,
|
||||
"iconsAndLayerTextsBrightness": 255,
|
||||
|
||||
@@ -44,7 +44,7 @@ export class UserConfigEffects {
|
||||
const userConfig = new UserConfiguration();
|
||||
userConfig.fromBinary(UhkBuffer.fromArray(data));
|
||||
|
||||
if (userConfig.dataModelMajorVersion > 0) {
|
||||
if (userConfig.userConfigMajorVersion > 0) {
|
||||
return userConfig;
|
||||
}
|
||||
|
||||
@@ -211,8 +211,8 @@ export class UserConfigEffects {
|
||||
let config: UserConfiguration;
|
||||
|
||||
if (configJsonObject) {
|
||||
if (configJsonObject.dataModelMajorVersion ===
|
||||
this.defaultUserConfigurationService.getDefault().dataModelMajorVersion) {
|
||||
if (configJsonObject.userConfigMajorVersion ===
|
||||
this.defaultUserConfigurationService.getDefault().userConfigMajorVersion) {
|
||||
config = new UserConfiguration().fromJsonObject(configJsonObject);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ describe('user-configuration reducer', () => {
|
||||
const result = reducer(state, saveKeyAction);
|
||||
expect(result).not.toBe(defaultUserConfig);
|
||||
expect(result.toJsonObject()).toEqual({
|
||||
dataModelVersion: 4,
|
||||
userConfigVersion: 4,
|
||||
moduleConfigurations: [
|
||||
{
|
||||
id: 1,
|
||||
@@ -233,7 +233,7 @@ describe('user-configuration reducer', () => {
|
||||
const result = reducer(state, saveKeyAction);
|
||||
expect(result).not.toBe(defaultUserConfig);
|
||||
expect(result.toJsonObject()).toEqual({
|
||||
dataModelVersion: 4,
|
||||
userConfigVersion: 4,
|
||||
moduleConfigurations: [
|
||||
{
|
||||
id: 1,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { cloneDeep } from 'lodash';
|
||||
|
||||
const defaultUserConfig = {
|
||||
dataModelMajorVersion: 3,
|
||||
dataModelMinorVersion: 0,
|
||||
dataModelPatchVersion: 0,
|
||||
userConfigMajorVersion: 3,
|
||||
userConfigMinorVersion: 0,
|
||||
userConfigPatchVersion: 0,
|
||||
deviceName: 'My UHK',
|
||||
doubleTapSwitchLayerTimeout: 250,
|
||||
iconsAndLayerTextsBrightness: 255,
|
||||
|
||||
Reference in New Issue
Block a user