Skip to content

Commit

Permalink
style(uvlTutorial): added syntax highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
JannisDommer committed Jan 10, 2024
1 parent 7376b87 commit ef06978
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion WebSocketClient/src/ImportExportFiles.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import config from './config';
import {displayEditorErrorAtContent} from "./util.ts";

export function downloadFile(content: string, filename: string): void {
// Create a Blob from the file content
Expand Down Expand Up @@ -38,7 +39,9 @@ export function uploadFile(): Promise<string> {
uploadInput.files = null;
uploadInput.value = "";
stringPromise.then((res) => {
if(res.length > config.MAX_NUMBER_LINES){
const lineCount = res.split('\n').length;
if(lineCount > config.MAX_NUMBER_LINES){
displayEditorErrorAtContent(`The Editor only allows content up to ${config.MAX_NUMBER_LINES} Lines!`);
resolve(res.split('\n').slice(0, config.MAX_NUMBER_LINES - 1).reduce((acc, curr) => acc + curr + "\n", ""));
}else{
resolve(res);
Expand Down
2 changes: 1 addition & 1 deletion WebSocketClient/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function displayEditorErrorAtContent(msg: string) {
debounceRemoveWidget();
}

const debounceRemoveWidget = lodash.debounce(removeWidget, 2000);
const debounceRemoveWidget = lodash.debounce(removeWidget, 5000);

function removeWidget() {
if (currentContentWidget) {
Expand Down

0 comments on commit ef06978

Please sign in to comment.