Skip to content

Commit

Permalink
Fix missing local rules when syncing
Browse files Browse the repository at this point in the history
  • Loading branch information
dangkyokhoang committed Sep 28, 2020
1 parent 471a494 commit caceb02
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Man in the Middle",
"version": "3.5.2",
"version": "3.5.3",
"description": "Modify requests, inject JavaScript and CSS into pages",
"developer": {
"name": "Hoang",
Expand Down
4 changes: 2 additions & 2 deletions src/page/background/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
const initialization = Factory.initialize();

// If storage changes, re-initialize rules.
Storage.addListener(changes => changes.forEach(async ([type, {newValue}]) => {
Storage.addListener(changes => changes.forEach(async ([type]) => {
if (!Factory.hasType(type)) {
return;
}

// Re-initialize rules
await Factory.initialize(type, newValue);
await Factory.initialize(type);

// This makes sure rules are stored in the latest [array] format.
await Factory.saveData(type);
Expand Down
2 changes: 1 addition & 1 deletion src/page/background/js/class/ResponseRule.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ResponseRule extends RequestRule {

if (this.textType === 'plaintext') {
filter.onstart = async () => {
filter.write(encoder.encode(await this.getResponse(null)));
filter.write(encoder.encode(await this.getResponse()));
filter.close();
};
return;
Expand Down

0 comments on commit caceb02

Please sign in to comment.