Skip to content

Commit

Permalink
Merge pull request #1557 from pascalgrimaud/front-fix-button-with-his…
Browse files Browse the repository at this point in the history
…tory

Front: fix button with history when changing path
  • Loading branch information
pascalgrimaud authored May 1, 2022
2 parents 6a12d49 + 022c99f commit 2d5d1bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default defineComponent({
const getCurrentProjectHistory = (): Promise<History> => projectHistoryService.get(project.value.folder);
const debounceGetProjectHistory = (): void => {
if (timeoutId) globalWindow.clearTimeout(timeoutId);
timeoutId = globalWindow.setTimeout(() => getCurrentProjectHistory, 400);
timeoutId = globalWindow.setTimeout(() => getCurrentProjectHistory(), 400);
};

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe('Generator', () => {
component.debounceGetProjectHistory();

const [delayedMethod, timeout] = globalWindow.setTimeout.getCall(0).args;
expect(delayedMethod()).toEqual(component.getCurrentProjectHistory);
expect(delayedMethod()).toEqual(component.getCurrentProjectHistory());
expect(timeout).toBe(400);
expect(globalWindow.clearTimeout.called).toBe(false);
});
Expand Down

0 comments on commit 2d5d1bf

Please sign in to comment.