readd some used code

This commit is contained in:
Olivier Gagnon 2021-09-20 13:53:04 -04:00
parent e9b030c450
commit 9552ae3ef1
2 changed files with 8 additions and 1 deletions

@ -88,7 +88,7 @@ describe("tutorial", () => {
cy.findByRole("button", { name: "Tutorial" }).click();
cy.findByText(/a lot of different documentation about the game/i);
cy.findByRole("button", { name: "next" }).click();
cy.findByRole("button", { name: "FINISH TUTORIAL" }).click();
cy.findByText("Got it!").click();
cy.findByText(/Tutorial \(AKA Links to Documentation\)/i);

@ -20,6 +20,7 @@ function load(cb: () => void): void {
* Object store is called savestring
* key for the Object store is called save
*/
// Version 1 is important
const indexedDbRequest: IDBOpenDBRequest = window.indexedDB.open("bitburnerSave", 1);
indexedDbRequest.onerror = function (this: IDBRequest<IDBDatabase>, ev: Event) {
@ -45,6 +46,12 @@ function load(cb: () => void): void {
cb();
};
};
// This is called when there's no db to begin with. It's important.
indexedDbRequest.onupgradeneeded = function (this: IDBRequest<IDBDatabase>) {
const db = this.result;
db.createObjectStore("savestring");
};
}
export function LoadingScreen(): React.ReactElement {