Skip to content

Commit

Permalink
Merge pull request #382 from RAIRLab/325-naming-convention-held-in-Lo…
Browse files Browse the repository at this point in the history
…s-Angeles

Better Format for Downloaded Files
  • Loading branch information
RyanR712 authored Apr 15, 2024
2 parents c412cb0 + a894438 commit 4d2a377
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/AEG/AEGTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ export class AEGTree {

/**
* Returns a string representation of this AEGTree.
*
* @returns Structured ordering of all children in this AEGTree in string form.
*/
public toString(): string {
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,20 +208,20 @@ export function aegStringify(treeData: AEGTree | ProofModeNode[]): string {
/**
* Calls appropriate methods to save the current AEGTree as a file.
*/
async function saveMode() {
async function saveMode(): Promise<void> {
let name: string;
let data: AEGTree | ProofModeNode[];

if (TreeContext.modeState === "Draw") {
name = "AEG Tree";
data = TreeContext.tree;
} else {
if (TreeContext.proof.length === 0) {
name = "[] \u2192 []";
if (TreeContext.proof.length === 1) {
name = "One-Step Proof";
} else {
name =
TreeContext.proof[0].tree.toString() +
"\u2192" +
" PROVES " +
TreeContext.getLastProofStep().tree.toString();
}
data = TreeContext.proof;
Expand Down

0 comments on commit 4d2a377

Please sign in to comment.