refactor(editor): Stricter linting for promises and async functions (no-changelog) (#4642)

This commit is contained in:
Michael Kret
2023-05-10 18:10:03 +03:00
committed by GitHub
parent 1b1dc0e655
commit ed3bc154b0
114 changed files with 351 additions and 344 deletions

View File

@@ -27,7 +27,7 @@ export function useHistoryHelper(activeRoute: Route) {
const isNDVOpen = ref<boolean>(ndvStore.activeNodeName !== null);
const undo = () =>
const undo = async () =>
callDebounced(
async () => {
const command = historyStore.popUndoableToUndo();
@@ -56,7 +56,7 @@ export function useHistoryHelper(activeRoute: Route) {
{ debounceTime: UNDO_REDO_DEBOUNCE_INTERVAL },
);
const redo = () =>
const redo = async () =>
callDebounced(
async () => {
const command = historyStore.popUndoableToRedo();
@@ -113,9 +113,9 @@ export function useHistoryHelper(activeRoute: Route) {
event.preventDefault();
if (!isNDVOpen.value) {
if (event.shiftKey) {
redo();
void redo();
} else {
undo();
void undo();
}
} else if (!event.shiftKey) {
trackUndoAttempt(event);