Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
Restore edits on start; Handle play mode (#161)
Browse files Browse the repository at this point in the history
* Handle auth errors, make sure to only open auth tab once

* Switch event listeners to synchronous; Forward responses from content script back to iframe

* Support for restoring edits, play mode
  • Loading branch information
jonathankap authored Aug 24, 2024
1 parent 7946b8e commit 66a67e6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions apps/mocksi-lite-next/src/pages/content/mocksi-extension.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ chrome.runtime.onMessage.addListener((request) => {
let data = null;

// reactor
if (request.message === "EDITING") {
if (request.message === "EDITING" || request.message === "PLAY") {
for (const mod of request.data.edits) {
await reactor.pushModification(mod);
}
reactor.attach(document, getHighlighter());
}
if (request.message === "NEW_EDIT") {
Expand All @@ -81,7 +84,7 @@ chrome.runtime.onMessage.addListener((request) => {
);
}
}
if (request.message === "STOP_EDITING") {
if (request.message === "STOP_EDITING" || request.message === "STOP_PLAYING") {
reactor.detach();
}
// resize iframe
Expand Down

0 comments on commit 66a67e6

Please sign in to comment.