Skip to content

Commit

Permalink
Fix youtube summary button
Browse files Browse the repository at this point in the history
  • Loading branch information
blackforestboi committed Apr 2, 2024
1 parent cd723a0 commit bc6b53a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/search-injection/components/youtubeActionBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ export default class YoutubeButtonMenu extends React.Component<Props, State> {
instaClose
>
<TextFieldContainerPrompt>
Use a custom prompt. Click again to apply.
<TextArea
type="text"
placeholder={'Add your custom prompt here'}
Expand All @@ -398,7 +399,6 @@ export default class YoutubeButtonMenu extends React.Component<Props, State> {
width="350px"
autoFocus={true}
/>
Use a custom prompt. Click again to apply.
</TextFieldContainerPrompt>
</PopoutBox>
)
Expand Down Expand Up @@ -752,7 +752,7 @@ const TextFieldContainerPrompt = styled.div`
align-items: center;
justify-content: center;
grid-gap: 10px;
padding: 5px 5px 10px 5px;
padding: 10px 5px 5px 5px;
color: ${(props) => props.theme.colors.greyScale5};
font-size: 14px;
text-align: center;
Expand Down
25 changes: 16 additions & 9 deletions src/sidebar/annotations-sidebar/containers/logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3652,7 +3652,7 @@ export class SidebarContainerLogic extends UILogic<
},
)
} catch (e) {}
await new Promise((resolve) => setTimeout(resolve, 10))
await new Promise((resolve) => setTimeout(resolve, 20))
}

return
Expand Down Expand Up @@ -3690,14 +3690,21 @@ export class SidebarContainerLogic extends UILogic<

await sleepPromise(10)
if (previousState.activeTab === 'summary') {
this.options.events.emit(
'addMediaRangeToEditor',
event.range.from,
event.range.to,
event.prompt,
() => {},
)
return
let executed = false
while (!executed) {
try {
executed = this.options.events.emit(
'addMediaRangeToEditor',
event.range.from,
event.range.to,
event.prompt,
(success) => {
executed = success
},
)
} catch (e) {}
await new Promise((resolve) => setTimeout(resolve, 20))
}
}

// this.emitMutation({ activeTab: { $set: 'summary' } })
Expand Down
2 changes: 1 addition & 1 deletion src/util/rpc/event-rpc-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class EventBasedRPCManager implements RPCManager {
private log = (msg: string, obj?: any) => {
if (this.deps.debug === true || globalThis['memex-rpc-debug']) {
msg = `RPC::side=${this.deps.sideName}::` + msg
console['log'](msg, obj ?? {})
// console['log'](msg, obj ?? {})
}
}

Expand Down

0 comments on commit bc6b53a

Please sign in to comment.