+44
-33
lines changedFilter options
+44
-33
lines changed Original file line number Diff line number Diff line change
@@ -179,16 +179,17 @@ export default class CaseFrameModal extends React.Component<CaseFrameModalProps,
179
179
allowExchangeEntity: false,
180
180
prefix: this.prefix,
181
181
isExecuting: () => this.state.executing == true,
182
-
execute: action => {
182
+
execute: async action => {
183
183
if (this.state.executing)
184
184
return;
185
185
186
186
this.setState({ executing: true });
187
-
action()
188
-
.finally(() => this.setState({ executing: undefined }))
189
-
.done();
187
+
try {
188
+
await action();
189
+
} finally {
190
+
this.setState({ executing: undefined });
191
+
}
190
192
}
191
-
192
193
};
193
194
194
195
var activityPack = { entity: pack.activity, canExecute: pack.canExecuteActivity };
@@ -243,15 +244,16 @@ export default class CaseFrameModal extends React.Component<CaseFrameModalProps,
243
244
allowExchangeEntity: false,
244
245
prefix: this.prefix,
245
246
isExecuting: () => this.state.executing == true,
246
-
execute: action => {
247
+
execute: async action => {
247
248
if (this.state.executing)
248
249
return;
249
250
250
251
this.setState({ executing: true });
251
-
252
-
action()
253
-
.finally(() => this.setState({ executing: undefined }))
254
-
.done();
252
+
try {
253
+
await action();
254
+
} finally {
255
+
this.setState({ executing: undefined })
256
+
}
255
257
}
256
258
};
257
259
Original file line number Diff line number Diff line change
@@ -164,14 +164,16 @@ export default class CaseFramePage extends React.Component<CaseFramePageProps, C
164
164
allowExchangeEntity: false,
165
165
prefix: "caseFrame",
166
166
isExecuting: () => this.state.executing == true,
167
-
execute: action => {
167
+
execute: async action => {
168
168
if (this.state.executing)
169
169
return;
170
170
171
171
this.setState({ executing: true });
172
-
action()
173
-
.finally(() => { this.setState({ executing: undefined }) })
174
-
.done();
172
+
try {
173
+
await action();
174
+
} finally {
175
+
this.setState({ executing: undefined });
176
+
}
175
177
}
176
178
};
177
179
@@ -245,14 +247,16 @@ export default class CaseFramePage extends React.Component<CaseFramePageProps, C
245
247
allowExchangeEntity: false,
246
248
prefix: "caseFrame",
247
249
isExecuting: () => this.state.executing == true,
248
-
execute: action => {
250
+
execute: async action => {
249
251
if (this.state.executing)
250
252
return;
251
253
252
254
this.setState({ executing: true });
253
-
action()
254
-
.finally(() => this.setState({ executing: undefined }))
255
-
.done();
255
+
try {
256
+
await action();
257
+
} finally {
258
+
this.setState({ executing: undefined });
259
+
}
256
260
}
257
261
};
258
262
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"compilerOptions": {
3
-
"target": "es5",
3
+
"target": "ES2017",
4
4
"sourceMap": true,
5
5
"module": "esnext",
6
6
"moduleResolution": "node",
Original file line number Diff line number Diff line change
@@ -265,18 +265,19 @@ export const FrameModal = React.forwardRef(function FrameModal(p: FrameModalProp
265
265
allowExchangeEntity: p.buttons == "close" && (p.allowExchangeEntity ?? true),
266
266
prefix: prefix,
267
267
isExecuting: () => pc.executing == true,
268
-
execute: action => {
268
+
execute: async action => {
269
269
if (pc.executing)
270
270
return;
271
271
272
272
pc.executing = true;
273
273
forceUpdate();
274
-
action()
275
-
.finally(() => {
276
-
pc.executing = undefined;
277
-
forceUpdate();
278
-
})
279
-
.done();
274
+
try {
275
+
await action();
276
+
277
+
} finally {
278
+
pc.executing = undefined;
279
+
forceUpdate();
280
+
}
280
281
}
281
282
};
282
283
Original file line number Diff line number Diff line change
@@ -182,14 +182,18 @@ export default function FramePage(p: FramePageProps) {
182
182
entityComponent: entityComponent.current,
183
183
pack: state.pack,
184
184
isExecuting: () => state.executing == true,
185
-
execute: action => {
185
+
execute: async action => {
186
186
if (state.executing)
187
187
return;
188
188
189
189
state.executing = true;
190
190
forceUpdate();
191
-
action()
192
-
.finally(() => { state.executing = undefined; forceUpdate(); }).done();
191
+
try {
192
+
await action();
193
+
} finally {
194
+
state.executing = undefined;
195
+
forceUpdate();
196
+
}
193
197
},
194
198
onReload: (pack, reloadComponent, callback) => {
195
199
Original file line number Diff line number Diff line change
@@ -410,7 +410,7 @@ export class EntityOperationContext<T extends Entity> {
410
410
return this.settings.onClick(this);
411
411
else
412
412
return defaultOnClick(this);
413
-
});
413
+
}).done();
414
414
}
415
415
416
416
textOrNiceName() {
Original file line number Diff line number Diff line change
@@ -892,7 +892,7 @@ export function createBinding(parentValue: any, lambdaMembers: LambdaMember[]):
892
892
893
893
894
894
const functionRegex = /^function\s*\(\s*([$a-zA-Z_][0-9a-zA-Z_$]*)\s*\)\s*{\s*(\"use strict\"\;)?\s*(var [^;]*;)?\s*return\s*([^;]*)\s*;?\s*}$/;
895
-
const lambdaRegex = /^\s*\(?\s*([$a-zA-Z_][0-9a-zA-Z_$]*)\s*\)?\s*=>\s*{?\s*(return\s+)?([^;]*)\s*;?\s*}?$/;
895
+
const lambdaRegex = /^\s*\(?\s*([$a-zA-Z_][0-9a-zA-Z_$]*)\s*\)?\s*=>(\s*{?\s*(return\s+)?([^;]*)\s*;?\s*}?)$/;
896
896
const memberRegex = /^(.*)\.([$a-zA-Z_][0-9a-zA-Z_$]*)$/;
897
897
const memberIndexerRegex = /^(.*)\["([$a-zA-Z_][0-9a-zA-Z_$]*)"\]$/;
898
898
const mixinMemberRegex = /^(.*)\.mixins\["([$a-zA-Z_][0-9a-zA-Z_$]*)"\]$/; //Necessary for some crazy minimizers
Original file line number Diff line number Diff line change
@@ -493,7 +493,7 @@ export interface EntityFrame {
493
493
allowExchangeEntity: boolean;
494
494
495
495
isExecuting(): boolean;
496
-
execute: (action: () => Promise<void>) => void;
496
+
execute: (action: () => Promise<void>) => Promise<void>;
497
497
498
498
createNew?: (oldPack: EntityPack<ModifiableEntity>) => (Promise<EntityPack<ModifiableEntity> | undefined>) | undefined;
499
499
prefix: string;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"compilerOptions": {
3
-
"target": "es5",
3
+
"target": "ES2017",
4
4
"sourceMap": false,
5
5
"module": "esnext",
6
6
"moduleResolution": "node",
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4