Formatting & identification of a table regeneration bug

This commit is contained in:
Paoda
2019-02-08 22:24:01 -06:00
parent 5ca47989d1
commit b413193cb7
3 changed files with 49 additions and 16 deletions

View File

@@ -25,6 +25,7 @@ export default class SettingsManager extends Modal {
<h3>Settings</h3>
<label htmlFor="table-data">
Delete Table Data: <input onClick={this.deleteTable.bind(this)} type="button" value="Delete" name="delete-table" id="delete-table-btn" />
<br />
Regnerate Table Data: <input onClick={this.regenTable.bind(this)} type="button" value="Regenerate" name="regen-table" id="regen-table-btn" />
</label>
</form>
@@ -39,22 +40,25 @@ export default class SettingsManager extends Modal {
deleteTable() {
if (Settings.has("tableJSON")) Settings.delete("tableJSON");
else console.warn("There was no Table Saved to Delete!");
else console.info("There was no Table Saved to Delete!");
Emitter.emit("newTable", this.template)
const template = this.template;
template.id = "-1"; //Impossible ID.
Emitter.emit("newTable", this.template);
}
/**
* Regenerates a Table
* TODO: Make this a function w/ the one inside of Body.js
*/
async regenTable() {
if (Settings.has("tableJSON")) Settings.delete("tableJSON");
else console.warn("there was no Table Saved to Delete!")
else console.info("There was no Table Saved to Delete!")
let tableJSON = await generate("C:\\Users\\Paoda\\Downloads", this.template);
const tableJSON = await generate("C:\\Users\\Paoda\\Downloads", this.template);
Emitter.emit("newTable", tableJSON);