diff --git a/src/components/keymap/header/keymap-header.component.html b/src/components/keymap/header/keymap-header.component.html
index b618f2e3..724fbf02 100644
--- a/src/components/keymap/header/keymap-header.component.html
+++ b/src/components/keymap/header/keymap-header.component.html
@@ -16,6 +16,7 @@
/>)
, private renderer: Renderer) { }
+ ngOnChanges() {
+ this.setTitle();
+ }
+
setDefault() {
if (!this.keymap.isDefault) {
this.store.dispatch(KeymapActions.setDefault(this.keymap.abbreviation));
@@ -51,4 +58,10 @@ export class KeymapHeaderComponent {
newAbbr = newAbbr.toUpperCase();
this.store.dispatch(KeymapActions.editKeymapAbbr(this.keymap.abbreviation, newAbbr));
}
+
+ setTitle(): void {
+ this.starTitle = this.keymap.isDefault
+ ? 'This is the default keymap which gets activated when powering the keyboard.'
+ : 'Makes this keymap the default keymap which gets activated when powering the keyboard.';
+ }
}
diff --git a/src/components/side-menu/side-menu.component.html b/src/components/side-menu/side-menu.component.html
index 7699de83..c4cdcf52 100644
--- a/src/components/side-menu/side-menu.component.html
+++ b/src/components/side-menu/side-menu.component.html
@@ -11,7 +11,7 @@
diff --git a/src/store/reducers/keymap.ts b/src/store/reducers/keymap.ts
index 250b9379..711424b4 100644
--- a/src/store/reducers/keymap.ts
+++ b/src/store/reducers/keymap.ts
@@ -62,7 +62,12 @@ export default function(state = initialState, action: Action): KeymapState {
case KeymapActions.SET_DEFAULT:
newState = state.entities.map((keymap: Keymap) => {
- keymap.isDefault = (keymap.abbreviation === action.payload);
+ if (keymap.abbreviation === action.payload || keymap.isDefault) {
+ let newKeymap: Keymap = new Keymap();
+ Object.assign(newKeymap, keymap);
+ keymap = newKeymap;
+ keymap.isDefault = keymap.abbreviation === action.payload;
+ }
return keymap;
});