Compare commits

..

No commits in common. "c4fa06d3e7ab92875fb75b1fcd5c8a301e7cf25b" and "617d47d94950711aa396794f5f651b584a4d7e9a" have entirely different histories.

5 changed files with 2 additions and 29 deletions

View file

@ -1,7 +1,7 @@
import { ColorModeProvider, ColorModeScript } from '@kobalte/core'
import { workerInit } from 'mtcute-repl-worker/client'
import { createSignal, lazy, onCleanup, onMount, Show } from 'solid-js'
import { createSignal, lazy, onMount, Show } from 'solid-js'
import { EditorTabs } from './components/editor/EditorTabs.tsx'
import { NavbarMenu } from './components/nav/NavbarMenu.tsx'
import { Runner } from './components/runner/Runner.tsx'
@ -24,16 +24,6 @@ export function App() {
onMount(() => {
workerInit(workerIframe)
const handleKeyDown = (e: KeyboardEvent) => {
if (e.metaKey && e.key === ',') {
setShowSettings(true)
e.preventDefault()
}
}
window.addEventListener('keydown', handleKeyDown)
onCleanup(() => window.removeEventListener('keydown', handleKeyDown))
})
return (

View file

@ -64,21 +64,6 @@ async function focusConsole(tabbedPane) {
const injectCss = await waitForElement('#inject-css', document.body);
const rootView = await waitForElement('.root-view', document.body);
rootView.appendChild(injectCss);
// forward some keyboard shortcuts to the parent window
document.addEventListener('keydown', (e) => {
if (!(e.metaKey && e.key === ',')) return
const options = {
key: e.key,
ctrlKey: e.ctrlKey,
metaKey: e.metaKey,
}
const keyboardEvent = new KeyboardEvent('keydown', options)
window.parent.dispatchEvent(keyboardEvent)
e.preventDefault()
}, true)
})();
`

View file

@ -299,7 +299,7 @@ function OtpStep(props: StepProps<'otp'>) {
const [innerInputRef, setInnerInputRef] = createSignal<HTMLInputElement | undefined>()
onMount(() => {
createEffect(() => {
const handleKeyDown = (e: KeyboardEvent) => {
if (e.key >= '0' && e.key <= '9') {
innerInputRef()?.focus()

View file

@ -59,7 +59,6 @@ export async function importAccount(
dcId: asNonNull(session.primaryDcs).main.id,
}
} catch (e) {
await client.close()
await deleteAccount(accountId)
if (is404) {
throw new Error('Invalid session (auth key not found)')

View file

@ -45,7 +45,6 @@ async function handleAuthSuccess(accountId: string, user: User) {
const testMode = client.params.testMode ?? false
if ($accounts.get().some(it => it.telegramId === user.id)) {
await client.close()
await deleteAccount(accountId)
throw new Error(`Account already exists (user ID: ${user.id})`)
}