mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-02 22:07:06 +02:00
readd some used code
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user