feat: add loading state to FilledButton (#7650)

This commit is contained in:
David Luzar 2024-02-03 14:53:31 +01:00 committed by GitHub
parent d67eaa8710
commit a289c42830
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 119 additions and 31 deletions

View file

@ -10,6 +10,7 @@ import {
import { ExcalidrawElement } from "../element/types";
import { AppClassProperties, AppState } from "../types";
import { trackEvent } from "../analytics";
import { isPromiseLike } from "../utils";
const trackAction = (
action: Action,
@ -55,7 +56,7 @@ export class ActionManager {
app: AppClassProperties,
) {
this.updater = (actionResult) => {
if (actionResult && "then" in actionResult) {
if (isPromiseLike(actionResult)) {
actionResult.then((actionResult) => {
return updater(actionResult);
});