Skip to content

Commit

Permalink
Remove unnecessary codes
Browse files Browse the repository at this point in the history
  • Loading branch information
hyp3rflow committed Jul 7, 2022
1 parent 49d37be commit 08fe829
Showing 1 changed file with 0 additions and 71 deletions.
71 changes: 0 additions & 71 deletions packages/standalone-webview/src/pages/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,74 +193,3 @@ interface Message {
event: Events[keyof Events];
type: keyof Events;
}

// function useDevtoolsCommunicationLogic() {
// const resetRequests = useUpdateAtom(resetRequestsAtom);
// const [preserveLog] = useAtom(preserveLogAtom);
// const updateRequest = useUpdateAtom(updateRequestAtom);
// const updateRequestPayload = useUpdateAtom(updateRequestPayloadAtom);
// const updateRequestError = useUpdateAtom(updateRequestErrorAtom);
// const updateResponse = useUpdateAtom(updateResponseAtom);
// const updateResponsePayload = useUpdateAtom(updateResponsePayloadAtom);
// const updateResponseError = useUpdateAtom(updateResponseErrorAtom);
// const updateResponseTrailer = useUpdateAtom(updateResponseTrailerAtom);
// useEffect(() => {
// createServer();
// function listener(message: Message) {}
// try {
// const port = chrome.runtime.connect({ name: "@pbkit/devtools/panel" });
// const tabs = chrome.tabs;
// const tabId = chrome.devtools.inspectedWindow.tabId;
// port.postMessage({ tabId });
// interface Message {
// target: string;
// event: Events[keyof Events];
// type: keyof Events;
// }
// port.onMessage.addListener((message: Message) => {
// switch (message.type) {
// case "request": {
// const event = message.event as Events["request"];
// return updateRequest(event);
// }
// case "request-payload": {
// const event = message.event as Events["request-payload"];
// return updateRequestPayload(event);
// }
// case "request-error": {
// const event = message.event as Events["request-error"];
// return updateRequestError(event);
// }
// case "response": {
// const event = message.event as Events["response"];
// return updateResponse(event);
// }
// case "response-payload": {
// const event = message.event as Events["response-payload"];
// return updateResponsePayload(event);
// }
// case "response-error": {
// const event = message.event as Events["response-error"];
// return updateResponseError(event);
// }
// case "response-trailer": {
// const event = message.event as Events["response-trailer"];
// return updateResponseTrailer(event);
// }
// }
// });
// const listener = (
// eventTabId: number,
// changeInfo: chrome.tabs.TabChangeInfo
// ) => {
// if (changeInfo.status === "loading" && eventTabId === tabId) {
// return !preserveLog && resetRequests();
// }
// };
// tabs.onUpdated.addListener(listener);
// return () => tabs.onUpdated.removeListener(listener);
// } catch {
// console.warn("not running on chrome developer tools");
// }
// }, [preserveLog]);
// }

0 comments on commit 08fe829

Please sign in to comment.