Skip to content

Commit a0d6df2

Browse files
committedJul 9, 2021
Fix first run
1 parent 38adc7b commit a0d6df2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎src/4-storage/index.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@ export async function createStore(
1919
const repo = new GHRepository(token, username, repoName);
2020

2121
if (navigator.onLine) {
22-
await repo
22+
const isNewRepository = repo
2323
.createIfNecessary('Database for notes', true)
2424
// We don't want the app to crash if this doesn't work
25-
.catch(() => null);
25+
.catch(() => false);
26+
27+
if (await isNewRepository) {
28+
window.location.reload();
29+
}
2630
}
2731

2832
// const local = new LocalStore(repoName);

0 commit comments

Comments
 (0)
Please sign in to comment.