mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: add loading state to FilledButton (#7650)
This commit is contained in:
parent
d67eaa8710
commit
a289c42830
8 changed files with 119 additions and 31 deletions
|
@ -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);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue