Skip to content

Commit 7a78776

Browse files
authored
Merge pull request #13 from davidsanner/patch-1
Small delay before performing first update / wait for valid position …
2 parents 791ad97 + 49df67c commit 7a78776

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,11 @@ export = function (app: SignalKApp): Plugin {
166166
}
167167
}
168168

169-
// Perform initial update on startup
170-
performUpdate();
169+
// Perform initial update on startup after short delay to allow gnss position to be populated
170+
delay(4000).then(() => { performUpdate() });
171+
}
172+
function delay(time) {
173+
return new Promise((resolve) => setTimeout(resolve, time));
171174
}
172175

173176
return plugin;

0 commit comments

Comments
 (0)