picosh 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +3 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -52,6 +52,7 @@ const waitingState = {};
52
52
 
53
53
  function setWaiting(uid, waiting) {
54
54
  waitingState[uid] = waiting;
55
+ console.log('[picosh] setWaiting', uid.slice(0, 8), waiting);
55
56
  if (typeof window !== 'undefined') {
56
57
  window.dispatchEvent(new CustomEvent('picosh-ai-waiting', {detail: {uid, waiting}}));
57
58
  }
@@ -88,9 +89,11 @@ exports.middleware = () => (next) => (action) => {
88
89
  exports.decorateTab = (Tab, {React}) => {
89
90
  return function PicoshTab(props) {
90
91
  const [waiting, setWaitingState] = React.useState(!!waitingState[props.uid]);
92
+ console.log('[picosh] decorateTab render uid:', props.uid && props.uid.slice(0, 8), 'waiting:', waiting);
91
93
 
92
94
  React.useEffect(() => {
93
95
  function onWaiting(e) {
96
+ console.log('[picosh] tab event received', e.detail.uid.slice(0, 8), 'this:', props.uid && props.uid.slice(0, 8));
94
97
  if (e.detail.uid === props.uid) setWaitingState(e.detail.waiting);
95
98
  }
96
99
  window.addEventListener('picosh-ai-waiting', onWaiting);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "picosh",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Hyper plugin: paste clipboard images as file paths",
5
5
  "main": "index.js",
6
6
  "license": "MIT",