Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frontend/src/ts/commandline/lists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,9 @@ export const commands: CommandsSubgroup = {
exec: async (): Promise<void> => {
// window.open("https://www.youtube.com/watch?v=dQw4w9WgXcQ");
(document.querySelector("body") as HTMLElement).innerHTML = `
<div class="centerbox" style="position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center;pointer-events: none;">
<div class="centerbox" style="position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center;pointer-events: none;width: 100%; max-width: 800px;">
<h1 style="font-size:3rem;margin-bottom:1rem;">Fixing skill issue...</h1>
<iframe width="800" height="600" src="https://www.youtube.com/embed/dQw4w9WgXcQ?si=Kr48u8WHcwvX95G7&amp;controls=0&autoplay=1&mute=0&disablekb=1&fs=0&modestbranding=1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
<iframe style="width: 100%; aspect-ratio: 4 / 3" src="https://www.youtube.com/embed/dQw4w9WgXcQ?si=Kr48u8WHcwvX95G7&amp;controls=0&autoplay=1&mute=0&disablekb=1&fs=0&modestbranding=1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div>
`;
setTimeout(() => {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/ts/event-handlers/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import * as TestLogic from "../test/test-logic";
import { navigate } from "../controllers/route-controller";
import { isInputElementFocused } from "../input/input-element";
import * as ManualRestart from "../test/manual-restart-tracker";
import * as TestState from "../test/test-state";

document.addEventListener("keydown", (e) => {
if (PageTransition.get()) return;
if (e.key === undefined) return;

const pageTestActive: boolean = ActivePage.get() === "test";

if (pageTestActive && !isInputElementFocused()) {
if (pageTestActive && !TestState.resultVisible && !isInputElementFocused()) {
const popupVisible: boolean = Misc.isAnyPopupVisible();
// this is nested because isAnyPopupVisible is a bit expensive
// and we don't want to call it during the test
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/ts/input/handlers/insert-text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ type OnInsertTextParams = {

export async function onInsertText(options: OnInsertTextParams): Promise<void> {
const { now, lastInMultiIndex, isCompositionEnding } = options;
const { inputValue } = getInputElementValue();

if (options.data.length > 1) {
// remove the entire data from the input value
// make sure to not call TestInput.input.syncWithInputElement in here
// it will be updated later in the body of onInsertText
const { inputValue } = getInputElementValue();
setInputElementValue(inputValue.slice(0, -options.data.length));
for (let i = 0; i < options.data.length; i++) {
const char = options.data[i] as string;
Expand All @@ -88,6 +88,10 @@ export async function onInsertText(options: OnInsertTextParams): Promise<void> {
TestWords.words.getCurrent()[TestInput.input.current.length] !==
options.data
) {
// replace the data with the override
setInputElementValue(
inputValue.slice(0, -options.data.length) + charOverride
);
await onInsertText({
...options,
data: charOverride,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@
"eslint"
]
},
"version": "25.46.0",
"version": "25.48.0",
"packageManager": "pnpm@9.6.0"
}
Loading