Skip to content

Commit

Permalink
fix ui slot mutation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoffreyChen777 committed Jan 16, 2024
1 parent 9c37a5a commit 68c32ed
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG_CN.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## v3.0.0-beta.3 15/01 2024

1. 修复了一些 Bug。
2. 插件推荐:paperlib-ai-summary-extension

## v3.0.0-beta.2 15/01 2024

1. 摒弃了 Windows 7 的支持。
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG_EN.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## v3.0.0-beta.3 Jan 15 2024

1. Fixed some bugs.
2. Extension Recommendation: paperlib-ai-summary-extension

## v3.0.0-beta.2 Jan 15 2024

1. Doesn't support Windows 7 anymore.
Expand Down
8 changes: 5 additions & 3 deletions app/renderer/services/uislot-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class UISlotService extends Eventable<IUISlotState> {
* @returns
*/
updateSlot(slotID: keyof IUISlotState, patch: { [id: string]: any }) {
const currentSlot = this.getState(slotID);
const currentSlot = JSON.parse(JSON.stringify(this.getState(slotID)));

if (!currentSlot) {
this._logService.error(
Expand All @@ -47,9 +47,11 @@ export class UISlotService extends Eventable<IUISlotState> {
for (const [sectionID, value] of Object.entries(patch)) {
if (value === undefined) {
delete currentSlot[sectionID];
} else {
currentSlot[sectionID] = value;
}

currentSlot[sectionID] = value;
}

this.fire({ [slotID]: currentSlot });
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "paperlib-beta",
"version": "3.0.0-beta.2",
"version": "3.0.0-beta.3",
"main": "dist/main-entry.js",
"description": "A simple academic paper management tool.",
"author": "Future Scholars <[email protected]>",
Expand Down

0 comments on commit 68c32ed

Please sign in to comment.