Skip to content

Commit 4e4d67f

Browse files
author
Tyler Deemer
committed
Refactored attempted edit to not depend on promise timing
1 parent 4ff3d9e commit 4e4d67f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/commands/studio.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -292,22 +292,22 @@ class StudioActions {
292292
}
293293

294294
public fireOtherStudioAction(action: OtherStudioAction) {
295+
const actionObject = {
296+
id: action.toString(),
297+
label: getOtherStudioActionLabel(action)
298+
};
295299
if(action === OtherStudioAction.AttemptedEdit) {
296300
const query = "select * from %Atelier_v1_Utils.Extension_GetStatus(?)";
297301
this.api.actionQuery(query, [this.name]).then(statusObj => {
298302
const docStatus = statusObj.result.content.pop();
299303
if(!docStatus.editable) {
300304
vscode.commands.executeCommand('undo');
301-
} else {
302-
return;
305+
this.userAction(actionObject, false, "", "", 1);
303306
}
304307
});
308+
} else {
309+
this.userAction(actionObject, false, "", "", 1);
305310
}
306-
const actionObject = {
307-
id: action.toString(),
308-
label: getOtherStudioActionLabel(action)
309-
};
310-
this.userAction(actionObject, false, "", "", 1);
311311
}
312312

313313
private async processSaveFlag(saveFlag: number) {

0 commit comments

Comments
 (0)