Skip to content

Commit

Permalink
Merge pull request #59 from mengmeet/set_val
Browse files Browse the repository at this point in the history
fix patch QAM
  • Loading branch information
honjow authored Mar 15, 2024
2 parents fe9b60d + 189612e commit 65df18c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "PowerControl",
"version": "2.4.8",
"version": "2.4.9",
"description": "PowerControl plugin.",
"scripts": {
"build": "shx rm -rf dist && rollup -c",
Expand Down
18 changes: 12 additions & 6 deletions src/util/patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,28 +100,34 @@ class TDPPatch {
};

public setTDP(tdp: number) {
this.perfStore.msgSettingsPerApp.tdp_limit = tdp;
if (this.perfStore?.msgSettingsPerApp?.tdp_limit) {
this.perfStore.msgSettingsPerApp.tdp_limit = tdp;
}
}

public setTDPEanble(isEnable: boolean) {
this.perfStore.msgSettingsPerApp.is_tdp_limit_enabled = isEnable;
if (this.perfStore?.msgSettingsPerApp?.is_tdp_limit_enabled) {
this.perfStore.msgSettingsPerApp.is_tdp_limit_enabled = isEnable;
}
}

public setTDPRange(min?: number, max?: number) {
if (min && this.perfStore.msgLimits.tdp_limit_min != undefined) {
if (min && this.perfStore?.msgLimits?.tdp_limit_min) {
this.perfStore.msgLimits.tdp_limit_min = min;
}
if (max && this.perfStore.msgLimits.tdp_limit_max != undefined) {
if (max && this.perfStore?.msgLimits?.tdp_limit_max) {
this.perfStore.msgLimits.tdp_limit_max = max;
}
}

private get active_profile_game_id() {
return this.perfStore.m_msgState.active_profile_game_id;
return this.perfStore?.m_msgState?.active_profile_game_id;
}

private set active_profile_game_id(game_id: string) {
this.perfStore.m_msgState.active_profile_game_id = game_id;
if (this.perfStore.m_msgState.active_profile_game_id) {
this.perfStore.m_msgState.active_profile_game_id = game_id;
}
}

private get current_game_id() {
Expand Down

0 comments on commit 65df18c

Please sign in to comment.